id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
832679_41
{ "fields": [], "file": "core/src/test/java/org/apache/whirr/ClusterSpecTest.java", "identifier": "ClusterSpecTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = ConfigurationException.class)\n public void testNotSameKeyPair() throws JSchException, IOException, ConfigurationException {\n Map<String, File> first = KeyPair.generateTemporaryFiles();\n Map<String, File> second = KeyPair.generateTemporaryFiles();\n\n Configuration conf = new P...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(ClusterSpec.class)", "modifier": "static final", "original_string": "static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "DEFAULT_PROP...
{ "body": "@VisibleForTesting\n public static ClusterSpec withNoDefaults() throws ConfigurationException {\n return withNoDefaults(new PropertiesConfiguration());\n }", "class_method_signature": "ClusterSpec.withNoDefaults()", "constructor": false, "full_signature": "@VisibleForTesting public static Cluste...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_16
{ "fields": [], "file": "services/elasticsearch/src/test/java/org/apache/whirr/service/elasticsearch/ElasticSearchConfigurationBuilderTest.java", "identifier": "ElasticSearchConfigurationBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDefaultConfigAwsEC2() throws Exception {\n Configuration baseConfig = new PropertiesConfiguration();\n baseConfig.addProperty(\"whirr.provider\", \"aws-ec2\");\n baseConfig.addProperty(\"es.plugins\", \"lang-javascript, lang-python\");\n\n ClusterSpec spec = ClusterSpec...
{ "fields": [ { "declarator": "LOG =\n LoggerFactory.getLogger(ElasticSearchConfigurationBuilder.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger LOG =\n LoggerFactory.getLogger(ElasticSearchConfigurationBuilder.class);", "type": ...
{ "body": "public static Configuration buildConfig(ClusterSpec spec, Cluster cluster) {\n CompositeConfiguration config = new CompositeConfiguration();\n\n config.addConfiguration(spec.getConfiguration());\n try {\n config.addConfiguration(\n new PropertiesConfiguration(ElasticSearchConfiguration...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_61
{ "fields": [], "file": "core/src/test/java/org/apache/whirr/ClusterControllerFactoryTest.java", "identifier": "ClusterControllerFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testServiceFactoryIsCreatedFromWhirrProperties() throws IOException {\n ClusterControllerFactory factory = new ClusterControllerFactory();\n ClusterController controller = factory.create(\"test-service\");\n assertThat(controller, instanceOf(TestClusterController.class));\n }...
{ "fields": [ { "declarator": "serviceLoader =\n ServiceLoader.load(ClusterController.class)", "modifier": "private", "original_string": "private ServiceLoader<ClusterController> serviceLoader =\n ServiceLoader.load(ClusterController.class);", "type": "ServiceLoader<ClusterController...
{ "body": "public ClusterController create(String serviceName) {\n if (serviceName == null) {\n return new ClusterController();\n }\n for (ClusterController controller : serviceLoader) {\n if (controller.getName().equals(serviceName)) {\n return controller;\n }\n }\n return null;\...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_36
{ "fields": [], "file": "core/src/test/java/org/apache/whirr/ClusterSpecTest.java", "identifier": "ClusterSpecTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = ConfigurationException.class)\n public void testDummyPrivateKey()\n throws JSchException, IOException, ConfigurationException {\n File privateKeyFile = File.createTempFile(\"private\", \"key\");\n privateKeyFile.deleteOnExit();\n Files.write((\"-----BEGIN RSA PRIVATE KEY-----\...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(ClusterSpec.class)", "modifier": "static final", "original_string": "static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "DEFAULT_PROP...
{ "body": "@VisibleForTesting\n public static ClusterSpec withNoDefaults() throws ConfigurationException {\n return withNoDefaults(new PropertiesConfiguration());\n }", "class_method_signature": "ClusterSpec.withNoDefaults()", "constructor": false, "full_signature": "@VisibleForTesting public static Cluste...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_20
{ "fields": [ { "declarator": "defaults", "modifier": "private", "original_string": "private Configuration defaults;", "type": "Configuration", "var_name": "defaults" }, { "declarator": "clusterSpec", "modifier": "private", "original_string": "private Cluste...
{ "body": "@Test\n public void testCommon() throws Exception {\n Configuration conf = HadoopConfigurationBuilder.buildCommonConfiguration(\n clusterSpec, cluster, defaults);\n assertThat(Iterators.size(conf.getKeys()), is(3));\n assertThat(conf.getString(\"p1\"), is(\"common1\"));\n assertThat(con...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class);", "type": "Logger", "var_name": "LOG" ...
{ "body": "@VisibleForTesting\n static Configuration buildCommonConfiguration(ClusterSpec clusterSpec,\n Cluster cluster, Configuration defaults) throws ConfigurationException, IOException {\n Configuration config = build(clusterSpec, cluster, defaults,\n \"hadoop-common\");\n\n Instance namenode =...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_77
{ "fields": [], "file": "cli/src/test/java/org/apache/whirr/cli/command/DestroyInstanceCommandTest.java", "identifier": "DestroyInstanceCommandTest", "interfaces": "", "superclass": "extends BaseCommandTest" }
{ "body": "@Test\n public void testDestroyInstanceById() throws Exception {\n ClusterControllerFactory factory = mock(ClusterControllerFactory.class);\n ClusterController controller = mock(ClusterController.class);\n when(factory.create((String) any())).thenReturn(controller);\n\n DestroyInstanceCommand ...
{ "fields": [ { "declarator": "instanceOption = parser\n .accepts(\"instance-id\", \"Cluster instance ID\")\n .withRequiredArg()\n .ofType(String.class)", "modifier": "private", "original_string": "private OptionSpec<String> instanceOption = parser\n .accepts(\"instance-id\", \"Clust...
{ "body": "@Override\n public int run(InputStream in, PrintStream out,\n PrintStream err, List<String> args) throws Exception {\n\n OptionSet optionSet = parser.parse(args.toArray(new String[args.size()]));\n if (!optionSet.nonOptionArguments().isEmpty()) {\n printUsage(err);\n return...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_8
{ "fields": [ { "declarator": "getStatement = new StatementToInstallModule(new PrepareRemoteFileUrl() {\n\n @Override\n public String apply(String rawUrl) throws IOException {\n return rawUrl;\n }\n\n })", "modifier": "", "original_string": "StatementToInstallModule getStatement =...
{ "body": "@Test\n public void testWhenRemote() {\n\n assertEquals(\"install_tarball remote://path/to/tgz /etc/puppet/modules/nginx || return 1\\n\", getStatement.apply(\n ImmutableMap.of(\"puppet.nginx.module\", \"remote://path/to/tgz\"))\n .render(OsFamily.UNIX));\n }", "class_method_signatu...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(StatementToInstallModule.class)", "modifier": "static final", "original_string": "static final Logger LOG = LoggerFactory.getLogger(StatementToInstallModule.class);", "type": "Logger", "var_name": "LOG" }, { "...
{ "body": "@Override\n public Statement apply(Map<String, String> props) {\n try {\n return installModuleFromRemoteFileOrGit(find(props.keySet(), contains(MODULE_KEY_PATTERN)), props);\n } catch (NoSuchElementException e) {\n throw new IllegalArgumentException(format(\"couldn't find pattern: %s in pr...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_11
{ "fields": [ { "declarator": "getStatement = new StatementToInstallModule(new PrepareRemoteFileUrl() {\n\n @Override\n public String apply(String rawUrl) throws IOException {\n return rawUrl;\n }\n\n })", "modifier": "", "original_string": "StatementToInstallModule getStatement =...
{ "body": "@Test\n public void testWhenGitAndBranch() {\n\n assertEquals(\"git clone -b notmaster git://github.com/puppetlabs/puppetlabs-nginx.git /etc/puppet/modules/nginx\\n\",\n getStatement.apply(ImmutableMap.of(\"puppet.nginx.module.branch\", \"notmaster\", \"puppet.nginx.module\",\n ...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(StatementToInstallModule.class)", "modifier": "static final", "original_string": "static final Logger LOG = LoggerFactory.getLogger(StatementToInstallModule.class);", "type": "Logger", "var_name": "LOG" }, { "...
{ "body": "@Override\n public Statement apply(Map<String, String> props) {\n try {\n return installModuleFromRemoteFileOrGit(find(props.keySet(), contains(MODULE_KEY_PATTERN)), props);\n } catch (NoSuchElementException e) {\n throw new IllegalArgumentException(format(\"couldn't find pattern: %s in pr...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_46
{ "fields": [ { "declarator": "NL = System.getProperty(\"line.separator\")", "modifier": "private static final", "original_string": "private static final String NL = System.getProperty(\"line.separator\");", "type": "String", "var_name": "NL" } ], "file": "core/src/test/java/...
{ "body": "@Test\n public void testWithArgs() throws IOException {\n assertThat(\n new RunUrlStatement(false, \"http://example.org/\", \"a/b\", \"x\", \"y\").render(OsFamily.UNIX),\n is(\"runurl http://example.org/a/b x y\" + NL));\n }", "class_method_signature": "RunUrlStatementTest.testWithArgs...
{ "fields": [ { "declarator": "LOG =\n LoggerFactory.getLogger(RunUrlStatement.class)", "modifier": "private static final", "original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(RunUrlStatement.class);", "type": "Logger", "var_name": "LOG" }, {...
{ "body": "@Override\n public String render(OsFamily family) {\n StringBuilder command = new StringBuilder(\"runurl \");\n command.append(runUrl);\n if (!args.isEmpty()) {\n command.append(' ');\n command.append(Joiner.on(' ').join(args));\n }\n return Statements.exec(command.toString()).ren...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_50
{ "fields": [ { "declarator": "NL = System.getProperty(\"line.separator\")", "modifier": "private static final", "original_string": "private static final String NL = System.getProperty(\"line.separator\");", "type": "String", "var_name": "NL" } ], "file": "core/src/test/java/...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testCheckUrlDoesNotExist() throws IOException {\n RunUrlStatement.checkUrlExists(\n new URL(\"http://whirr.apache.org/non-existent\"), \"Doesn't exist\");\n }", "class_method_signature": "RunUrlStatementTest.testCheckUrlDoesNotExi...
{ "fields": [ { "declarator": "LOG =\n LoggerFactory.getLogger(RunUrlStatement.class)", "modifier": "private static final", "original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(RunUrlStatement.class);", "type": "Logger", "var_name": "LOG" }, {...
{ "body": "public static void checkUrlExists(URL url, String errorMessageTemplate,\n Object... errorMessageArgs)\n throws IOException {\n if (!urlExists(url)) {\n throw new IllegalArgumentException(\n String.format(errorMessageTemplate, errorMessageArgs));\n }\n }", "class_method_sign...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_3
{ "fields": [ { "declarator": "NGINX_PUPPET = \"class { 'nginx':\\n}\"", "modifier": "private static final", "original_string": "private static final String NGINX_PUPPET = \"class { 'nginx':\\n}\";", "type": "String", "var_name": "NGINX_PUPPET" }, { "declarator": "POSTG...
{ "body": "@Test\n public void testPuppetConversionWithAttribsHiera() {\n\n Manifest ntp = new Manifest(\"ntp\");\n ntp.attribs.put(\"servers\", \"\\\"10.0.0.1\\\"\");\n\n assertEquals(\"Puppet/Hiera representation is incorrect.\", NTP_PUPPET_HIERA,\n ntp.getHiera());\n }", "class_method_signature"...
{ "fields": [ { "declarator": "module", "modifier": "public final", "original_string": "public final String module;", "type": "String", "var_name": "module" }, { "declarator": "className", "modifier": "public final", "original_string": "public final String c...
{ "body": "public String getHiera() {\n String name = getName();\n StringBuilder result = new StringBuilder();\n for (Map.Entry<String, String> entry : attribs.entrySet()) {\n result.append(\"\\n\" + name + \"::\" + entry.getKey() + \": \" + entry.getValue());\n }\n return result.toString();\n }"...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_70
{ "fields": [], "file": "cli/src/test/java/org/apache/whirr/cli/command/RunScriptCommandTest.java", "identifier": "RunScriptCommandTest", "interfaces": "", "superclass": "extends BaseCommandTest" }
{ "body": "@Test\n public void testRunScriptByRole() throws Exception {\n ClusterControllerFactory factory = mock(ClusterControllerFactory.class);\n ClusterController controller = mock(ClusterController.class);\n when(factory.create((String)any())).thenReturn(controller);\n\n ClusterStateStore memStore =...
{ "fields": [ { "declarator": "rolesOption = parser\n .accepts(\"roles\", \"List of comma separated role names. \" +\n \"E.g. zookeeper,hadoop-namenode\")\n .withRequiredArg()\n .ofType(String.class)", "modifier": "private", "original_string": "private OptionSpec<String> rolesOptio...
{ "body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n\n OptionSet optionSet = parser.parse(args.toArray(new String[0]));\n if (!optionSet.has(scriptOption)) {\n err.println(\"Please specify a script file to be exec...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_27
{ "fields": [], "file": "services/hadoop/src/test/java/org/apache/whirr/service/hadoop/HadoopConfigurationConverterTest.java", "identifier": "HadoopConfigurationConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFinal() {\n Configuration conf = new PropertiesConfiguration();\n conf.setProperty(\"p1\", \"v1\");\n conf.setProperty(\"p2\", \"v2\");\n conf.setProperty(\"p2.final\", \"true\");\n List<String> lines = HadoopConfigurationConverter.asXmlConfigurationLines(conf);\n ...
{ "fields": [ { "declarator": "LOG =\n LoggerFactory.getLogger(HadoopConfigurationConverter.class)", "modifier": "private static final", "original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(HadoopConfigurationConverter.class);", "type": "Logger", "var...
{ "body": "@VisibleForTesting\n static List<String> asXmlConfigurationLines(Configuration hadoopConfig) {\n List<String> lines = Lists.newArrayList();\n lines.add(\"<configuration>\");\n for (@SuppressWarnings(\"unchecked\")\n Iterator<String> it = hadoopConfig.getKeys(); it.hasNext(); ) {\n Str...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_31
{ "fields": [ { "declarator": "NGINX_JSON = \"{\\\"run_list\\\":[\\\"recipe[nginx]\\\"]}\"", "modifier": "private static final", "original_string": "private static final String NGINX_JSON = \"{\\\"run_list\\\":[\\\"recipe[nginx]\\\"]}\";", "type": "String", "var_name": "NGINX_JSON" ...
{ "body": "@Test\n public void testStatementGeneration() {\n\n Recipe recipe = new Recipe(\"nginx\", null, \"http://myurl\");\n recipe.attribs.put(\"webport\", \"90\");\n\n recipe.fileName = \"test\";\n\n assertEquals(\"Statement representation incorrect\", CHEF_COMMAND,\n recipe.render(OsFamily.U...
{ "fields": [ { "declarator": "cookbook", "modifier": "public final", "original_string": "public final String cookbook;", "type": "String", "var_name": "cookbook" }, { "declarator": "recipe", "modifier": "public final", "original_string": "public final Strin...
{ "body": "@Override\n public String render(OsFamily family) {\n\n if (family.equals(OsFamily.UNIX)) {\n // store the json file in tmp\n String fileName = \"/tmp/\" + this.fileName + \".json\";\n\n Statement storeJSonFile = Statements.createOrOverwriteFile(fileName,\n Collections.singleton...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_66
{ "fields": [], "file": "cli/src/test/java/org/apache/whirr/cli/command/LaunchClusterCommandTest.java", "identifier": "LaunchClusterCommandTest", "interfaces": "", "superclass": "extends BaseCommandTest" }
{ "body": "@Test\n public void testMaxPercentFailure() throws Exception {\n \n ClusterControllerFactory factory = mock(ClusterControllerFactory.class);\n ClusterController controller = mock(ClusterController.class);\n Cluster cluster = mock(Cluster.class);\n when(factory.create((String) any())).thenRe...
{ "fields": [], "file": "cli/src/main/java/org/apache/whirr/cli/command/LaunchClusterCommand.java", "identifier": "LaunchClusterCommand", "interfaces": "", "methods": [ { "class_method_signature": "LaunchClusterCommand.LaunchClusterCommand()", "constructor": true, "full_signature": "publ...
{ "body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n OptionSet optionSet = parser.parse(args.toArray(new String[args.size()]));\n\n if (!optionSet.nonOptionArguments().isEmpty()) {\n printUsage(err);\n return...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_67
{ "fields": [], "file": "cli/src/test/java/org/apache/whirr/cli/command/LaunchClusterCommandTest.java", "identifier": "LaunchClusterCommandTest", "interfaces": "", "superclass": "extends BaseCommandTest" }
{ "body": "@Test\n public void testLaunchClusterUsingDryRun() throws Exception {\n\n ClusterControllerFactory factory = new ClusterControllerFactory();\n TestLaunchClusterCommand launchCluster = new TestLaunchClusterCommand(factory);\n\n Map<String, File> keys = KeyPair.generateTemporaryFiles();\n\n int ...
{ "fields": [], "file": "cli/src/main/java/org/apache/whirr/cli/command/LaunchClusterCommand.java", "identifier": "LaunchClusterCommand", "interfaces": "", "methods": [ { "class_method_signature": "LaunchClusterCommand.LaunchClusterCommand()", "constructor": true, "full_signature": "publ...
{ "body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n OptionSet optionSet = parser.parse(args.toArray(new String[args.size()]));\n\n if (!optionSet.nonOptionArguments().isEmpty()) {\n printUsage(err);\n return...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_30
{ "fields": [ { "declarator": "NGINX_JSON = \"{\\\"run_list\\\":[\\\"recipe[nginx]\\\"]}\"", "modifier": "private static final", "original_string": "private static final String NGINX_JSON = \"{\\\"run_list\\\":[\\\"recipe[nginx]\\\"]}\";", "type": "String", "var_name": "NGINX_JSON" ...
{ "body": "@Test\n public void testJSONConversionWithAttribs() {\n\n // use the example recipe from\n // http://wiki.opscode.com/display/chef/Chef+Solo\n\n Recipe resolver = new Recipe(\"resolver\");\n resolver.attribs.put(\"nameservers\", new String[] { \"10.0.0.1\" });\n resolver.attribs.put(\"searc...
{ "fields": [ { "declarator": "cookbook", "modifier": "public final", "original_string": "public final String cookbook;", "type": "String", "var_name": "cookbook" }, { "declarator": "recipe", "modifier": "public final", "original_string": "public final Strin...
{ "body": "public String toJSON() {\n Gson gson = new Gson();\n JsonObject recipeAsJSON = new JsonObject();\n\n if (!attribs.isEmpty()) {\n JsonObject jsonAttribs = new JsonObject();\n for (Map.Entry<String, Object> entry : attribs.entrySet()) {\n jsonAttribs.add(entry.getKey(), gson.toJsonT...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_26
{ "fields": [], "file": "services/hadoop/src/test/java/org/apache/whirr/service/hadoop/HadoopConfigurationConverterTest.java", "identifier": "HadoopConfigurationConverterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConversion() {\n Configuration conf = new PropertiesConfiguration();\n conf.setProperty(\"p1\", \"v1,v2\");\n conf.setProperty(\"p2\", \"v3\");\n List<String> lines = HadoopConfigurationConverter.asXmlConfigurationLines(conf);\n assertThat(lines, is((List<String>) Li...
{ "fields": [ { "declarator": "LOG =\n LoggerFactory.getLogger(HadoopConfigurationConverter.class)", "modifier": "private static final", "original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(HadoopConfigurationConverter.class);", "type": "Logger", "var...
{ "body": "@VisibleForTesting\n static List<String> asXmlConfigurationLines(Configuration hadoopConfig) {\n List<String> lines = Lists.newArrayList();\n lines.add(\"<configuration>\");\n for (@SuppressWarnings(\"unchecked\")\n Iterator<String> it = hadoopConfig.getKeys(); it.hasNext(); ) {\n Str...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_71
{ "fields": [], "file": "cli/src/test/java/org/apache/whirr/cli/command/DestroyClusterCommandTest.java", "identifier": "DestroyClusterCommandTest", "interfaces": "", "superclass": "extends BaseCommandTest" }
{ "body": "@Test\n public void testInsufficientOptions() throws Exception {\n DestroyClusterCommand command = new DestroyClusterCommand();\n Map<String, File> keys = KeyPair.generateTemporaryFiles();\n int rc = command.run(null, null, err, Lists.<String>newArrayList(\n \"--private-key-file\", keys.ge...
{ "fields": [], "file": "cli/src/main/java/org/apache/whirr/cli/command/DestroyClusterCommand.java", "identifier": "DestroyClusterCommand", "interfaces": "", "methods": [ { "class_method_signature": "DestroyClusterCommand.DestroyClusterCommand()", "constructor": true, "full_signature": "...
{ "body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n\n OptionSet optionSet = parser.parse(args.toArray(new String[args.size()]));\n\n if (!optionSet.nonOptionArguments().isEmpty()) {\n printUsage(err);\n retu...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_2
{ "fields": [ { "declarator": "NGINX_PUPPET = \"class { 'nginx':\\n}\"", "modifier": "private static final", "original_string": "private static final String NGINX_PUPPET = \"class { 'nginx':\\n}\";", "type": "String", "var_name": "NGINX_PUPPET" }, { "declarator": "POSTG...
{ "body": "@Test\n public void testPuppetConversionWithAttribs() {\n\n Manifest ntp = new Manifest(\"ntp\");\n ntp.attribs.put(\"servers\", \"\\\"10.0.0.1\\\"\");\n\n assertEquals(\"Puppet representation is incorrect.\", NTP_PUPPET,\n ntp.toString());\n\n }", "class_method_signature": "ManifestTest.tes...
{ "fields": [ { "declarator": "module", "modifier": "public final", "original_string": "public final String module;", "type": "String", "var_name": "module" }, { "declarator": "className", "modifier": "public final", "original_string": "public final String c...
{ "body": "public String toString() {\n StringBuilder resource = new StringBuilder();\n for (String s : toStringList()) {\n if (resource.length() > 0)\n resource.append(\"\\n\");\n resource.append(s);\n }\n return resource.toString();\n }", "class_method_signature": "Manifest.toString(...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_51
{ "fields": [], "file": "core/src/test/java/org/apache/whirr/command/AbstractClusterCommandTest.java", "identifier": "AbstractClusterCommandTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOverrides() throws Exception {\n AbstractClusterCommand clusterCommand = new AbstractClusterCommand(\"name\",\n \"description\", new ClusterControllerFactory()) {\n @Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<Stri...
{ "fields": [ { "declarator": "LOG =\n LoggerFactory.getLogger(AbstractClusterCommand.class)", "modifier": "private static final", "original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(AbstractClusterCommand.class);", "type": "Logger", "var_name": "LOG...
{ "body": "protected ClusterSpec getClusterSpec(OptionSet optionSet) throws ConfigurationException {\n Configuration optionsConfig = new PropertiesConfiguration();\n for (Map.Entry<Property, OptionSpec<?>> entry : optionSpecs.entrySet()) {\n Property property = entry.getKey();\n OptionSpec<?> option =...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_47
{ "fields": [ { "declarator": "NL = System.getProperty(\"line.separator\")", "modifier": "private static final", "original_string": "private static final String NL = System.getProperty(\"line.separator\");", "type": "String", "var_name": "NL" } ], "file": "core/src/test/java/...
{ "body": "@Test\n public void testBaseWithoutTrailingSlash() throws IOException {\n assertThat(\n new RunUrlStatement(false, \"http://example.org\", \"a/b\").render(OsFamily.UNIX),\n is(\"runurl http://example.org/a/b\" + NL));\n }", "class_method_signature": "RunUrlStatementTest.testBaseWithout...
{ "fields": [ { "declarator": "LOG =\n LoggerFactory.getLogger(RunUrlStatement.class)", "modifier": "private static final", "original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(RunUrlStatement.class);", "type": "Logger", "var_name": "LOG" }, {...
{ "body": "@Override\n public String render(OsFamily family) {\n StringBuilder command = new StringBuilder(\"runurl \");\n command.append(runUrl);\n if (!args.isEmpty()) {\n command.append(' ');\n command.append(Joiner.on(' ').join(args));\n }\n return Statements.exec(command.toString()).ren...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
832679_10
{ "fields": [ { "declarator": "getStatement = new StatementToInstallModule(new PrepareRemoteFileUrl() {\n\n @Override\n public String apply(String rawUrl) throws IOException {\n return rawUrl;\n }\n\n })", "modifier": "", "original_string": "StatementToInstallModule getStatement =...
{ "body": "@Test\n public void testWhenGit() {\n\n assertEquals(\"git clone git://github.com/puppetlabs/puppetlabs-nginx.git /etc/puppet/modules/nginx\\n\",\n getStatement.apply(ImmutableMap.of(\"puppet.nginx.module\",\n \"git://github.com/puppetlabs/puppetlabs-nginx.git\")).render(O...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(StatementToInstallModule.class)", "modifier": "static final", "original_string": "static final Logger LOG = LoggerFactory.getLogger(StatementToInstallModule.class);", "type": "Logger", "var_name": "LOG" }, { "...
{ "body": "@Override\n public Statement apply(Map<String, String> props) {\n try {\n return installModuleFromRemoteFileOrGit(find(props.keySet(), contains(MODULE_KEY_PATTERN)), props);\n } catch (NoSuchElementException e) {\n throw new IllegalArgumentException(format(\"couldn't find pattern: %s in pr...
{ "created": null, "fork": null, "fork_count": 60, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 832679, "size": 9902, "stargazer_count": 96, "stars": null, "updates": null, "url": "https://github.com/apache/attic-whirr" }
217157573_0
{ "fields": [ { "declarator": "redisTestSupport", "modifier": "@Autowired\n protected", "original_string": "@Autowired\n protected RedisGWCTestSupport redisTestSupport;", "type": "RedisGWCTestSupport", "var_name": "redisTestSupport" }, { "declarator": "config", ...
{ "body": "@Test\n public void testEmptyDefault() {\n Optional<? extends BlobStoreInfo> info = config.getDefaultBlobStore();\n assertThat(info, TestUtils.notPresent());\n }", "class_method_signature": "RedisBlobStoreConfigurationTest.testEmptyDefault()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "bsRepository", "modifier": "private final", "original_string": "private final BlobStoreRepository bsRepository;", "type": "BlobStoreRepository", "var_name": "bsRepository" }, { "declarator": "blobStoreListeners = new BlobStoreConfiguration...
{ "body": "@Override\n public Optional<? extends BlobStoreInfo> getDefaultBlobStore() {\n return bsRepository.findByDefaultFlag(true)\n .map(BlobStoreInfoRedisImpl::getInfo);\n }", "class_method_signature": "RedisBlobStoreConfiguration.getDefaultBlobStore()", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 18, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 217157573, "size": 137798, "stargazer_count": 29, "stars": null, "updates": null, "url": "https://github.com/planetlabs/stratus" }
217157573_1
{ "fields": [ { "declarator": "bsAgg", "modifier": "private", "original_string": "private BlobStoreAggregator bsAgg;", "type": "BlobStoreAggregator", "var_name": "bsAgg" }, { "declarator": "tld", "modifier": "private", "original_string": "private TileLayerDi...
{ "body": "@Test\n public void testAddListener() throws Exception {\n bsAgg = EasyMock.createMock(\"bsAgg\", BlobStoreAggregator.class);\n tld = EasyMock.createMock(\"tld\", TileLayerDispatcher.class);\n \n testBlobStoreInfo = EasyMock.createMock(\"testBlobStoreInfo\", BlobStoreInfo.cla...
{ "fields": [ { "declarator": "layers", "modifier": "private", "original_string": "private TileLayerDispatcher layers;", "type": "TileLayerDispatcher", "var_name": "layers" }, { "declarator": "blobStoreAggregator", "modifier": "private", "original_string": "...
{ "body": "@Override\n public void addListener(BlobStoreListener listener) {\n listeners.add(listener);\n cache.get().values().forEach(entry->{entry.store.addListener(listener);});\n StoreAndConfig defaultEntry = defaultCache.get();\n if(Objects.nonNull(defaultEntry)) {\n def...
{ "created": null, "fork": null, "fork_count": 18, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 217157573, "size": 137798, "stargazer_count": 29, "stars": null, "updates": null, "url": "https://github.com/planetlabs/stratus" }
217157573_6
{ "fields": [ { "declarator": "interceptor", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private CatalogRestInterceptor interceptor;", "type": "CatalogRestInterceptor", "var_name": "interceptor" }, { "declarator": "ADMIN_USERNAME = \"admin...
{ "body": "@Test\n @WithMockUser(username = ADMIN_USERNAME, password = ADMIN_PASSWORD, roles = ADMIN_ROLES)\n public void testInterceptor() throws Exception {\n MockHttpServletRequest request = new MockHttpServletRequest(RequestMethod.GET.toString(), TEST_URL);\n MockHttpServletResponse response =...
{ "fields": [ { "declarator": "PATHS = {\"/rest/redis/**\"}", "modifier": "public final static", "original_string": "public final static String[] PATHS = {\"/rest/redis/**\"};", "type": "String[]", "var_name": "PATHS" } ], "file": "src/stratus-redis-catalog/src/main/java/stra...
{ "body": "@Override\n public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n if (!GeoServerExtensions.bean(GeoServerSecurityManager.class).checkAuthenticationForAdminRole()) {\n response.sendError(HttpStatus.UNAUTHORIZED.value(), \...
{ "created": null, "fork": null, "fork_count": 18, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 217157573, "size": 137798, "stargazer_count": 29, "stars": null, "updates": null, "url": "https://github.com/planetlabs/stratus" }
217157573_7
{ "fields": [ { "declarator": "interceptor", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private CatalogRestInterceptor interceptor;", "type": "CatalogRestInterceptor", "var_name": "interceptor" }, { "declarator": "ADMIN_USERNAME = \"admin...
{ "body": "@Test\n @WithMockUser(username = USER_USERNAME, password = USER_PASSWORD, roles = USER_ROLES)\n public void testUnauthorizedInterceptor() throws Exception {\n MockHttpServletRequest request = new MockHttpServletRequest(RequestMethod.GET.toString(), TEST_URL);\n MockHttpServletResponse r...
{ "fields": [ { "declarator": "PATHS = {\"/rest/redis/**\"}", "modifier": "public final static", "original_string": "public final static String[] PATHS = {\"/rest/redis/**\"};", "type": "String[]", "var_name": "PATHS" } ], "file": "src/stratus-redis-catalog/src/main/java/stra...
{ "body": "@Override\n public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n if (!GeoServerExtensions.bean(GeoServerSecurityManager.class).checkAuthenticationForAdminRole()) {\n response.sendError(HttpStatus.UNAUTHORIZED.value(), \...
{ "created": null, "fork": null, "fork_count": 18, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 217157573, "size": 137798, "stargazer_count": 29, "stars": null, "updates": null, "url": "https://github.com/planetlabs/stratus" }
217157573_8
{ "fields": [], "file": "src/stratus-extras/ndvi-process/src/test/java/stratus/ndvi/NDVIProcessTest.java", "identifier": "NDVIProcessTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testExecute() throws Exception {\n File testFile = new File(\"src/test/java/rgbnir_cropped.tiff\");\n GeoTiffReader geoTiffReader = new GeoTiffReader(testFile);\n GridCoverage2D coverage = geoTiffReader.read(new GeneralParameterValue[0]);\n NDVIProcess ndv...
{ "fields": [], "file": "src/stratus-extras/ndvi-process/src/main/java/stratus/ndvi/NDVIProcess.java", "identifier": "NDVIProcess", "interfaces": "implements RasterProcess", "methods": [ { "class_method_signature": "NDVIProcess.execute(\n @DescribeParameter(name = \"coverage\", description = \"...
{ "body": "@DescribeResult(name = \"result\", description = \"A NDVI calculation on the input coverage\")\n public GridCoverage2D execute(\n @DescribeParameter(name = \"coverage\", description = \"Input GridCoverage\", min = 1)\n GridCoverage2D coverage,\n @DescribeParameter(\n name = \...
{ "created": null, "fork": null, "fork_count": 18, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 217157573, "size": 137798, "stargazer_count": 29, "stars": null, "updates": null, "url": "https://github.com/planetlabs/stratus" }
217157573_4
{ "fields": [ { "declarator": "bsAgg", "modifier": "private", "original_string": "private BlobStoreAggregator bsAgg;", "type": "BlobStoreAggregator", "var_name": "bsAgg" }, { "declarator": "tld", "modifier": "private", "original_string": "private TileLayerDi...
{ "body": "@Test\n public void testDeleteRequestDefault() throws Exception {\n bsAgg = EasyMock.createMock(\"bsAgg\", DefaultingBlobStoreAggregator.class);\n tld = EasyMock.createMock(\"tld\", TileLayerDispatcher.class);\n \n testBlobStoreInfo = EasyMock.createMock(\"testBlobStoreInfo\"...
{ "fields": [ { "declarator": "layers", "modifier": "private", "original_string": "private TileLayerDispatcher layers;", "type": "TileLayerDispatcher", "var_name": "layers" }, { "declarator": "blobStoreAggregator", "modifier": "private", "original_string": "...
{ "body": "@Override\n public boolean delete(String layerName) throws StorageException {\n return storeByLayer(layerName).delete(layerName);\n }", "class_method_signature": "ClusteredCompositeBlobStore.delete(String layerName)", "constructor": false, "full_signature": "@Override public boolean dele...
{ "created": null, "fork": null, "fork_count": 18, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 217157573, "size": 137798, "stargazer_count": 29, "stars": null, "updates": null, "url": "https://github.com/planetlabs/stratus" }
217157573_5
{ "fields": [ { "declarator": "bsAgg", "modifier": "private", "original_string": "private BlobStoreAggregator bsAgg;", "type": "BlobStoreAggregator", "var_name": "bsAgg" }, { "declarator": "tld", "modifier": "private", "original_string": "private TileLayerDi...
{ "body": "@Test\n public void testDeleteRequestDefaultNonDefaultingAggregator() throws Exception {\n bsAgg = EasyMock.createMock(\"bsAgg\", BlobStoreAggregator.class);\n tld = EasyMock.createMock(\"tld\", TileLayerDispatcher.class);\n \n testBlobStoreInfo = EasyMock.createMock(\"testBl...
{ "fields": [ { "declarator": "layers", "modifier": "private", "original_string": "private TileLayerDispatcher layers;", "type": "TileLayerDispatcher", "var_name": "layers" }, { "declarator": "blobStoreAggregator", "modifier": "private", "original_string": "...
{ "body": "@Override\n public boolean delete(String layerName) throws StorageException {\n return storeByLayer(layerName).delete(layerName);\n }", "class_method_signature": "ClusteredCompositeBlobStore.delete(String layerName)", "constructor": false, "full_signature": "@Override public boolean dele...
{ "created": null, "fork": null, "fork_count": 18, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 217157573, "size": 137798, "stargazer_count": 29, "stars": null, "updates": null, "url": "https://github.com/planetlabs/stratus" }
217157573_2
{ "fields": [ { "declarator": "bsAgg", "modifier": "private", "original_string": "private BlobStoreAggregator bsAgg;", "type": "BlobStoreAggregator", "var_name": "bsAgg" }, { "declarator": "tld", "modifier": "private", "original_string": "private TileLayerDi...
{ "body": "@Test\n public void testRemoveListener() throws Exception {\n bsAgg = EasyMock.createMock(\"bsAgg\", BlobStoreAggregator.class);\n tld = EasyMock.createMock(\"tld\", TileLayerDispatcher.class);\n \n testBlobStoreInfo = EasyMock.createMock(\"testBlobStoreInfo\", BlobStoreInfo....
{ "fields": [ { "declarator": "layers", "modifier": "private", "original_string": "private TileLayerDispatcher layers;", "type": "TileLayerDispatcher", "var_name": "layers" }, { "declarator": "blobStoreAggregator", "modifier": "private", "original_string": "...
{ "body": "@Override\n public boolean removeListener(BlobStoreListener listener) {\n Boolean result = listeners.remove(listener);\n cache.get().values().forEach(entry->{entry.store.removeListener(listener);});\n StoreAndConfig defaultEntry = defaultCache.get();\n if(Objects.nonNull(defa...
{ "created": null, "fork": null, "fork_count": 18, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 217157573, "size": 137798, "stargazer_count": 29, "stars": null, "updates": null, "url": "https://github.com/planetlabs/stratus" }
217157573_3
{ "fields": [ { "declarator": "bsAgg", "modifier": "private", "original_string": "private BlobStoreAggregator bsAgg;", "type": "BlobStoreAggregator", "var_name": "bsAgg" }, { "declarator": "tld", "modifier": "private", "original_string": "private TileLayerDi...
{ "body": "@Test\n public void testDeleteRequestNamed() throws Exception {\n bsAgg = EasyMock.createMock(\"bsAgg\", BlobStoreAggregator.class);\n tld = EasyMock.createMock(\"tld\", TileLayerDispatcher.class);\n \n testBlobStoreInfo = EasyMock.createMock(\"testBlobStoreInfo\", BlobStoreI...
{ "fields": [ { "declarator": "layers", "modifier": "private", "original_string": "private TileLayerDispatcher layers;", "type": "TileLayerDispatcher", "var_name": "layers" }, { "declarator": "blobStoreAggregator", "modifier": "private", "original_string": "...
{ "body": "@Override\n public boolean delete(String layerName) throws StorageException {\n return storeByLayer(layerName).delete(layerName);\n }", "class_method_signature": "ClusteredCompositeBlobStore.delete(String layerName)", "constructor": false, "full_signature": "@Override public boolean dele...
{ "created": null, "fork": null, "fork_count": 18, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 217157573, "size": 137798, "stargazer_count": 29, "stars": null, "updates": null, "url": "https://github.com/planetlabs/stratus" }
47973088_668
{ "fields": [], "file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/resolver/named/NamedOperationScoreResolverTest.java", "identifier": "NamedOperationScoreResolverTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldGetScore() throws CacheOperationFailedException {\n // Given\n final Integer expectedScore = 5;\n final String opName = \"otherOp\";\n\n final NamedOperation<Element, Iterable<? extends Element>> namedOp = mock(NamedOperation.class);\n namedOp...
{ "fields": [ { "declarator": "cache", "modifier": "private final", "original_string": "private final NamedOperationCache cache;", "type": "NamedOperationCache", "var_name": "cache" }, { "declarator": "LOGGER = LoggerFactory.getLogger(NamedOperationScoreResolver.class)"...
{ "body": "@Override\n public Integer getScore(final NamedOperation operation) {\n return getScore(operation, null);\n }", "class_method_signature": "NamedOperationScoreResolver.getScore(final NamedOperation operation)", "constructor": false, "full_signature": "@Override public Integer getScore(fin...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_392
{ "fields": [], "file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/PropertiesTest.java", "identifier": "PropertiesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldConstructPropertiesWithOtherProperties() {\n final Map<String, Object> otherProperties = new HashMap<>();\n otherProperties.put(\"propertyName\", \"property value\");\n\n final Properties properties = new Properties(otherProperties);\n\n assertEquals...
{ "fields": [ { "declarator": "serialVersionUID = -5412533432398907359L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -5412533432398907359L;", "type": "long", "var_name": "serialVersionUID" } ], "file": "core/data/src/m...
{ "body": "@Override\n public Object put(final String name, final Object value) {\n if (null != name) {\n if (null == value) {\n return super.remove(name);\n } else {\n return super.put(name, value);\n }\n }\n return null;\n }",...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_238
{ "fields": [ { "declarator": "GRAPH_ID = \"graphId\"", "modifier": "private static final", "original_string": "private static final String GRAPH_ID = \"graphId\";", "type": "String", "var_name": "GRAPH_ID" }, { "declarator": "service", "modifier": "@InjectMocks\n...
{ "body": "@Test\n public void shouldGetFilterFunctions() throws IOException {\n // When\n final Set<Class> classes = service.getFilterFunctions(null);\n\n // Then\n assertThat(classes, IsCollectionContaining.hasItem(IsA.class));\n }", "class_method_signature": "GraphConfigurationS...
{ "fields": [ { "declarator": "graphFactory", "modifier": "@Inject\n private", "original_string": "@Inject\n private GraphFactory graphFactory;", "type": "GraphFactory", "var_name": "graphFactory" }, { "declarator": "userFactory", "modifier": "@Inject\n p...
{ "body": "@Override\n public Set<Class> getFilterFunctions() {\n return ReflectionUtil.getSubTypes(Predicate.class);\n }", "class_method_signature": "GraphConfigurationService.getFilterFunctions()", "constructor": false, "full_signature": "@Override public Set<Class> getFilterFunctions()", "iden...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1210
{ "fields": [], "file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/output/ToListTest.java", "identifier": "ToListTest", "interfaces": "", "superclass": "extends OperationTest<ToList>" }
{ "body": "@Test\n @Override\n public void builderShouldCreatePopulatedOperation() {\n // Given\n final ToList<String> toList = new ToList.Builder<String>().input(\"1\", \"2\").build();\n\n // Then\n assertThat(toList.getInput(), is(notNullValue()));\n assertThat(toList.getInp...
{ "fields": [ { "declarator": "input", "modifier": "private", "original_string": "private Iterable<? extends T> input;", "type": "Iterable<? extends T>", "var_name": "input" }, { "declarator": "options", "modifier": "private", "original_string": "private Map...
{ "body": "@Override\n public Iterable<? extends T> getInput() {\n return input;\n }", "class_method_signature": "ToList.getInput()", "constructor": false, "full_signature": "@Override public Iterable<? extends T> getInput()", "identifier": "getInput", "invocations": [], "modifiers": "@Overri...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1355
{ "fields": [ { "declarator": "DELTA = 0.01D", "modifier": "private static final", "original_string": "private static final double DELTA = 0.01D;", "type": "double", "var_name": "DELTA" }, { "declarator": "SERIALISER = new StringsSketchSerialiser()", "modifier": "...
{ "body": "@Test\n public void testCanHandleDoublesUnion() {\n assertTrue(SERIALISER.canHandle(ItemsSketch.class));\n assertFalse(SERIALISER.canHandle(String.class));\n }", "class_method_signature": "StringsSketchSerialiserTest.testCanHandleDoublesUnion()", "constructor": false, "full_signat...
{ "fields": [ { "declarator": "serialVersionUID = 7091724743812159058L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 7091724743812159058L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "SERIA...
{ "body": "@Override\n public boolean canHandle(final Class clazz) {\n return ItemsSketch.class.equals(clazz);\n }", "class_method_signature": "StringsSketchSerialiser.canHandle(final Class clazz)", "constructor": false, "full_signature": "@Override public boolean canHandle(final Class clazz)", "...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_687
{ "fields": [], "file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/compare/SortHandlerTest.java", "identifier": "SortHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldSortBasedOnPropertyIncludingNulls() throws OperationException, JsonProcessingException {\n // Given\n final Entity entity1 = new Entity.Builder().group(TestGroups.ENTITY).property(\"property\", 1).build();\n final Entity entity2 ...
{ "fields": [ { "declarator": "MAX_HANDLER = new MaxHandler()", "modifier": "private static final", "original_string": "private static final MaxHandler MAX_HANDLER = new MaxHandler();", "type": "MaxHandler", "var_name": "MAX_HANDLER" } ], "file": "core/store/src/main/java/uk/...
{ "body": "@Override\n public Iterable<? extends Element> doOperation(final Sort operation, final Context context, final Store store) throws OperationException {\n // If there is no input or there are no comparators, we return null\n if (null == operation.getInput()\n || null == operat...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_957
{ "fields": [ { "declarator": "EDGE_DESCRIPTION = \"Edge description\"", "modifier": "public static final", "original_string": "public static final String EDGE_DESCRIPTION = \"Edge description\";", "type": "String", "var_name": "EDGE_DESCRIPTION" }, { "declarator": "ENT...
{ "body": "@Test\n public void shouldReturnFalseWhenSchemaHasEmptyValidatorEdgeFilters() {\n // Given\n final Schema schema = new Schema.Builder()\n .edge(TestGroups.EDGE,\n new SchemaEdgeDefinition.Buil...
{ "fields": [ { "declarator": "unknownType = new TypeDefinition()", "modifier": "private final", "original_string": "private final TypeDefinition unknownType = new TypeDefinition();", "type": "TypeDefinition", "var_name": "unknownType" }, { "declarator": "id", "mo...
{ "body": "public boolean hasValidation() {\n for (final SchemaElementDefinition elementDef : new ChainedIterable<SchemaElementDefinition>(getEntities().values(), getEdges().values())) {\n if (null != elementDef) {\n if (elementDef.hasValidation()) {\n return true;\...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_404
{ "fields": [], "file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ElementAggregatorTest.java", "identifier": "ElementAggregatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldAggregateElementUsingKorypheBinaryOperator() {\n // Given\n final String reference = \"reference1\";\n\n final BinaryOperator<Integer> function = new KorypheBinaryOperator<Integer>() {\n @Override\n public Integer _apply(final Integer ...
{ "fields": [ { "declarator": "stateTuple = new PropertiesTuple()", "modifier": "private final", "original_string": "private final PropertiesTuple stateTuple = new PropertiesTuple();", "type": "PropertiesTuple", "var_name": "stateTuple" }, { "declarator": "propertiesTup...
{ "body": "public Element apply(final Element state, final Element element) {\n if (null == state) {\n return element;\n }\n\n apply(state.getProperties(), element.getProperties());\n return state;\n }", "class_method_signature": "ElementAggregator.apply(final Element state...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_111
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(AddUpdateTableIteratorTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AddUpdateTableIteratorTest.class);", "type": "Logger", "var_name": ...
{ "body": "@Test\n public void shouldThrowKeyErrorWhenInvalidModifyKeyGiven() throws Exception {\n // Given\n final String[] args = {GRAPH_ID, SCHEMA_DIR, STORE_PROPS_PATH_UPDATED, \"invalid key\", FILE_GRAPH_LIBRARY_TEST_PATH};\n\n // When\n IllegalArgumentException actual = assertThro...
{ "fields": [ { "declarator": "UPDATE_KEY = \"update\"", "modifier": "public static final", "original_string": "public static final String UPDATE_KEY = \"update\";", "type": "String", "var_name": "UPDATE_KEY" }, { "declarator": "REMOVE_KEY = \"remove\"", "modifier...
{ "body": "public static void main(final String[] args) throws Exception {\n if (args.length < NUM_REQUIRED_ARGS) {\n System.err.println(\"Wrong number of arguments. \\nUsage: \"\n + \"<graphId> \"\n + \"<comma separated schema paths> <store properties path> \"\...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_541
{ "fields": [], "file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/TransformOneToManyIterableTest.java", "identifier": "TransformOneToManyIterableTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldThrowExceptionIfNextCalledWhenNoNextString() {\n // Given\n final String item1 = \"item 1\";\n final String items2A_B = \"item 2a,item 2b\";\n final Iterable<String> items = Arrays.asList(item1, items2A_B);\n final Validator<String> validator ...
{ "fields": [ { "declarator": "input", "modifier": "private final", "original_string": "private final Iterable<? extends I> input;", "type": "Iterable<? extends I>", "var_name": "input" }, { "declarator": "validator", "modifier": "private final", "original_s...
{ "body": "@Override\n public CloseableIterator<O> iterator() {\n return new CloseableIterator<O>() {\n private final Iterator<? extends I> inputItr = input.iterator();\n\n private Iterator<O> nextElements;\n private Boolean hasNext;\n\n @Override\n pub...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_812
{ "fields": [ { "declarator": "input", "modifier": "private", "original_string": "private List<Element> input;", "type": "List<Element>", "var_name": "input" }, { "declarator": "expected", "modifier": "private", "original_string": "private List<Element> expe...
{ "body": "@Test\n public void shouldSelectAdjacentMatchedVertexForTransform() throws OperationException {\n // Given\n given(store.getSchema()).willReturn(schema);\n\n final Edge edge = new Edge.Builder()\n .group(TestGroups.EDGE)\n .source(\"srcVal\")\n ...
{ "fields": [ { "declarator": "validator = new TransformValidator()", "modifier": "private final", "original_string": "private final FunctionValidator<Transform> validator = new TransformValidator();", "type": "FunctionValidator<Transform>", "var_name": "validator" } ], "file...
{ "body": "@Override\n public Iterable<? extends Element> doOperation(final Transform operation, final Context context, final Store store) throws OperationException {\n return doOperation(operation, store.getSchema());\n }", "class_method_signature": "TransformHandler.doOperation(final Transform operat...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1139
{ "fields": [ { "declarator": "operation = new GetAllElements()", "modifier": "private final", "original_string": "private final GetAllElements operation = new GetAllElements();", "type": "GetAllElements", "var_name": "operation" }, { "declarator": "context = new Contex...
{ "body": "@Test\n public void toStringCoverage() {\n // Given / When\n final GraphResult<Operation> actual = new GraphResult<>(operation, context);\n\n // Then\n assertTrue(actual.toString().contains(\"GraphResult[result=uk.gov.gchq.gaffer.operation.impl.get.GetAllElements\"));\n }"...
{ "fields": [ { "declarator": "result", "modifier": "private final", "original_string": "private final O result;", "type": "O", "var_name": "result" }, { "declarator": "context", "modifier": "private final", "original_string": "private final Context context;...
{ "body": "@Override\n public String toString() {\n return new ToStringBuilder(this)\n .append(\"result\", result)\n .append(\"context\", context)\n .toString();\n }", "class_method_signature": "GraphResult.toString()", "constructor": false, "full_signat...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1093
{ "fields": [ { "declarator": "OP_CHAIN_LIMITER_PATH = \"opChainLimiter.json\"", "modifier": "private static final", "original_string": "private static final String OP_CHAIN_LIMITER_PATH = \"opChainLimiter.json\";", "type": "String", "var_name": "OP_CHAIN_LIMITER_PATH" } ], "...
{ "body": "@Test\n public void shouldAcceptOperationChainWhenUserHasAuthScoreGreaterThanChainScore() {\n // Given\n final OperationChainLimiter hook = fromJson(OP_CHAIN_LIMITER_PATH);\n final OperationChain opChain = new OperationChain.Builder()\n .first(new GetElements())\n ...
{ "fields": [ { "declarator": "scorer = new ScoreOperationChainHandler()", "modifier": "private", "original_string": "private ScoreOperationChainHandler scorer = new ScoreOperationChainHandler();", "type": "ScoreOperationChainHandler", "var_name": "scorer" } ], "file": "core/...
{ "body": "@Override\n public void preExecute(final OperationChain<?> opChain, final Context context) {\n if (null != opChain) {\n Integer chainScore = scorer.getChainScore(opChain, context.getUser());\n Integer maxAuthScore = scorer.getMaxUserAuthScore(context.getUser().getOpAuths());...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1247
{ "fields": [], "file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/OperationChainTest.java", "identifier": "OperationChainTest", "interfaces": "", "superclass": "extends OperationsTest<OperationChain>" }
{ "body": "@Test\n @Override\n public void shouldGetOperations() {\n // Given\n final List<Operation> ops = Lists.newArrayList(\n mock(Operation.class),\n mock(GetAllElements.class),\n mock(Aggregate.class),\n mock(Limit.class)\n )...
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private List<Operation> operations;", "type": "List<Operation>", "var_name": "operations" }, { "declarator": "options", "modifier": "private", "original_string": "private ...
{ "body": "@Override\n @JsonIgnore\n public List<Operation> getOperations() {\n return operations;\n }", "class_method_signature": "OperationChain.getOperations()", "constructor": false, "full_signature": "@Override @JsonIgnore public List<Operation> getOperations()", "identifier": "getOperati...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_18
{ "fields": [], "file": "store-implementation/federated-store/src/test/java/uk/gov/gchq/gaffer/federatedstore/util/FederatedStoreUtilTest.java", "identifier": "FederatedStoreUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldUpdateOperationView() {\n // Given\n final Graph graph = createGraph();\n final GetElements operation = new GetElements.Builder()\n .view(new View.Builder()\n .edge(TestGroups.EDGE, new ViewElementDefinition())\n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "public static <OP extends Operation> OP updateOperationForGraph(final OP operation, final Graph graph) {\n OP resultOp = operation;\n if (operation instanceof Operations) {\n resultOp = (OP) operation.shallowClone();\n final Operations<Operation> operations = (Operations...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_795
{ "fields": [ { "declarator": "SCHEMA = new Schema.Builder()\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition())\n .edge(TestGroups.EDGE_2, new SchemaEdgeDefinition())\n .entity(TestGroups.ENTITY, new SchemaEntityDefinition())\n .entity(TestGroups.ENTITY_2, new S...
{ "body": "@Test\n public void shouldFilterEntitiesAndEdges() throws OperationException {\n // Given\n given(store.getSchema()).willReturn(SCHEMA);\n\n final Edge edge = new Edge.Builder()\n .group(TestGroups.EDGE)\n .source(\"junctionA\")\n .dest(\...
{ "fields": [ { "declarator": "validator = new FilterValidator()", "modifier": "private final", "original_string": "private final FunctionValidator<Filter> validator = new FilterValidator();", "type": "FunctionValidator<Filter>", "var_name": "validator" } ], "file": "core/sto...
{ "body": "@Override\n public Iterable<? extends Element> doOperation(final Filter operation, final Context context, final Store store) throws OperationException {\n return doOperation(operation, store.getSchema());\n }", "class_method_signature": "FilterHandler.doOperation(final Filter operation, fina...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_280
{ "fields": [], "file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/elementdefinition/view/ViewTest.java", "identifier": "ViewTest", "interfaces": "", "superclass": "extends JSONSerialisationTest<View>" }
{ "body": "@Test\n public void shouldSetEmptyEntitiesPropertiesGivenEmptyGlobalProperties() {\n // Given\n final View view = new View.Builder()\n .globalEntities(new GlobalViewElementDefinition.Builder()\n .groups(TestGroups.ENTITY)\n .prop...
{ "fields": [ { "declarator": "globalElements", "modifier": "private", "original_string": "private List<GlobalViewElementDefinition> globalElements;", "type": "List<GlobalViewElementDefinition>", "var_name": "globalElements" }, { "declarator": "globalEntities", "m...
{ "body": "public void expandGlobalDefinitions() {\n if (null != globalEntities && !globalEntities.isEmpty()) {\n setEntities(expandGlobalDefinitions(getEntities(), getEntityGroups(), globalEntities, false));\n globalEntities = null;\n }\n\n if (null != globalEdges && !globa...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1302
{ "fields": [], "file": "library/time-library/src/test/java/uk/gov/gchq/gaffer/time/LongTimeSeriesTest.java", "identifier": "LongTimeSeriesTest", "interfaces": "", "superclass": "extends JSONSerialisationTest<LongTimeSeries>" }
{ "body": "@Test\n public void testGetNumberOfInstants() {\n // Given\n final LongTimeSeries timeSeries = new LongTimeSeries(TimeBucket.MINUTE);\n IntStream.range(1, 11)\n .mapToObj(i -> Instant.ofEpochMilli(1000L * 60 * i))\n .forEach(i -> timeSeries.put(i, 1L));...
{ "fields": [ { "declarator": "VALID_TIME_BUCKETS = Sets.newHashSet(\n MILLISECOND,\n SECOND,\n MINUTE,\n HOUR,\n DAY,\n WEEK,\n MONTH,\n YEAR\n )", "modifier": "private static final", "original_string": "...
{ "body": "@JsonIgnore\n public int getNumberOfInstants() {\n return timeSeries.size();\n }", "class_method_signature": "LongTimeSeries.getNumberOfInstants()", "constructor": false, "full_signature": "@JsonIgnore public int getNumberOfInstants()", "identifier": "getNumberOfInstants", "invocatio...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_453
{ "fields": [], "file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/FieldUtilTest.java", "identifier": "FieldUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNullField() {\n final Pair nullPair = new Pair(\"Test\", null);\n\n final ValidationResult validationResult = FieldUtil.validateRequiredFields(nullPair);\n\n final Set<String> expected = new LinkedHashSet<>();\n expected.add(\"Test is required.\");\n ...
{ "fields": [], "file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/FieldUtil.java", "identifier": "FieldUtil", "interfaces": "", "methods": [ { "class_method_signature": "FieldUtil.FieldUtil()", "constructor": true, "full_signature": "private FieldUtil()", "iden...
{ "body": "@SafeVarargs\n public static ValidationResult validateRequiredFields(final Pair<String, Object>... fields) {\n final ValidationResult validationResult = new ValidationResult();\n for (final Pair field : fields) {\n if (null == field.getSecond()) {\n validationResu...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1181
{ "fields": [], "file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/function/ToElementIdTest.java", "identifier": "ToElementIdTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldReturnOriginalValueIfInputIsAnEntitySeed() {\n // Given\n final EntitySeed input = new EntitySeed(\"item\");\n final ToElementId function = new ToElementId();\n\n // When\n final ElementId output = function.apply(input);\n\n // Then\n ...
{ "fields": [], "file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/function/ToElementId.java", "identifier": "ToElementId", "interfaces": "", "methods": [ { "class_method_signature": "ToElementId.apply(final Object obj)", "constructor": false, "full_signature": "@Override...
{ "body": "@Override\n public ElementId apply(final Object obj) {\n if (null == obj) {\n return null;\n }\n return obj instanceof ElementId ? (ElementId) obj : new EntitySeed(obj);\n }", "class_method_signature": "ToElementId.apply(final Object obj)", "constructor": false, ...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_900
{ "fields": [ { "declarator": "PROPERTY_STRING_TYPE = \"property.string\"", "modifier": "public static final", "original_string": "public static final String PROPERTY_STRING_TYPE = \"property.string\";", "type": "String", "var_name": "PROPERTY_STRING_TYPE" } ], "file": "core/...
{ "body": "@Test\n public void shouldReturnFullAggregator() {\n // Given\n final T elementDef = createBuilder()\n .property(\"property1\", PROPERTY_STRING_TYPE)\n .property(\"property2\", PROPERTY_STRING_TYPE)\n .property(\"property3\", PROPERTY_STRING_TYP...
{ "fields": [ { "declarator": "elementDefValidator", "modifier": "private final", "original_string": "private final SchemaElementDefinitionValidator elementDefValidator;", "type": "SchemaElementDefinitionValidator", "var_name": "elementDefValidator" }, { "declarator": "...
{ "body": "@JsonIgnore\n public ElementAggregator getFullAggregator() {\n if (null == fullAggregatorCache) {\n createFullAggregator();\n }\n return fullAggregatorCache;\n }", "class_method_signature": "SchemaElementDefinition.getFullAggregator()", "constructor": false, "ful...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_845
{ "fields": [], "file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/job/GetJobDetailsHandlerTest.java", "identifier": "GetJobDetailsHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldGetJobDetailsByDelegatingToJobTrackerWithContextJobId() throws OperationException {\n // Given\n final GetJobDetailsHandler handler = new GetJobDetailsHandler();\n final GetJobDetails operation = new GetJobDetails();\n final Store store = mock(Store....
{ "fields": [], "file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/job/GetJobDetailsHandler.java", "identifier": "GetJobDetailsHandler", "interfaces": "implements OutputOperationHandler<GetJobDetails, JobDetail>", "methods": [ { "class_method_signature": "GetJobDetailsHandl...
{ "body": "@Override\n public JobDetail doOperation(final GetJobDetails operation, final Context context, final Store store) throws OperationException {\n if (null == store.getJobTracker()) {\n throw new OperationException(\"The Job Tracker has not been configured\", SERVICE_UNAVAILABLE);\n ...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_516
{ "fields": [], "file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/CollectionUtilTest.java", "identifier": "CollectionUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldReturnTrueWhenAnyMissingCalledWhenTheCollectionDoesNotContainAProvidedValue() {\n // Given\n final Collection<Integer> collection = Sets.newHashSet(10, 20, 30);\n final Object[] values = new Object[] {1, 2, 3};\n\n // When\n final boolean resu...
{ "fields": [], "file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/CollectionUtil.java", "identifier": "CollectionUtil", "interfaces": "", "methods": [ { "class_method_signature": "CollectionUtil.CollectionUtil()", "constructor": true, "full_signature": "private Colle...
{ "body": "public static boolean anyMissing(final Collection collection, final Object[] objects) {\n boolean result = false;\n if (null == collection || collection.isEmpty()) {\n if (null != objects && 0 < objects.length) {\n result = true;\n }\n } else if (nu...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_146
{ "fields": [], "file": "store-implementation/accumulo-store/src/test/java/uk/gov/gchq/gaffer/accumulostore/operation/impl/SummariseGroupOverRangesTest.java", "identifier": "SummariseGroupOverRangesTest", "interfaces": "", "superclass": "extends OperationTest<SummariseGroupOverRanges>" }
{ "body": "@Test\n public void shouldJSONSerialiseAndDeserialise() throws SerialisationException {\n // Given\n final List<Pair<ElementId, ElementId>> pairList = new ArrayList<>();\n final Pair<ElementId, ElementId> pair1 = new Pair<>(AccumuloTestData.SEED_SOURCE_1, AccumuloTestData.SEED_DESTI...
{ "fields": [ { "declarator": "input", "modifier": "private", "original_string": "private Iterable<? extends Pair<? extends ElementId, ? extends ElementId>> input;", "type": "Iterable<? extends Pair<? extends ElementId, ? extends ElementId>>", "var_name": "input" }, { "...
{ "body": "@Override\n public Iterable<? extends Pair<? extends ElementId, ? extends ElementId>> getInput() {\n return input;\n }", "class_method_signature": "SummariseGroupOverRanges.getInput()", "constructor": false, "full_signature": "@Override public Iterable<? extends Pair<? extends ElementId,...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_629
{ "fields": [], "file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/util/AggregatorUtilTest.java", "identifier": "AggregatorUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldThrowExceptionWhenQueryAggregatedIfViewIsNull() {\n // given\n final Schema schema = new Schema();\n final View view = null;\n\n // When / Then\n try {\n AggregatorUtil.queryAggregate(Collections.emptyList(), schema, view);\n ...
{ "fields": [], "file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/util/AggregatorUtil.java", "identifier": "AggregatorUtil", "interfaces": "", "methods": [ { "class_method_signature": "AggregatorUtil.AggregatorUtil()", "constructor": true, "full_signature": "private AggregatorU...
{ "body": "public static CloseableIterable<Element> queryAggregate(final Iterable<? extends Element> elements, final Schema schema, final View view) {\n if (null == schema) {\n throw new IllegalArgumentException(\"Schema is required\");\n }\n if (null == view) {\n throw new ...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_279
{ "fields": [], "file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/elementdefinition/view/ViewTest.java", "identifier": "ViewTest", "interfaces": "", "superclass": "extends JSONSerialisationTest<View>" }
{ "body": "@Test\n public void shouldAddGlobalPropertiesToEntityGroup() {\n // Given\n final View view = new View.Builder()\n .globalEntities(new GlobalViewElementDefinition.Builder()\n .groups(TestGroups.ENTITY)\n .properties(TestPropertyN...
{ "fields": [ { "declarator": "globalElements", "modifier": "private", "original_string": "private List<GlobalViewElementDefinition> globalElements;", "type": "List<GlobalViewElementDefinition>", "var_name": "globalElements" }, { "declarator": "globalEntities", "m...
{ "body": "public void expandGlobalDefinitions() {\n if (null != globalEntities && !globalEntities.isEmpty()) {\n setEntities(expandGlobalDefinitions(getEntities(), getEntityGroups(), globalEntities, false));\n globalEntities = null;\n }\n\n if (null != globalEdges && !globa...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_783
{ "fields": [ { "declarator": "store = mock(Store.class)", "modifier": "private final", "original_string": "private final Store store = mock(Store.class);", "type": "Store", "var_name": "store" }, { "declarator": "context = new Context()", "modifier": "private fin...
{ "body": "@Test\n public void shouldAggregateElementsWhenNoGroupByInSchema() throws OperationException {\n // Given\n final Schema schema = new Schema.Builder()\n .entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder()\n .build())\n .build...
{ "fields": [ { "declarator": "validator = new AggregateValidator()", "modifier": "private final", "original_string": "private final FunctionValidator<Aggregate> validator = new AggregateValidator();", "type": "FunctionValidator<Aggregate>", "var_name": "validator" } ], "file...
{ "body": "@Override\n public Iterable<? extends Element> doOperation(final Aggregate operation, final Context context, final Store store) throws OperationException {\n return doOperation(operation, store.getSchema());\n }", "class_method_signature": "AggregateHandler.doOperation(final Aggregate operat...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1251
{ "fields": [], "file": "core/operation/src/test/java/uk/gov/gchq/gaffer/named/operation/NamedOperationDetailTest.java", "identifier": "NamedOperationDetailTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldBeNamedOperationResourceType() {\n assertEquals(ResourceType.NamedOperation, new NamedOperationDetail().getResourceType());\n }", "class_method_signature": "NamedOperationDetailTest.shouldBeNamedOperationResourceType()", "constructor": false, "full_signature": "...
{ "fields": [ { "declarator": "serialVersionUID = -8831783492657131469L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -8831783492657131469L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "CHA...
{ "body": "@Override\n public ResourceType getResourceType() {\n return ResourceType.NamedOperation;\n }", "class_method_signature": "NamedOperationDetail.getResourceType()", "constructor": false, "full_signature": "@Override public ResourceType getResourceType()", "identifier": "getResourceType"...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1314
{ "fields": [ { "declarator": "LONG_TIME_SERIES_AGGREGATOR\n = new LongTimeSeriesAggregator()", "modifier": "private static final", "original_string": "private static final LongTimeSeriesAggregator LONG_TIME_SERIES_AGGREGATOR\n = new LongTimeSeriesAggregator();", "typ...
{ "body": "@Test\n public void testCantMergeIfDifferentTimeBucket() {\n try {\n final LongTimeSeries timeSeries1 = new LongTimeSeries(CommonTimeUtil.TimeBucket.SECOND);\n final LongTimeSeries timeSeries2 = new LongTimeSeries(CommonTimeUtil.TimeBucket.MINUTE);\n LONG_TIME_SER...
{ "fields": [], "file": "library/time-library/src/main/java/uk/gov/gchq/gaffer/time/binaryoperator/LongTimeSeriesAggregator.java", "identifier": "LongTimeSeriesAggregator", "interfaces": "", "methods": [ { "class_method_signature": "LongTimeSeriesAggregator._apply(final LongTimeSeries a, final LongT...
{ "body": "@Override\n protected LongTimeSeries _apply(final LongTimeSeries a, final LongTimeSeries b) {\n if (!b.getTimeBucket().equals(a.getTimeBucket())) {\n throw new RuntimeException(\"Can't aggregate two LongTimeSeries with different time buckets: \"\n + \"a had bucket \"...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_296
{ "fields": [], "file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/elementdefinition/view/ViewTest.java", "identifier": "ViewTest", "interfaces": "", "superclass": "extends JSONSerialisationTest<View>" }
{ "body": "@Test\n public void shouldSetEmptyPropertiesGivenEmptyGlobalElementProperties() {\n // Given\n final View view = new View.Builder()\n .globalElements(new GlobalViewElementDefinition.Builder()\n .groups(TestGroups.ENTITY)\n .prope...
{ "fields": [ { "declarator": "globalElements", "modifier": "private", "original_string": "private List<GlobalViewElementDefinition> globalElements;", "type": "List<GlobalViewElementDefinition>", "var_name": "globalElements" }, { "declarator": "globalEntities", "m...
{ "body": "public void expandGlobalDefinitions() {\n if (null != globalEntities && !globalEntities.isEmpty()) {\n setEntities(expandGlobalDefinitions(getEntities(), getEntityGroups(), globalEntities, false));\n globalEntities = null;\n }\n\n if (null != globalEdges && !globa...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_916
{ "fields": [ { "declarator": "ALL_STORE_TRAITS = Sets.newHashSet(StoreTrait.values())", "modifier": "public static final", "original_string": "public static final Set<StoreTrait> ALL_STORE_TRAITS = Sets.newHashSet(StoreTrait.values());", "type": "Set<StoreTrait>", "var_name": "ALL_S...
{ "body": "@Test\n public void shouldValidateAndReturnTrueWhenEntityFilterSelectionUnknownProperty() {\n // Given\n final ViewValidator validator = new ViewValidator();\n final View view = new View.Builder()\n .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder()\n ...
{ "fields": [ { "declarator": "SKIP_VIEW_VALIDATION = \"skipViewValidation\"", "modifier": "public static final", "original_string": "public static final String SKIP_VIEW_VALIDATION = \"skipViewValidation\";", "type": "String", "var_name": "SKIP_VIEW_VALIDATION" }, { "d...
{ "body": "public ValidationResult validate(final View view, final Schema schema, final Set<StoreTrait> storeTraits) {\n final boolean isStoreOrdered = storeTraits.contains(StoreTrait.ORDERED);\n\n final ValidationResult result = new ValidationResult();\n\n if (null != view) {\n valida...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1197
{ "fields": [ { "declarator": "varName = \"varName\"", "modifier": "private final", "original_string": "private final String varName = \"varName\";", "type": "String", "var_name": "varName" } ], "file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/impl/GetVariab...
{ "body": "@Test\n @Override\n public void builderShouldCreatePopulatedOperation() {\n // Given / When\n final GetVariable getVariableOp = new GetVariable.Builder().variableName(varName).build();\n\n // Then\n assertEquals(varName, getVariableOp.getVariableName());\n }", "class_...
{ "fields": [ { "declarator": "variableName", "modifier": "private", "original_string": "private String variableName;", "type": "String", "var_name": "variableName" }, { "declarator": "options", "modifier": "private", "original_string": "private Map<String, ...
{ "body": "public String getVariableName() {\n return variableName;\n }", "class_method_signature": "GetVariable.getVariableName()", "constructor": false, "full_signature": "public String getVariableName()", "identifier": "getVariableName", "invocations": [], "modifiers": "public", "parameters...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_445
{ "fields": [], "file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/EdgeTest.java", "identifier": "EdgeTest", "interfaces": "", "superclass": "extends ElementTest" }
{ "body": "@Test\n public void shouldDeserialiseFromJsonWhenDirectedTypeIsDirected() throws SerialisationException {\n final String json = \"{\\\"class\\\": \\\"uk.gov.gchq.gaffer.data.element.Edge\\\", \\\"directedType\\\": \\\"DIRECTED\\\"}\";\n\n final Edge deserialisedEdge = JSONSerialiser.deseri...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(Edge.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Edge.class);", "type": "Logger", "var_name": "LOGGER" }, { "declarator": "s...
{ "body": "@JsonIgnore(false)\n @JsonGetter(\"directed\")\n @Override\n public boolean isDirected() {\n return directed;\n }", "class_method_signature": "Edge.isDirected()", "constructor": false, "full_signature": "@JsonIgnore(false) @JsonGetter(\"directed\") @Override public boolean isDirect...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_150
{ "fields": [ { "declarator": "factory", "modifier": "private final", "original_string": "private final AbstractCoreKeyIteratorSettingsFactory factory;", "type": "AbstractCoreKeyIteratorSettingsFactory", "var_name": "factory" } ], "file": "store-implementation/accumulo-store/...
{ "body": "@Test\n public void shouldReturnNullValidatorIteratorIfNoSchemaValidation() throws Exception {\n // Given\n final AccumuloStore store = mock(AccumuloStore.class);\n final Schema schema = createSchema();\n given(store.getSchema()).willReturn(schema);\n\n // When\n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(AbstractCoreKeyIteratorSettingsFactory.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AbstractCoreKeyIteratorSettingsFactory.class);", "type": "Log...
{ "body": "@Override\n public IteratorSetting getValidatorIteratorSetting(final AccumuloStore store) {\n if (!store.getSchema().hasValidation()) {\n LOGGER.debug(\"Returning null from getValidatorIteratorSetting as store.getSchema().hasValidation() = {}\",\n store.getSchema().h...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_500
{ "fields": [], "file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/TextUtilTest.java", "identifier": "TextUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetByteBuffer() {\n final Text text = new Text(\"Some text\");\n\n assertEquals(ByteBuffer.wrap(text.getBytes()), TextUtil.getByteBuffer(text));\n }", "class_method_signature": "TextUtilTest.testGetByteBuffer()", "constructor": false, "full_signature": "@Te...
{ "fields": [], "file": "core/common-util/src/main/java/uk/gov/gchq/gaffer/commonutil/TextUtil.java", "identifier": "TextUtil", "interfaces": "", "methods": [ { "class_method_signature": "TextUtil.TextUtil()", "constructor": true, "full_signature": "private TextUtil()", "identifie...
{ "body": "public static ByteBuffer getByteBuffer(final Text text) {\n if (text == null) {\n return null;\n }\n byte[] bytes = text.getBytes();\n return ByteBuffer.wrap(bytes, 0, text.getLength());\n }", "class_method_signature": "TextUtil.getByteBuffer(final Text text)", ...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_853
{ "fields": [ { "declarator": "varName = \"varName\"", "modifier": "private final", "original_string": "private final String varName = \"varName\";", "type": "String", "var_name": "varName" }, { "declarator": "varVal = \"varVal\"", "modifier": "private final", ...
{ "body": "@Test\n public void shouldNotThrowNPEWhenVariablesSet() throws OperationException {\n // Given\n final Context context = new Context(new User());\n final GetVariableHandler handler = new GetVariableHandler();\n final GetVariable op = new GetVariable.Builder().variableName(var...
{ "fields": [], "file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/GetVariableHandler.java", "identifier": "GetVariableHandler", "interfaces": "implements OperationHandler<GetVariable>", "methods": [ { "class_method_signature": "GetVariableHandler.doOperation(final GetVaria...
{ "body": "@Override\n public Object doOperation(final GetVariable operation, final Context context, final Store store) throws OperationException {\n if (operation.getVariableName() == null) {\n throw new IllegalArgumentException(\"Variable name cannot be null\");\n }\n return conte...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1178
{ "fields": [], "file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/function/ToEntityIdTest.java", "identifier": "ToEntityIdTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldReturnOriginalValueIfInputIsAnEntity() {\n // Given\n final Entity input = new Entity(\"group\", \"item\");\n final ToEntityId function = new ToEntityId();\n\n // When\n final EntityId output = function.apply(input);\n\n // Then\n ...
{ "fields": [], "file": "core/operation/src/main/java/uk/gov/gchq/gaffer/operation/function/ToEntityId.java", "identifier": "ToEntityId", "interfaces": "", "methods": [ { "class_method_signature": "ToEntityId.apply(final Object obj)", "constructor": false, "full_signature": "@Override pu...
{ "body": "@Override\n public EntityId apply(final Object obj) {\n if (null == obj) {\n return null;\n }\n return obj instanceof EntityId ? (EntityId) obj : new EntitySeed(obj);\n }", "class_method_signature": "ToEntityId.apply(final Object obj)", "constructor": false, "ful...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1206
{ "fields": [ { "declarator": "TEST_INPUT = asList(\"one\", \"two\", \"three\")", "modifier": "private static final", "original_string": "private static final List<String> TEST_INPUT = asList(\"one\", \"two\", \"three\");", "type": "List<String>", "var_name": "TEST_INPUT" }, ...
{ "body": "@Test\n public void shouldFailValidationIfNumSplitsIsLessThan1() {\n // Given\n final GenerateSplitPointsFromSample op = new GenerateSplitPointsFromSample.Builder<>()\n .numSplits(0)\n .build();\n\n // When\n final ValidationResult result = op.va...
{ "fields": [ { "declarator": "input", "modifier": "private", "original_string": "private Iterable<? extends T> input;", "type": "Iterable<? extends T>", "var_name": "input" }, { "declarator": "numSplits", "modifier": "private", "original_string": "private I...
{ "body": "@Override\n public ValidationResult validate() {\n final ValidationResult result = InputOutput.super.validate();\n if (null != numSplits && numSplits < 1) {\n result.addError(\"numSplits must be null or greater than 0\");\n }\n return result;\n }", "class_meth...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_59
{ "fields": [], "file": "store-implementation/federated-store/src/test/java/uk/gov/gchq/gaffer/federatedstore/operation/FederatedOperationChainValidatorTest.java", "identifier": "FederatedOperationChainValidatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldGetFederatedSchema() {\n // Given\n final ViewValidator viewValidator = mock(FederatedViewValidator.class);\n final FederatedOperationChainValidator validator = new FederatedOperationChainValidator(viewValidator);\n final FederatedStore store = mock(...
{ "fields": [], "file": "store-implementation/federated-store/src/main/java/uk/gov/gchq/gaffer/federatedstore/operation/FederatedOperationChainValidator.java", "identifier": "FederatedOperationChainValidator", "interfaces": "", "methods": [ { "class_method_signature": "FederatedOperationChainValidat...
{ "body": "@Override\n protected Schema getSchema(final Operation operation, final User user, final Store store) {\n return ((FederatedStore) store).getSchema(operation, user);\n }", "class_method_signature": "FederatedOperationChainValidator.getSchema(final Operation operation, final User user, final ...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_384
{ "fields": [], "file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/EntityTest.java", "identifier": "EntityTest", "interfaces": "", "superclass": "extends ElementTest" }
{ "body": "@Test\n public void shouldBuildEntity() {\n final String vertex = \"vertex1\";\n final String propValue = \"propValue\";\n\n final Entity entity = new Entity.Builder()\n .group(TestGroups.ENTITY)\n .vertex(vertex)\n .property(TestProperty...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(Entity.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Entity.class);", "type": "Logger", "var_name": "LOGGER" }, { "declarator"...
{ "body": "@Override\n public Object getVertex() {\n return vertex;\n }", "class_method_signature": "Entity.getVertex()", "constructor": false, "full_signature": "@Override public Object getVertex()", "identifier": "getVertex", "invocations": [], "modifiers": "@Override public", "parameters...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_691
{ "fields": [], "file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/compare/SortHandlerTest.java", "identifier": "SortHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldReturnNullIfOperationInputIsNull() throws OperationException {\n // Given\n final Sort sort = new Sort.Builder().build();\n\n final SortHandler handler = new SortHandler();\n\n // When\n final Iterab...
{ "fields": [ { "declarator": "MAX_HANDLER = new MaxHandler()", "modifier": "private static final", "original_string": "private static final MaxHandler MAX_HANDLER = new MaxHandler();", "type": "MaxHandler", "var_name": "MAX_HANDLER" } ], "file": "core/store/src/main/java/uk/...
{ "body": "@Override\n public Iterable<? extends Element> doOperation(final Sort operation, final Context context, final Store store) throws OperationException {\n // If there is no input or there are no comparators, we return null\n if (null == operation.getInput()\n || null == operat...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1343
{ "fields": [], "file": "library/spark/spark-accumulo-library/src/test/java/uk/gov/gchq/gaffer/sparkaccumulo/operation/handler/dataframe/AccumuloStoreRelationTest.java", "identifier": "AccumuloStoreRelationTest", "interfaces": "", "superclass": "extends AbstractPropertiesDrivenTest" }
{ "body": "@Test\n public void shouldReturnEmptyDataFrameWithNoResultsFromFilter() throws StoreException, OperationException {\n // Given\n final SparkSession sparkSession = SparkSessionProvider.getSparkSession();\n final Schema schema = getSchema();\n final View view = getViewFromSchem...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(AccumuloStoreRelation.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AccumuloStoreRelation.class);", "type": "Logger", "var_name": "LOGGER" ...
{ "body": "@Override\n public RDD<Row> buildScan() {\n try {\n LOGGER.info(\"Building GetRDDOfAllElements with view set to groups {}\", StringUtils.join(groups, ','));\n final GetRDDOfAllElements operation = new GetRDDOfAllElements();\n operation.setView(view);\n ...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_412
{ "fields": [], "file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/element/function/ExtractPropertyTest.java", "identifier": "ExtractPropertyTest", "interfaces": "", "superclass": "extends FunctionTest" }
{ "body": "@Test\n public void shouldReturnNullForNullElement() {\n final ExtractProperty extractor = new ExtractProperty();\n\n final Object result = extractor.apply(null);\n\n assertNull(result);\n }", "class_method_signature": "ExtractPropertyTest.shouldReturnNullForNullElement()", "...
{ "fields": [ { "declarator": "name", "modifier": "private", "original_string": "private String name;", "type": "String", "var_name": "name" } ], "file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/element/function/ExtractProperty.java", "identifier": "ExtractProperty"...
{ "body": "@Override\n public Object apply(final Element element) {\n return null != element ? element.getProperty(name) : null;\n }", "class_method_signature": "ExtractProperty.apply(final Element element)", "constructor": false, "full_signature": "@Override public Object apply(final Element eleme...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_941
{ "fields": [ { "declarator": "ALL_STORE_TRAITS = Sets.newHashSet(StoreTrait.values())", "modifier": "public static final", "original_string": "public static final Set<StoreTrait> ALL_STORE_TRAITS = Sets.newHashSet(StoreTrait.values());", "type": "Set<StoreTrait>", "var_name": "ALL_S...
{ "body": "@Test\n public void shouldValidateAndReturnFalseWhenMissingTraits() {\n // Given\n final ViewValidator validator = new ViewValidator();\n final View view = new View.Builder()\n .entity(TestGroups.ENTITY, new ViewElementDefinition.Builder()\n .tr...
{ "fields": [ { "declarator": "SKIP_VIEW_VALIDATION = \"skipViewValidation\"", "modifier": "public static final", "original_string": "public static final String SKIP_VIEW_VALIDATION = \"skipViewValidation\";", "type": "String", "var_name": "SKIP_VIEW_VALIDATION" }, { "d...
{ "body": "public ValidationResult validate(final View view, final Schema schema, final Set<StoreTrait> storeTraits) {\n final boolean isStoreOrdered = storeTraits.contains(StoreTrait.ORDERED);\n\n final ValidationResult result = new ValidationResult();\n\n if (null != view) {\n valida...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1085
{ "fields": [ { "declarator": "TEST_WITH_VALUE = \"withTestValue\"", "modifier": "public static final", "original_string": "public static final String TEST_WITH_VALUE = \"withTestValue\";", "type": "String", "var_name": "TEST_WITH_VALUE" }, { "declarator": "TEST_WITHOUT...
{ "body": "@Test\n public void shouldDoNothingWithNullMerge() throws Exception {\n GetAllElements operationView = new GetAllElements();\n operationView.setView(new View());\n View view = updateViewHook.mergeView(operationView, null).build();\n assertTrue(view.getGroups().isEmpty());\n ...
{ "fields": [ { "declarator": "ADD_EXTRA_GROUPS_DEFAULT = false", "modifier": "public static final", "original_string": "public static final boolean ADD_EXTRA_GROUPS_DEFAULT = false;", "type": "boolean", "var_name": "ADD_EXTRA_GROUPS_DEFAULT" }, { "declarator": "withOpA...
{ "body": "protected final View.Builder mergeView(final OperationView operationView, final View viewToMerge) {\n final View.Builder viewBuilder = new View.Builder();\n\n if (!(operationView.getView() instanceof NamedView)) {\n viewBuilder.merge(operationView.getView());\n }\n\n ...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_804
{ "fields": [ { "declarator": "input", "modifier": "private", "original_string": "private List<Element> input;", "type": "List<Element>", "var_name": "input" }, { "declarator": "expected", "modifier": "private", "original_string": "private List<Element> expe...
{ "body": "@Test\n public void shouldTransformElementsUsingMockFunction() throws OperationException {\n // Given\n final Function<String, Integer> function = mock(Function.class);\n given(function.apply(TestPropertyNames.STRING)).willReturn(6);\n given(store.getSchema()).willReturn(sche...
{ "fields": [ { "declarator": "validator = new TransformValidator()", "modifier": "private final", "original_string": "private final FunctionValidator<Transform> validator = new TransformValidator();", "type": "FunctionValidator<Transform>", "var_name": "validator" } ], "file...
{ "body": "@Override\n public Iterable<? extends Element> doOperation(final Transform operation, final Context context, final Store store) throws OperationException {\n return doOperation(operation, store.getSchema());\n }", "class_method_signature": "TransformHandler.doOperation(final Transform operat...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_557
{ "fields": [], "file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/TransformIterableTest.java", "identifier": "TransformIterableTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldThrowExceptionIfRemoveCalled() {\n final String item1 = \"item 1\";\n final String item2 = \"item 2\";\n final Iterable<String> items = Arrays.asList(item1, item2);\n final Validator<String> validator = mock(Validator.class);\n final Transform...
{ "fields": [ { "declarator": "input", "modifier": "private final", "original_string": "private final Iterable<? extends I> input;", "type": "Iterable<? extends I>", "var_name": "input" }, { "declarator": "validator", "modifier": "private final", "original_s...
{ "body": "@Override\n public CloseableIterator<O> iterator() {\n return new CloseableIterator<O>() {\n @Override\n public void close() {\n CloseableUtil.close(inputItr);\n }\n\n private final Iterator<? extends I> inputItr = input.iterator();\n\n ...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_107
{ "fields": [], "file": "store-implementation/accumulo-store/src/test/java/uk/gov/gchq/gaffer/accumulostore/AccumuloPropertiesTest.java", "identifier": "AccumuloPropertiesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldMergeAccumuloJsonModulesAndDeduplicate() {\n // Given\n final AccumuloProperties props = new AccumuloProperties();\n props.setJsonSerialiserModules(TestCustomJsonModules1.class.getName() + \",\" + SketchesJsonModules.class.getName());\n\n // When\n ...
{ "fields": [ { "declarator": "KEY_PACKAGE_CLASS = \"gaffer.store.accumulo.keypackage.class\"", "modifier": "public static final", "original_string": "public static final String KEY_PACKAGE_CLASS = \"gaffer.store.accumulo.keypackage.class\";", "type": "String", "var_name": "KEY_PACKA...
{ "body": "@Override\n public String getJsonSerialiserModules() {\n return new StringDeduplicateConcat().apply(\n SketchesJsonModules.class.getName(),\n super.getJsonSerialiserModules()\n );\n }", "class_method_signature": "AccumuloProperties.getJsonSerialiserModule...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_310
{ "fields": [], "file": "core/data/src/test/java/uk/gov/gchq/gaffer/data/elementdefinition/view/ViewUtilTest.java", "identifier": "ViewUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldNotRemoveAllPropertiesWhenNoRelevantProperties() {\n //Given\n final View view = new View.Builder()\n .edge(TestGroups.EDGE, new ViewElementDefinition.Builder()\n .properties(TestPropertyNames.COUNT)\n ....
{ "fields": [], "file": "core/data/src/main/java/uk/gov/gchq/gaffer/data/elementdefinition/view/ViewUtil.java", "identifier": "ViewUtil", "interfaces": "", "methods": [ { "class_method_signature": "ViewUtil.ViewUtil()", "constructor": true, "full_signature": "private ViewUtil()", ...
{ "body": "public static void removeProperties(final View view, final Element element) {\n if (null != view && null != element) {\n removeProperties(view.getElement(element.getGroup()), element);\n }\n }", "class_method_signature": "ViewUtil.removeProperties(final View view, final Elemen...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_740
{ "fields": [], "file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/ReduceHandlerTest.java", "identifier": "ReduceHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldAggregateResultsWithNullIdentity() throws Exception {\n // Given\n final List<Integer> input = Arrays.asList(1, 2, 3, 4, 5);\n final Integer expectedResult = 5;\n final Reduce<Integer> reduce = new Reduce.Builder<Integer>()\n .input(in...
{ "fields": [], "file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/ReduceHandler.java", "identifier": "ReduceHandler", "interfaces": "implements OutputOperationHandler<Reduce<T>, T>", "methods": [ { "class_method_signature": "ReduceHandler.doOperation(final Reduce<T> operat...
{ "body": "@Override\n public T doOperation(final Reduce<T> operation, final Context context, final Store store) throws OperationException {\n if (null == operation) {\n throw new OperationException(\"Operation cannot be null\");\n }\n\n Iterable<? extends T> input = operation.getIn...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1338
{ "fields": [], "file": "library/spark/spark-accumulo-library/src/test/java/uk/gov/gchq/gaffer/sparkaccumulo/operation/scalardd/GetRDDOfElementsInRangesTest.java", "identifier": "GetRDDOfElementsInRangesTest", "interfaces": "", "superclass": "extends OperationTest<GetRDDOfElementsInRanges>" }
{ "body": "@Test\n public void shouldJSONSerialiseAndDeserialise() throws SerialisationException {\n // Given\n final List<Pair<ElementId, ElementId>> pairList = new ArrayList<>();\n final Pair<ElementId, ElementId> pair1 = new Pair<>(AccumuloTestData.SEED_SOURCE_1, AccumuloTestData.SEED_DESTI...
{ "fields": [ { "declarator": "input", "modifier": "private", "original_string": "private Iterable<? extends Pair<? extends ElementId, ? extends ElementId>> input;", "type": "Iterable<? extends Pair<? extends ElementId, ? extends ElementId>>", "var_name": "input" }, { "...
{ "body": "@Override\n public Iterable<? extends Pair<? extends ElementId, ? extends ElementId>> getInput() {\n return input;\n }", "class_method_signature": "GetRDDOfElementsInRanges.getInput()", "constructor": false, "full_signature": "@Override public Iterable<? extends Pair<? extends ElementId,...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1292
{ "fields": [ { "declarator": "mockGenerator", "modifier": "private static", "original_string": "private static ElementGenerator<String> mockGenerator;", "type": "ElementGenerator<String>", "var_name": "mockGenerator" }, { "declarator": "mockOneToOneGenerator", "m...
{ "body": "@Test\n public void shouldDelegateToGafferOneToManyElementGenerator() throws Exception {\n // Given\n final String csv = \"1,2,3,4\";\n final GafferMapFunction function = new GafferMapFunction<>(String.class, MockedOneToManyGenerator.class);\n final Iterable expectedResults =...
{ "fields": [ { "declarator": "serialVersionUID = -2338397824952911347L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -2338397824952911347L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "gen...
{ "body": "@Override\n public void flatMap(final T item, final Collector<Element> out) throws Exception {\n if (null == out) {\n throw new IllegalArgumentException(\"Element collector is required\");\n }\n\n if (null == elementGenerator) {\n elementGenerator = generatorCl...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_22
{ "fields": [], "file": "store-implementation/federated-store/src/test/java/uk/gov/gchq/gaffer/federatedstore/util/FederatedStoreUtilTest.java", "identifier": "FederatedStoreUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldNotUpdateAddElementsFlagsWhenNotRequired() {\n // Given\n final Graph graph = createGraph();\n final AddElements operation = new AddElements.Builder()\n .validate(true)\n .skipInvalidElements(true)\n .build();\n\...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "public static <OP extends Operation> OP updateOperationForGraph(final OP operation, final Graph graph) {\n OP resultOp = operation;\n if (operation instanceof Operations) {\n resultOp = (OP) operation.shallowClone();\n final Operations<Operation> operations = (Operations...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_255
{ "fields": [ { "declarator": "DETAILED_MSG = \"detailedMessage\"", "modifier": "private static final", "original_string": "private static final String DETAILED_MSG = \"detailedMessage\";", "type": "String", "var_name": "DETAILED_MSG" }, { "declarator": "SIMPLE_MSG = \"...
{ "body": "@Test\n public void shouldNotBuildDetailedMessage() {\n setDebugMode(\"false\");\n\n final Error error = new ErrorBuilder()\n .simpleMessage(SIMPLE_MSG)\n .detailMessage(DETAILED_MSG)\n .build();\n\n assertNotEquals(DETAILED_MSG, error.ge...
{ "fields": [ { "declarator": "statusCode", "modifier": "private final", "original_string": "private final int statusCode;", "type": "int", "var_name": "statusCode" }, { "declarator": "status", "modifier": "private final", "original_string": "private final S...
{ "body": "public String getDetailMessage() {\n return detailMessage;\n }", "class_method_signature": "Error.getDetailMessage()", "constructor": false, "full_signature": "public String getDetailMessage()", "identifier": "getDetailMessage", "invocations": [], "modifiers": "public", "parameters"...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_605
{ "fields": [ { "declarator": "schema", "modifier": "private static", "original_string": "private static Schema schema;", "type": "Schema", "var_name": "schema" }, { "declarator": "serialiser", "modifier": "private static", "original_string": "private static...
{ "body": "@Test\n public void testCanSerialiseElementClass() throws SerialisationException {\n assertTrue(serialiser.canHandle(Entity.class));\n }", "class_method_signature": "EntitySerialiserTest.testCanSerialiseElementClass()", "constructor": false, "full_signature": "@Test public void testCanSe...
{ "fields": [ { "declarator": "serialVersionUID = -2582396256747930962L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -2582396256747930962L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "str...
{ "body": "@Override\n public boolean canHandle(final Class clazz) {\n return Entity.class.isAssignableFrom(clazz);\n }", "class_method_signature": "EntitySerialiser.canHandle(final Class clazz)", "constructor": false, "full_signature": "@Override public boolean canHandle(final Class clazz)", "id...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1154
{ "fields": [], "file": "core/operation/src/test/java/uk/gov/gchq/gaffer/operation/data/EdgeSeedTest.java", "identifier": "EdgeSeedTest", "interfaces": "", "superclass": "extends JSONSerialisationTest<EdgeSeed>" }
{ "body": "@Test\n public void shouldDeserialiseFromJsonUsingDirectedFalseField() {\n // Given\n final String json = \"{\\\"class\\\": \\\"uk.gov.gchq.gaffer.operation.data.EdgeSeed\\\", \\\"directed\\\": false}\";\n\n // When\n final EdgeSeed deserialisedEdgeSeed = fromJson(json.getByt...
{ "fields": [ { "declarator": "serialVersionUID = -8137886975649690000L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -8137886975649690000L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "VER...
{ "body": "@Override\n public DirectedType getDirectedType() {\n return directed;\n }", "class_method_signature": "EdgeSeed.getDirectedType()", "constructor": false, "full_signature": "@Override public DirectedType getDirectedType()", "identifier": "getDirectedType", "invocations": [], "modif...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_486
{ "fields": [], "file": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/OneOrMoreTest.java", "identifier": "OneOrMoreTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldNotBeEqual() {\n final OneOrMore<Integer> collection1 = new OneOrMore<>(false, 1);\n final OneOrMore<Integer> collection2 = new OneOrMore<>(false, 2);\n\n assertNotEquals(collection1, collection2);\n assertNotEquals(collection1.hashCode(), collection...
{ "fields": [ { "declarator": "newCollection", "modifier": "private final", "original_string": "private final Function<T, Collection<T>> newCollection;", "type": "Function<T, Collection<T>>", "var_name": "newCollection" }, { "declarator": "deduplicate", "modifier"...
{ "body": "@Override\n public int hashCode() {\n return new HashCodeBuilder(13, 31)\n .append(deduplicate)\n .append(singleItem)\n .append(collection)\n .toHashCode();\n }", "class_method_signature": "OneOrMore.hashCode()", "constructor": fa...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_8
{ "fields": [], "file": "store-implementation/federated-store/src/test/java/uk/gov/gchq/gaffer/federatedstore/util/FederatedStoreUtilTest.java", "identifier": "FederatedStoreUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldGetGraphIds() {\n // Given\n final Map<String, String> config = new HashMap<>();\n config.put(FederatedStoreConstants.KEY_OPERATION_OPTIONS_GRAPH_IDS, \"graph1,graph2,graph3\");\n\n // When\n final List<String> graphIds = FederatedStoreUtil.ge...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(FederatedStoreUtil.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "public static List<String> getGraphIds(final Map<String, String> config) {\n if (null == config) {\n return null;\n }\n\n return getCleanStrings(config.get(KEY_OPERATION_OPTIONS_GRAPH_IDS));\n }", "class_method_signature": "FederatedStoreUtil.getGraphIds(final Map<Strin...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_469
{ "fields": [ { "declarator": "abs", "modifier": "", "original_string": "ArrayByteSequence abs;", "type": "ArrayByteSequence", "var_name": "abs" }, { "declarator": "data", "modifier": "", "original_string": "byte[] data;", "type": "byte[]", "var_...
{ "body": "@Test\n public void testSubSequence() {\n assertEquals(0, abs.subSequence(0, 0).length());\n assertEquals(\"mile\", abs.subSequence(1, 5).toString());\n }", "class_method_signature": "ArrayByteSequenceTest.testSubSequence()", "constructor": false, "full_signature": "@Test public v...
{ "fields": [ { "declarator": "serialVersionUID = 4850846929226802566L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 4850846929226802566L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "data"...
{ "body": "public ArrayByteSequence subSequence(final int start, final int end) {\n\n if (start > end || start < 0 || end > length) {\n throw new IllegalArgumentException(\"Bad start and/end start = \" + start + \" end=\" + end + \" offset=\" + offset + \" length=\" + length);\n }\n\n ...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_193
{ "fields": [ { "declarator": "SCHEMA = new Schema.Builder()\n .type(\"string\", String.class)\n .type(\"type\", Boolean.class)\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n .source(\"string\")\n .destination(\"string\")\...
{ "body": "@Test\n public void shouldNotFilterOutEdgeInView() throws OperationException, SerialisationException {\n // Given\n final GroupFilterProcessor processor = new GroupFilterProcessor(VIEW);\n\n // When\n final boolean result = processor.test(CellUtil.getLazyCell(\n ...
{ "fields": [ { "declarator": "view", "modifier": "private final", "original_string": "private final View view;", "type": "View", "var_name": "view" } ], "file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasestore/coprocessor/processor/GroupFilterPro...
{ "body": "@Override\n public boolean test(final LazyElementCell elementCell) {\n final String group = elementCell.getGroup();\n return view.isEntity(group) || view.isEdge(group);\n }", "class_method_signature": "GroupFilterProcessor.test(final LazyElementCell elementCell)", "constructor": fal...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_890
{ "fields": [], "file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/ElementValidatorTest.java", "identifier": "ElementValidatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldReturnFalseWhenViewValidateWithInvalidElement() {\n // Given\n final View view = mock(View.class);\n final String group = TestGroups.EDGE;\n final Element elm = mock(Element.class);\n final ViewElementDefinition elementDef = mock(ViewElementDe...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(ElementValidator.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ElementValidator.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@Override\n public boolean validate(final Element element) {\n if (null == element) {\n return false;\n }\n\n if (null != schema) {\n return validateWithSchema(element);\n }\n\n if (null != view) {\n return validateAgainstViewFilter(ele...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_1011
{ "fields": [], "file": "core/serialisation/src/test/java/uk/gov/gchq/gaffer/serialisation/implementation/ordered/OrderedIntegerSerialiserTest.java", "identifier": "OrderedIntegerSerialiserTest", "interfaces": "", "superclass": "extends ToBytesSerialisationTest<Integer>" }
{ "body": "@Test\n public void canSerialiseIntegerClass() {\n assertTrue(serialiser.canHandle(Integer.class));\n }", "class_method_signature": "OrderedIntegerSerialiserTest.canSerialiseIntegerClass()", "constructor": false, "full_signature": "@Test public void canSerialiseIntegerClass()", "identi...
{ "fields": [ { "declarator": "serialVersionUID = 5671653945533196758L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 5671653945533196758L;", "type": "long", "var_name": "serialVersionUID" } ], "file": "core/serialisatio...
{ "body": "@Override\n public boolean canHandle(final Class clazz) {\n return Integer.class.equals(clazz);\n }", "class_method_signature": "OrderedIntegerSerialiser.canHandle(final Class clazz)", "constructor": false, "full_signature": "@Override public boolean canHandle(final Class clazz)", "ide...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_717
{ "fields": [], "file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/LimitHandlerTest.java", "identifier": "LimitHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldHandleNullInput() throws Exception {\n // Given\n final CloseableIterable<Integer> input = null;\n final Limit<Integer> limit = new Limit.Builder<Integer>()\n .input(input)\n .build();\n\n final LimitHandler<Integer> han...
{ "fields": [], "file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/LimitHandler.java", "identifier": "LimitHandler", "interfaces": "implements OutputOperationHandler<Limit<T>, Iterable<? extends T>>", "methods": [ { "class_method_signature": "LimitHandler.doOperation(final ...
{ "body": "@Override\n public Iterable<? extends T> doOperation(final Limit<T> operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput()) {\n return null;\n }\n\n if (null != operation.getResultLimit()) {\n return ...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_347
{ "fields": [ { "declarator": "EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").directed(true).build()", "modifier": "private static final", "original_string": "private static final Edge EDGE_AB = new Edge.Builder().group(TestGroups.EDGE).source(\"A\").dest(\"B\").di...
{ "body": "@Test\n public void shouldGetDestinationVertexFromWalk() {\n // Given\n // [A] -> [E] -> [D]\n // \\ \\ \\\n // (BasicEntity) (BasicEntity) (BasicEntity)\n\n final Walk walk = new Walk.Builder()\n .entity(ENTITY_A...
{ "fields": [ { "declarator": "edges", "modifier": "private final", "original_string": "private final List<Set<Edge>> edges;", "type": "List<Set<Edge>>", "var_name": "edges" }, { "declarator": "entities", "modifier": "private final", "original_string": "priv...
{ "body": "@JsonIgnore\n public Object getDestinationVertex() {\n return entities.get(entities.size() - 1).getKey();\n }", "class_method_signature": "Walk.getDestinationVertex()", "constructor": false, "full_signature": "@JsonIgnore public Object getDestinationVertex()", "identifier": "getDestina...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_652
{ "fields": [], "file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/resolver/DefaultScoreResolverTest.java", "identifier": "DefaultScoreResolverTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldGetScoreForOperationChainWithNestedOperationChain() throws OperationException {\n // Given\n final DefaultScoreResolver scoreResolver = new DefaultScoreResolver();\n\n final OperationChain opChain = new OperationChain.Builder()\n .first(new O...
{ "fields": [ { "declarator": "DEFAULT_OPERATION_SCORE = 1", "modifier": "public static final", "original_string": "public static final int DEFAULT_OPERATION_SCORE = 1;", "type": "int", "var_name": "DEFAULT_OPERATION_SCORE" }, { "declarator": "scoreResolvers", "mo...
{ "body": "@Override\n public Integer getScore(final Operation operation) {\n if (null == operation) {\n return 0;\n }\n\n // Named operations should use their custom resolver despite implementing Operations\n if (operation instanceof Operations && !(operation instanceof Name...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_202
{ "fields": [ { "declarator": "SCHEMA = new Schema.Builder()\n .type(\"string\", String.class)\n .type(\"type\", Boolean.class)\n .edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder()\n .source(\"string\")\n .destination(\"string\")\...
{ "body": "@Test\n public void shouldFilterOutInvalidEdge() throws OperationException, SerialisationException {\n // Given\n final ValidationProcessor processor = new ValidationProcessor(SCHEMA);\n\n // When / Then\n assertFalse(processor.test(CellUtil.getLazyCell(\n new ...
{ "fields": [ { "declarator": "validator", "modifier": "private final", "original_string": "private final ElementValidator validator;", "type": "ElementValidator", "var_name": "validator" } ], "file": "store-implementation/hbase-store/src/main/java/uk/gov/gchq/gaffer/hbasesto...
{ "body": "@Override\n public boolean test(final LazyElementCell elementCell) {\n return validator.validateWithSchema(elementCell.getElement());\n }", "class_method_signature": "ValidationProcessor.test(final LazyElementCell elementCell)", "constructor": false, "full_signature": "@Override public b...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_75
{ "fields": [ { "declarator": "utils", "modifier": "private", "original_string": "private SchemaUtils utils;", "type": "SchemaUtils", "var_name": "utils" } ], "file": "store-implementation/parquet-store/src/test/java/uk/gov/gchq/gaffer/parquetstore/utils/SchemaUtilsTest.java"...
{ "body": "@Test\n public void getColumnToSerialiserTest() {\n final Map<String, String> columnToSerialiser = utils.getColumnToSerialiser(TestGroups.EDGE);\n assertEquals(\"uk.gov.gchq.gaffer.parquetstore.serialisation.impl.StringParquetSerialiser\",\n columnToSerialiser.get(ParquetSto...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(SchemaUtils.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SchemaUtils.class);", "type": "Logger", "var_name": "LOGGER" }, { "d...
{ "body": "public Map<String, String> getColumnToSerialiser(final String group) {\n return groupColumnToSerialiserName.get(group);\n }", "class_method_signature": "SchemaUtils.getColumnToSerialiser(final String group)", "constructor": false, "full_signature": "public Map<String, String> getColumnToSer...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...
47973088_828
{ "fields": [], "file": "core/store/src/test/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToArrayHandlerTest.java", "identifier": "ToArrayHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldConvertEmptyIterableOfObjectsToNullArray() throws OperationException {\n // Given\n final Object[] originalArray = new Object[0];\n\n final Iterable<Object> originalResults = new WrappedCloseableIterable<>(Arrays.asList(originalArray));\n final ToArr...
{ "fields": [], "file": "core/store/src/main/java/uk/gov/gchq/gaffer/store/operation/handler/output/ToArrayHandler.java", "identifier": "ToArrayHandler", "interfaces": "implements OutputOperationHandler<ToArray<T>, T[]>", "methods": [ { "class_method_signature": "ToArrayHandler.doOperation(final ToA...
{ "body": "@SuppressFBWarnings(value = \"PZLA_PREFER_ZERO_LENGTH_ARRAYS\")\n @Override\n public T[] doOperation(final ToArray<T> operation, final Context context, final Store store) throws OperationException {\n if (null == operation.getInput() || Iterables.isEmpty(operation.getInput())) {\n r...
{ "created": "12/14/2015 12:12:39 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 47973088, "size": null, "stargazer_count": null, "stars": 1568, "updates": "2020-01-27T21:51:26+00:00", "url": "https://github.com/gchq/Gaffer" ...