id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
20171642_70
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "decl...
{ "body": "@Test\n public void testSuccess() throws Exception {\n when(delegate.request(any(URI.class), anyString(), any(byte[].class),\n Matchers.<Map<String, List<String>>>any()))\n .thenReturn(Futures.<Response>immediateFuture(null));\n\n when(clock.now()).thenReturn(new Instant(0));\n\n di...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(RetryingRequestDispatcher.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(RetryingRequestDispatcher.class);", "type": "Logger", "var_name": "log" ...
{ "body": "@Override\n public ListenableFuture<Response> request(final URI uri,\n final String method,\n final byte[] entityBytes,\n final Map<String, List<String>> headers) {\n final l...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_187
{ "fields": [ { "declarator": "MANUAL_DEPLOYMENT_GROUP = DeploymentGroup.newBuilder()\n .setName(\"my_group\")\n .setRolloutOptions(RolloutOptions.getDefault())\n .setRollingUpdateReason(MANUAL)\n .build()", "modifier": "private static final", "original_string": "private stat...
{ "body": "@Test\n public void testTransitionToFailed() {\n final DeploymentGroupTasks deploymentGroupTasks = DeploymentGroupTasks.newBuilder()\n .setTaskIndex(0)\n .setRolloutTasks(Lists.newArrayList(\n RolloutTask.of(RolloutTask.Action.UNDEPLOY_OLD_JOBS, \"host1\"),\n Rollout...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(RollingUpdateOpFactory.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(RollingUpdateOpFactory.class);", "type": "Logger", "var_name": "log" }, ...
{ "body": "public RollingUpdateOp error(final String msg, final String host,\n final RollingUpdateError errorCode,\n final Map<String, Object> metadata) {\n final List<ZooKeeperOperation> operations = Lists.newArrayList();\n final String errMsg = isNul...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_168
{ "fields": [ { "declarator": "flapController", "modifier": "@Mock", "original_string": "@Mock FlapController flapController;", "type": "FlapController", "var_name": "flapController" }, { "declarator": "statusUpdater", "modifier": "@Mock", "original_string":...
{ "body": "@Test\n public void verifyMonitorRecoversFromFlappingState() {\n final SettableFuture<Boolean> flappingRecoveryFuture = SettableFuture.create();\n\n when(flapController.isFlapping())\n .thenReturn(true)\n .thenAnswer(futureAnswer(flappingRecoveryFuture));\n when(flapController.milli...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(TaskMonitor.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(TaskMonitor.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n public void exited(final long code) {\n flapController.exited();\n updateThrottle();\n updateState(EXITED);\n }", "class_method_signature": "TaskMonitor.exited(final long code)", "constructor": false, "full_signature": "@Override public void exited(final long code)", "identif...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_89
{ "fields": [ { "declarator": "dispatcher = mock(RequestDispatcher.class)", "modifier": "private final", "original_string": "private final RequestDispatcher dispatcher = mock(RequestDispatcher.class);", "type": "RequestDispatcher", "var_name": "dispatcher" }, { "declara...
{ "body": "@Test\n public void listHosts() throws Exception {\n final List<String> hosts = ImmutableList.of(\"foo1\", \"foo2\", \"foo3\");\n\n mockResponse(\"GET\", hasPath(\"/hosts/\"), response(\"GET\", 200, hosts));\n\n assertThat(client.listHosts().get(), equalTo(hosts));\n }", "class_method_signatur...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(HeliosClient.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(HeliosClient.class);", "type": "Logger", "var_name": "log" }, { "declarat...
{ "body": "public ListenableFuture<List<String>> listHosts() {\n return listHosts(ImmutableMultimap.<String, String>of());\n }", "class_method_signature": "HeliosClient.listHosts()", "constructor": false, "full_signature": "public ListenableFuture<List<String>> listHosts()", "identifier": "listHosts", "...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_66
{ "fields": [ { "declarator": "EXPECTED_JSON =\n \"{\\\"c\\\":\\\"bar\\\",\\\"foo\\\":{\\\"a\\\":\\\"hello\\\",\\\"b\\\":17,\\\"c\\\":{\\\"1\\\":1,\\\"2\\\":\\\"two\\\"}}}\"", "modifier": "static final", "original_string": "static final String EXPECTED_JSON =\n \"{\\\"c\\\":\\\"bar\\\"...
{ "body": "@Test\n public void verifyPrettyOutput() {\n final String json = Json.asPrettyStringUnchecked(new SomePojo() {\n {\n foo = \"bar\";\n }\n });\n assertEquals(\"{\\n\"\n + \" \\\"foo\\\" : \\\"bar\\\"\\n\"\n + \"}\", json);\n }", "class_method_si...
{ "fields": [ { "declarator": "OBJECT_MAPPER = new ObjectMapper()\n .configure(SORT_PROPERTIES_ALPHABETICALLY, true)\n .configure(ORDER_MAP_ENTRIES_BY_KEYS, true)\n .configure(WRITE_DATES_AS_TIMESTAMPS, false)\n .configure(FAIL_ON_UNKNOWN_PROPERTIES, false)", "modifier": "private s...
{ "body": "public static String asPrettyStringUnchecked(final Object value) {\n try {\n return asPrettyString(value);\n } catch (JsonProcessingException e) {\n throw new RuntimeException(e);\n }\n }", "class_method_signature": "Json.asPrettyStringUnchecked(final Object value)", "constructor": ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_191
{ "fields": [ { "declarator": "PATH = \"/foos\"", "modifier": "private static final", "original_string": "private static final String PATH = \"/foos\";", "type": "String", "var_name": "PATH" }, { "declarator": "zk", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void verifyListenerCalledOnNodeChange() throws Exception {\n final DataPojo created = new DataPojo(\"foo\");\n ensure(\"/foos/foo\", created);\n verify(listener, timeout(60000).atLeastOnce()).nodesChanged(cache);\n reset(listener);\n final DataPojo changed = new DataPojo(\"fo...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PersistentPathChildrenCache.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PersistentPathChildrenCache.class);", "type": "Logger", "var_name": "log...
{ "body": "public Map<String, T> getNodes() {\n return snapshot.get();\n }", "class_method_signature": "PersistentPathChildrenCache.getNodes()", "constructor": false, "full_signature": "public Map<String, T> getNodes()", "identifier": "getNodes", "invocations": [ "get" ], "modifiers": "public", ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_200
{ "fields": [ { "declarator": "registry = new MetricRegistry()", "modifier": "private final", "original_string": "private final MetricRegistry registry = new MetricRegistry();", "type": "MetricRegistry", "var_name": "registry" }, { "declarator": "metrics = new ZooKeeper...
{ "body": "@Test\n public void testTimer() throws Exception {\n metrics.updateTimer(\"timer\", 100, TimeUnit.NANOSECONDS);\n\n final String name = \"group.zookeeper.timer\";\n assertThat(registry.getTimers(), hasKey(name));\n\n final Timer timer = registry.timer(name);\n assertEquals(1, timer.getCount...
{ "fields": [ { "declarator": "TYPE = \"zookeeper\"", "modifier": "private static final", "original_string": "private static final String TYPE = \"zookeeper\";", "type": "String", "var_name": "TYPE" }, { "declarator": "prefix", "modifier": "private final", "...
{ "body": "@Override\n public void updateTimer(final String name, final long duration, final TimeUnit timeUnit) {\n registry.timer(prefix + name).update(duration, timeUnit);\n }", "class_method_signature": "ZooKeeperMetricsImpl.updateTimer(final String name, final long duration, final TimeUnit timeUnit)", "c...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_31
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testJobFromJsonWithInvalidRegistration() throws Exception {\n final URL resource = getClass().getResource(\"job-with-bad-registration.json\");\n final byte[] bytes = Resources.toByteArray(resource);\n final Job job = Json.read(bytes, Job.class);\n\n assertThat(validator.val...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "public Set<String> validate(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n\n errors.addAll(validateJobId(job));\n errors.addAll(validateJobImage(job.getImage()));\n errors.addAll(validateJobHostName(job.getHostname()));\n\n // Check that there's not external port collisio...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_129
{ "fields": [ { "declarator": "options = mock(Namespace.class)", "modifier": "private final", "original_string": "private final Namespace options = mock(Namespace.class);", "type": "Namespace", "var_name": "options" }, { "declarator": "client = mock(HeliosClient.class)"...
{ "body": "@Test\n public void testNonQuietOutputIsSorted() throws Exception {\n when(options.getBoolean(\"q\")).thenReturn(false);\n\n final int ret = command.run(options, client, out, false, null);\n\n assertEquals(0, ret);\n\n assertEquals(expectedOrder, TestUtils.readFirstColumnFromOutput(baos.toStri...
{ "fields": [ { "declarator": "quietArg", "modifier": "private final", "original_string": "private final Argument quietArg;", "type": "Argument", "var_name": "quietArg" }, { "declarator": "patternArg", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n int run(final Namespace options, final HeliosClient client, final PrintStream out,\n final boolean json, final BufferedReader stdin)\n throws ExecutionException, InterruptedException {\n final boolean full = options.getBoolean(fullArg.getDest());\n final boolean quiet = opt...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_152
{ "fields": [], "file": "helios-services/src/test/java/com/spotify/helios/agent/PortAllocatorTest.java", "identifier": "PortAllocatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAllocate() throws Exception {\n final PortAllocator sut = new PortAllocator(20000, 20010);\n final Map<String, PortMapping> mapping = ImmutableMap.of(\"p1\", PortMapping.of(17),\n \"p2\", PortMapping.of(18, 18));\n final Set<Integer> used = ImmutableSet.of(10, 11);\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PortAllocator.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PortAllocator.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "public Map<String, Integer> allocate(final Map<String, PortMapping> ports,\n final Set<Integer> used) {\n return allocate0(ports, Sets.newHashSet(used));\n }", "class_method_signature": "PortAllocator.allocate(final Map<String, PortMapping> ports,\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_105
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" }, {...
{ "body": "@Test\n public void testParsePortMappingsDuplicateName() throws Exception {\n final ImmutableList<TestData> specs = ImmutableList.<TestData>builder()\n .addAll(GOOD_SPECS)\n .add(GOOD_SPECS.get(0))\n .build();\n expectedException.expect(IllegalArgumentException.class);\n expe...
{ "fields": [ { "declarator": "PATTERN =\n compile(\"(?<n>[_\\\\-\\\\w]+)=((?<ip>([0-9]{1,3}.){3}[0-9]{1,3}):)\"\n + \"?(?<i>\\\\d+)(:(?<e>\\\\d+))?(/(?<p>\\\\w+))?\")", "modifier": "private static final", "original_string": "private static final Pattern PATTERN =\n compil...
{ "body": "static Map<String, PortMapping> parsePortMappings(final List<String> portSpecs) {\n final Map<String, PortMapping> explicitPorts = Maps.newHashMap();\n\n for (final String spec : portSpecs) {\n final PortMappingWithName portMappingWithName = parsePortMapping(spec);\n\n final String name = p...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_113
{ "fields": [ { "declarator": "GROUP_NAME = \"my_group\"", "modifier": "private static final", "original_string": "private static final String GROUP_NAME = \"my_group\";", "type": "String", "var_name": "GROUP_NAME" }, { "declarator": "JOB_ID = new JobId(\"foo\", \"2\", ...
{ "body": "@Test\n public void testRollingUpdateFailsIfJobIdChangedDuringRolloutJson() throws Exception {\n when(client.rollingUpdate(anyString(), any(JobId.class), any(RolloutOptions.class)))\n .thenReturn(immediateFuture(new RollingUpdateResponse(RollingUpdateResponse.Status.OK)));\n\n when(client.dep...
{ "fields": [ { "declarator": "POLL_INTERVAL_MILLIS = 1000", "modifier": "private static final", "original_string": "private static final long POLL_INTERVAL_MILLIS = 1000;", "type": "long", "var_name": "POLL_INTERVAL_MILLIS" }, { "declarator": "sleepFunction", "mo...
{ "body": "@Override\n protected int runWithJob(final Namespace options, final HeliosClient client,\n final PrintStream out, final boolean json, final Job job,\n final BufferedReader stdin)\n throws ExecutionException, InterruptedException, IOException {\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_144
{ "fields": [ { "declarator": "NAME = \"foo-group\"", "modifier": "private static final", "original_string": "private static final String NAME = \"foo-group\";", "type": "String", "var_name": "NAME" }, { "declarator": "NON_EXISTENT_NAME = \"bar-group\"", "modifier...
{ "body": "@Test\n public void testDeploymentGroupInspectCommandNotFound() throws Exception {\n when(options.getString(\"name\")).thenReturn(NON_EXISTENT_NAME);\n final int ret = command.run(options, client, out, false, null);\n\n assertEquals(1, ret);\n final String output = baos.toString();\n assert...
{ "fields": [ { "declarator": "nameArg", "modifier": "private final", "original_string": "private final Argument nameArg;", "type": "Argument", "var_name": "nameArg" } ], "file": "helios-tools/src/main/java/com/spotify/helios/cli/command/DeploymentGroupInspectCommand.java", ...
{ "body": "@Override\n int run(final Namespace options, final HeliosClient client, final PrintStream out,\n final boolean json, final BufferedReader stdin)\n throws ExecutionException, InterruptedException, IOException {\n final String name = options.getString(nameArg.getDest());\n\n final Deploy...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_24
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testInvalidNetworkModeFail() {\n final Job job = Job.newBuilder()\n .setName(\"foo\")\n .setVersion(\"1\")\n .setImage(\"foobar\")\n .setNetworkMode(\"chocolate\")\n .build();\n\n assertEquals(1, validator.validate(job).size());\n }", "class_...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "public Set<String> validate(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n\n errors.addAll(validateJobId(job));\n errors.addAll(validateJobImage(job.getImage()));\n errors.addAll(validateJobHostName(job.getHostname()));\n\n // Check that there's not external port collisio...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_215
{ "fields": [ { "declarator": "ROLE_SELECTOR = HostSelector.parse(\"role=my_role\")", "modifier": "private static final", "original_string": "private static final HostSelector ROLE_SELECTOR = HostSelector.parse(\"role=my_role\");", "type": "HostSelector", "var_name": "ROLE_SELECTOR" ...
{ "body": "@Test\n public void testRollingUpdateJobDoesNotExist() throws Exception {\n doThrow(new JobDoesNotExistException(\"\")).when(model).rollingUpdate(\n any(DeploymentGroup.class), any(JobId.class), any(RolloutOptions.class));\n\n final Response response = resource.rollingUpdate(\n \"foo\"...
{ "fields": [ { "declarator": "model", "modifier": "private final", "original_string": "private final MasterModel model;", "type": "MasterModel", "var_name": "model" }, { "declarator": "CREATED_RESPONSE =\n new CreateDeploymentGroupResponse(CreateDeploymentGroupRes...
{ "body": "@POST\n @Path(\"/{name}/rolling-update\")\n @Produces(APPLICATION_JSON)\n @Timed\n @ExceptionMetered\n public Response rollingUpdate(@PathParam(\"name\") @Valid final String name,\n @Valid final RollingUpdateRequest args) {\n try {\n final DeploymentGroup deploym...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_73
{ "fields": [ { "declarator": "delegate = mock(HostnameVerifier.class)", "modifier": "private final", "original_string": "private final HostnameVerifier delegate = mock(HostnameVerifier.class);", "type": "HostnameVerifier", "var_name": "delegate" }, { "declarator": "ssl...
{ "body": "@Test\n public void testHostnameVerificationDisabled() {\n final HostnameVerifierProvider provider = new HostnameVerifierProvider(false, delegate);\n final HostnameVerifier verifier = provider.verifierFor(\"any.host\");\n\n assertTrue(verifier.verify(\"example.com\", sslSession));\n verifyNoMo...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(HostnameVerifierProvider.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(HostnameVerifierProvider.class);", "type": "Logger", "var_name": "log" ...
{ "body": "public HostnameVerifier verifierFor(String hostname) {\n // java 8 will make all these lines for the anon classes go poof\n\n if (!hostnameVerificationEnabled) {\n log.debug(\"hostname verification disabled\");\n return new HostnameVerifier() {\n @Override\n public boolean ver...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_184
{ "fields": [ { "declarator": "MANUAL_DEPLOYMENT_GROUP = DeploymentGroup.newBuilder()\n .setName(\"my_group\")\n .setRolloutOptions(RolloutOptions.getDefault())\n .setRollingUpdateReason(MANUAL)\n .build()", "modifier": "private static final", "original_string": "private stat...
{ "body": "@Test\n public void testNextTaskNoOps() {\n final DeploymentGroupTasks deploymentGroupTasks = DeploymentGroupTasks.newBuilder()\n .setTaskIndex(0)\n .setRolloutTasks(Lists.newArrayList(\n RolloutTask.of(RolloutTask.Action.UNDEPLOY_OLD_JOBS, \"host1\"),\n RolloutTask....
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(RollingUpdateOpFactory.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(RollingUpdateOpFactory.class);", "type": "Logger", "var_name": "log" }, ...
{ "body": "public RollingUpdateOp nextTask() {\n return nextTask(Collections.<ZooKeeperOperation>emptyList());\n }", "class_method_signature": "RollingUpdateOpFactory.nextTask()", "constructor": false, "full_signature": "public RollingUpdateOp nextTask()", "identifier": "nextTask", "invocations": [ ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_65
{ "fields": [ { "declarator": "EXPECTED_JSON =\n \"{\\\"c\\\":\\\"bar\\\",\\\"foo\\\":{\\\"a\\\":\\\"hello\\\",\\\"b\\\":17,\\\"c\\\":{\\\"1\\\":1,\\\"2\\\":\\\"two\\\"}}}\"", "modifier": "static final", "original_string": "static final String EXPECTED_JSON =\n \"{\\\"c\\\":\\\"bar\\\"...
{ "body": "@Test\n public void verifyIgnoresUnknownFields() throws Exception {\n final SomePojo somePojo = Json.read(\"{\\\"foo\\\":\\\"1\\\", \\\"bar\\\":\\\"2\\\"}\", SomePojo.class);\n assertEquals(\"1\", somePojo.foo);\n }", "class_method_signature": "JsonTest.verifyIgnoresUnknownFields()", "construct...
{ "fields": [ { "declarator": "OBJECT_MAPPER = new ObjectMapper()\n .configure(SORT_PROPERTIES_ALPHABETICALLY, true)\n .configure(ORDER_MAP_ENTRIES_BY_KEYS, true)\n .configure(WRITE_DATES_AS_TIMESTAMPS, false)\n .configure(FAIL_ON_UNKNOWN_PROPERTIES, false)", "modifier": "private s...
{ "body": "public static <T> T read(final String content, final Class<T> clazz) throws IOException {\n return OBJECT_MAPPER.readValue(content, clazz);\n }", "class_method_signature": "Json.read(final String content, final Class<T> clazz)", "constructor": false, "full_signature": "public static T read(final ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_192
{ "fields": [ { "declarator": "PATH = \"/foos\"", "modifier": "private static final", "original_string": "private static final String PATH = \"/foos\";", "type": "String", "var_name": "PATH" }, { "declarator": "zk", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void verifyListenerCalledOnNodeRemoved() throws Exception {\n ensure(\"/foos/foo\", new DataPojo(\"foo\"));\n verify(listener, timeout(60000).atLeastOnce()).nodesChanged(cache);\n reset(listener);\n try {\n zk.curatorWithSuperAuth().delete().forPath(\"/foos/foo\");\n } c...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PersistentPathChildrenCache.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PersistentPathChildrenCache.class);", "type": "Logger", "var_name": "log...
{ "body": "public Map<String, T> getNodes() {\n return snapshot.get();\n }", "class_method_signature": "PersistentPathChildrenCache.getNodes()", "constructor": false, "full_signature": "public Map<String, T> getNodes()", "identifier": "getNodes", "invocations": [ "get" ], "modifiers": "public", ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_32
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testValidateGracePeriodAndExternalPorts() throws Exception {\n final Job noPorts = Json.read(stringFromResource(\"job-with-no-ports.json\"), Job.class);\n assertThat(validator.validate(noPorts), Matchers.<String>empty());\n\n final Job noExternalPorts = Json.read(\n str...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "private Set<String> validateGracePeriodAndExternalPorts(final Job job) {\n final Integer gracePeriod = job.getGracePeriod();\n if (gracePeriod != null && gracePeriod > 0 && job.hasExternalPorts()) {\n return singleton(\"Job has both grace period and static/external ports. External ports will \"\...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_203
{ "fields": [ { "declarator": "ffwd = mock(FastForward.class)", "modifier": "private final", "original_string": "private final FastForward ffwd = mock(FastForward.class);", "type": "FastForward", "var_name": "ffwd" }, { "declarator": "metricRegistry = new MetricRegistry...
{ "body": "@Test\n public void testHistogram() throws Exception {\n final Histogram h = metricRegistry.histogram(\"histo.gram\");\n IntStream.range(1, 10).forEach(h::update);\n\n reporter.reportOnce();\n\n verifyHistogramStats(\"histo.gram\", \"histogram\");\n }", "class_method_signature": "FastForwar...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(FastForwardReporter.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(FastForwardReporter.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@VisibleForTesting\n void reportOnce() {\n\n // resolve the additional attributes once per report\n additionalAttributes = additionalAttributesSupplier.get();\n if (additionalAttributes == null) {\n additionalAttributes = Collections.emptyMap();\n }\n\n metricRegistry.getGauges().forEa...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_49
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" ...
{ "body": "@Test\n public void testJsonDeserializationFromInternalPortOnly() throws Exception {\n final PortMapping pm = portMappingFromResource(\"portmapping-internal-port-only.json\");\n assertThat(pm, equalTo(PortMapping.builder()\n .internalPort(456)\n .protocol(TCP)\n .build()));\n }...
{ "fields": [ { "declarator": "TCP = \"tcp\"", "modifier": "public static final", "original_string": "public static final String TCP = \"tcp\";", "type": "String", "var_name": "TCP" }, { "declarator": "UDP = \"udp\"", "modifier": "public static final", "orig...
{ "body": "public static Builder builder() {\n return new Builder().protocol(TCP);\n }", "class_method_signature": "PortMapping.builder()", "constructor": false, "full_signature": "public static Builder builder()", "identifier": "builder", "invocations": [ "protocol" ], "modifiers": "public stat...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_151
{ "fields": [ { "declarator": "ENDPOINT1 = \"http://master-a1.nyc.com:80\"", "modifier": "private static final", "original_string": "private static final String ENDPOINT1 = \"http://master-a1.nyc.com:80\";", "type": "String", "var_name": "ENDPOINT1" }, { "declarator": "...
{ "body": "@Test\n public void testConfigFromFileWithInvalidJson() throws Exception {\n final Map<String, String> environment = ImmutableMap.of();\n final File file = temporaryFolder.newFile();\n expectedEx.expect(ConfigException.class);\n expectedEx.expectMessage(Matchers.containsString(\"Expecting clos...
{ "fields": [ { "declarator": "HTTPS_SCHEME = \"https\"", "modifier": "private static final", "original_string": "private static final String HTTPS_SCHEME = \"https\";", "type": "String", "var_name": "HTTPS_SCHEME" }, { "declarator": "HTTP_SCHEME = \"http\"", "mod...
{ "body": "public static CliConfig fromFile(final File defaultsFile,\n final Map<String, String> environmentVariables)\n throws IOException, URISyntaxException {\n\n final Config config;\n if (defaultsFile.exists() && defaultsFile.canRead()) {\n config = ConfigFactory...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_106
{ "fields": [ { "declarator": "GROUP_NAME = \"my_group\"", "modifier": "private static final", "original_string": "private static final String GROUP_NAME = \"my_group\";", "type": "String", "var_name": "GROUP_NAME" }, { "declarator": "JOB_ID = new JobId(\"foo\", \"2\", ...
{ "body": "@Test\n public void testRollingUpdate() throws Exception {\n when(client.rollingUpdate(anyString(), any(JobId.class), any(RolloutOptions.class)))\n .thenReturn(immediateFuture(new RollingUpdateResponse(RollingUpdateResponse.Status.OK)));\n\n when(client.deploymentGroupStatus(GROUP_NAME)).then...
{ "fields": [ { "declarator": "POLL_INTERVAL_MILLIS = 1000", "modifier": "private static final", "original_string": "private static final long POLL_INTERVAL_MILLIS = 1000;", "type": "long", "var_name": "POLL_INTERVAL_MILLIS" }, { "declarator": "sleepFunction", "mo...
{ "body": "@Override\n protected int runWithJob(final Namespace options, final HeliosClient client,\n final PrintStream out, final boolean json, final Job job,\n final BufferedReader stdin)\n throws ExecutionException, InterruptedException, IOException {\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_110
{ "fields": [ { "declarator": "GROUP_NAME = \"my_group\"", "modifier": "private static final", "original_string": "private static final String GROUP_NAME = \"my_group\";", "type": "String", "var_name": "GROUP_NAME" }, { "declarator": "JOB_ID = new JobId(\"foo\", \"2\", ...
{ "body": "@Test\n public void testRollingUpdateFailed() throws Exception {\n when(client.rollingUpdate(anyString(), any(JobId.class), any(RolloutOptions.class)))\n .thenReturn(immediateFuture(new RollingUpdateResponse(RollingUpdateResponse.Status.OK)));\n\n when(client.deploymentGroupStatus(GROUP_NAME)...
{ "fields": [ { "declarator": "POLL_INTERVAL_MILLIS = 1000", "modifier": "private static final", "original_string": "private static final long POLL_INTERVAL_MILLIS = 1000;", "type": "long", "var_name": "POLL_INTERVAL_MILLIS" }, { "declarator": "sleepFunction", "mo...
{ "body": "@Override\n protected int runWithJob(final Namespace options, final HeliosClient client,\n final PrintStream out, final boolean json, final Job job,\n final BufferedReader stdin)\n throws ExecutionException, InterruptedException, IOException {\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_147
{ "fields": [ { "declarator": "GROUP_NAME = \"my_group\"", "modifier": "private static final", "original_string": "private static final String GROUP_NAME = \"my_group\";", "type": "String", "var_name": "GROUP_NAME" }, { "declarator": "options = mock(Namespace.class)", ...
{ "body": "@Test\n public void testRemoveDeploymentGroupRemovedJson() throws Exception {\n when(client.removeDeploymentGroup(GROUP_NAME))\n .thenReturn(immediateFuture(new RemoveDeploymentGroupResponse(Status.REMOVED)));\n\n final int ret = command.run(options, client, out, true, null);\n final Strin...
{ "fields": [ { "declarator": "nameArg", "modifier": "private final", "original_string": "private final Argument nameArg;", "type": "Argument", "var_name": "nameArg" } ], "file": "helios-tools/src/main/java/com/spotify/helios/cli/command/DeploymentGroupRemoveCommand.java", ...
{ "body": "@Override\n int run(final Namespace options, final HeliosClient client, final PrintStream out,\n final boolean json, final BufferedReader stdin)\n throws ExecutionException, InterruptedException, IOException {\n final String name = options.getString(nameArg.getDest());\n\n final Remove...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_130
{ "fields": [ { "declarator": "options = mock(Namespace.class)", "modifier": "private final", "original_string": "private final Namespace options = mock(Namespace.class);", "type": "Namespace", "var_name": "options" }, { "declarator": "client = mock(HeliosClient.class)"...
{ "body": "@Test\n public void testFilterJob() throws Exception {\n when(options.getString(\"job\")).thenReturn(\"foo\");\n\n final JobId jobId1 = JobId.parse(\"foo:bar\");\n final JobId jobId2 = JobId.parse(\"foo:bat\");\n final Job job1 = jobWithId(jobId1);\n final Job job2 = jobWithId(jobId2);\n\n ...
{ "fields": [ { "declarator": "jobArg", "modifier": "private final", "original_string": "private final Argument jobArg;", "type": "Argument", "var_name": "jobArg" }, { "declarator": "hostArg", "modifier": "private final", "original_string": "private final Ar...
{ "body": "@Override\n int run(final Namespace options, final HeliosClient client, final PrintStream out,\n final boolean json, final BufferedReader stdin)\n throws ExecutionException, InterruptedException {\n final String jobIdString = options.getString(jobArg.getDest());\n final String hostPatt...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_28
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testImageNamespaceWithHyphens() {\n final Job job = VALID_JOB.toBuilder()\n .setImage(\"b.gcr.io/cloudsql-docker/gce-proxy:1.05\")\n .build();\n\n assertThat(validator.validate(job), is(empty()));\n }", "class_method_signature": "JobValidatorTest.testImageNamespa...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "public Set<String> validate(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n\n errors.addAll(validateJobId(job));\n errors.addAll(validateJobImage(job.getImage()));\n errors.addAll(validateJobHostName(job.getHostname()));\n\n // Check that there's not external port collisio...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_219
{ "fields": [ { "declarator": "model = mock(MasterModel.class)", "modifier": "private final", "original_string": "private final MasterModel model = mock(MasterModel.class);", "type": "MasterModel", "var_name": "model" }, { "declarator": "capabilities = ImmutableSet.of()...
{ "body": "@Test\n public void testListJobsWithMultipleDeployments() throws Exception {\n // two hosts match this name patterns\n final String namePattern = \"foo\";\n when(model.listHosts(namePattern))\n .thenReturn(ImmutableList.of(\"foobar.example.net\", \"barfoo.example.net\"));\n\n final JobI...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(JobsResource.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(JobsResource.class);", "type": "Logger", "var_name": "log" }, { "declarat...
{ "body": "@GET\n @Produces(APPLICATION_JSON)\n @Timed\n @ExceptionMetered\n public Map<JobId, Job> list(\n @QueryParam(\"q\") @DefaultValue(\"\") final String query,\n @QueryParam(\"hostPattern\") @DefaultValue(\"\") final String hostPattern) {\n\n final Map<JobId, Job> allJobs;\n if (!hostPatter...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_167
{ "fields": [ { "declarator": "flapController", "modifier": "@Mock", "original_string": "@Mock FlapController flapController;", "type": "FlapController", "var_name": "flapController" }, { "declarator": "statusUpdater", "modifier": "@Mock", "original_string":...
{ "body": "@Test\n public void verifyImageMissingTrumpsFlappingState() throws Exception {\n when(flapController.isFlapping()).thenReturn(true);\n sut.failed(new ImageNotFoundException(\"foobar\", \"not found\"), \"container error\");\n verify(statusUpdater).setThrottleState(IMAGE_MISSING);\n verify(statu...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(TaskMonitor.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(TaskMonitor.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n public void failed(final Throwable th, String containerError) {\n if (th instanceof InterruptedException) {\n // Ignore failures due to interruptions as they're used when tearing down the agent and do\n // not indicate actual runner failures.\n return;\n }\n if (th inst...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_188
{ "fields": [ { "declarator": "MANUAL_DEPLOYMENT_GROUP = DeploymentGroup.newBuilder()\n .setName(\"my_group\")\n .setRolloutOptions(RolloutOptions.getDefault())\n .setRollingUpdateReason(MANUAL)\n .build()", "modifier": "private static final", "original_string": "private stat...
{ "body": "@Test\n public void testYield() {\n final DeploymentGroupTasks deploymentGroupTasks = DeploymentGroupTasks.newBuilder()\n .setTaskIndex(0)\n .setRolloutTasks(Lists.newArrayList(\n RolloutTask.of(RolloutTask.Action.UNDEPLOY_OLD_JOBS, \"host1\"),\n RolloutTask.of(Rollo...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(RollingUpdateOpFactory.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(RollingUpdateOpFactory.class);", "type": "Logger", "var_name": "log" }, ...
{ "body": "public RollingUpdateOp yield() {\n // Do nothing\n return new RollingUpdateOp(ImmutableList.<ZooKeeperOperation>of(),\n ImmutableList.<Map<String, Object>>of());\n }", "class_method_signature": "RollingUpdateOpFactory.yield()", "constructor": false, "full_signature": "public RollingUpda...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_90
{ "fields": [ { "declarator": "temporaryFolder = new TemporaryFolder()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final TemporaryFolder temporaryFolder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "temporaryFolder" }, { ...
{ "body": "@Test\n public void testComputeTargetsSingleEndpoint() throws Exception {\n final CliParser cliParser = new CliParser(toArray(singleEndpointArgs));\n final List<Target> targets = cliParser.getTargets();\n\n // We expect the specified master endpoint target\n final List<Target> expectedTargets ...
{ "fields": [ { "declarator": "NAME_AND_VERSION = \"Spotify Helios CLI \" + Version.POM_VERSION", "modifier": "private static final", "original_string": "private static final String NAME_AND_VERSION = \"Spotify Helios CLI \" + Version.POM_VERSION;", "type": "String", "var_name": "NAM...
{ "body": "public List<Target> getTargets() {\n return targets;\n }", "class_method_signature": "CliParser.getTargets()", "constructor": false, "full_signature": "public List<Target> getTargets()", "identifier": "getTargets", "invocations": [], "modifiers": "public", "parameters": "()", "return": ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_171
{ "fields": [], "file": "helios-services/src/test/java/com/spotify/helios/agent/AddExtraHostContainerDecoratorTest.java", "identifier": "AddExtraHostContainerDecoratorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void invalidArguments() {\n assertThat(isValidArg(\"abc:def:gh\"), is(false));\n }", "class_method_signature": "AddExtraHostContainerDecoratorTest.invalidArguments()", "constructor": false, "full_signature": "@Test public void invalidArguments()", "identifier": "invalidArguments...
{ "fields": [ { "declarator": "extraHosts", "modifier": "private final", "original_string": "private final List<String> extraHosts;", "type": "List<String>", "var_name": "extraHosts" } ], "file": "helios-services/src/main/java/com/spotify/helios/agent/AddExtraHostContainerDec...
{ "body": "public static boolean isValidArg(String arg) {\n final String[] args = arg.split(\":\");\n if (args.length != 2) {\n return false;\n }\n\n final String ip = args[1];\n return InetAddresses.isInetAddress(ip);\n }", "class_method_signature": "AddExtraHostContainerDecorator.isValidArg(S...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_69
{ "fields": [], "file": "helios-client/src/test/java/com/spotify/helios/client/GoogleCredentialsAccessTokenSupplierTest.java", "identifier": "GoogleCredentialsAccessTokenSupplierTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetWithCredentials() throws IOException {\n final GoogleCredentials credentials = mock(GoogleCredentials.class);\n final GoogleCredentialsAccessTokenSupplier supplier = new GoogleCredentialsAccessTokenSupplier(\n true, null, null, credentials);\n supplier.get();\n ...
{ "fields": [ { "declarator": "LOG =\n LoggerFactory.getLogger(GoogleCredentialsAccessTokenSupplier.class)", "modifier": "private static final", "original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(GoogleCredentialsAccessTokenSupplier.class);", "type": ...
{ "body": "@Override\n public Optional<AccessToken> get() {\n Optional<AccessToken> tokenOpt = Optional.absent();\n\n if (enabled) {\n if (staticToken != null) {\n tokenOpt = Optional.of(staticToken);\n } else {\n try {\n synchronized (lock) {\n if (credentials == nu...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_86
{ "fields": [ { "declarator": "IP_A = InetAddresses.forString(\"1.2.3.4\")", "modifier": "private static final", "original_string": "private static final InetAddress IP_A = InetAddresses.forString(\"1.2.3.4\");", "type": "InetAddress", "var_name": "IP_A" }, { "declarato...
{ "body": "@Test\n public void testInvalidUri_NoScheme() throws Exception {\n final DnsResolver resolver = mock(DnsResolver.class);\n when(resolver.resolve(\"example.com\")).thenReturn(IPS_1);\n exception.expect(IllegalArgumentException.class);\n Endpoints.of(ImmutableList.of(new URI(null, \"example.com\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Endpoints.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(Endpoints.class);", "type": "Logger", "var_name": "log" }, { "declarator": "...
{ "body": "public static Supplier<List<Endpoint>> of(final Supplier<List<URI>> uriSupplier) {\n return of(uriSupplier, DEFAULT_DNS_RESOLVER);\n }", "class_method_signature": "Endpoints.of(final Supplier<List<URI>> uriSupplier)", "constructor": false, "full_signature": "public static Supplier<List<Endpoint>>...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_126
{ "fields": [ { "declarator": "SEARCH_PATH = new Name[]{ Name.fromConstantString(\"bar.com\"),\n Name.fromConstantString(\"foo.com\") }", "modifier": "private static final", "original_string": "private static final Name[] SEARCH_PATH = new N...
{ "body": "@Test\n public void testWithSearchPathDisambiguation() throws Exception {\n final HostResolver resolver = new HostResolver(ALL_HOSTS, SEARCH_PATH);\n\n assertEquals(\"host1.bar.com\", resolver.resolveName(\"host1\"));\n assertEquals(\"host1.bar.com\", resolver.resolveName(\"ho\"));\n }", "clas...
{ "fields": [ { "declarator": "EMPTY_PATH = new Name[]{}", "modifier": "private static final", "original_string": "private static final Name[] EMPTY_PATH = new Name[]{};", "type": "Name[]", "var_name": "EMPTY_PATH" }, { "declarator": "allHosts", "modifier": "priva...
{ "body": "String resolveName(final String host) {\n // passed FQDN, all set\n if (allHosts.contains(host)) {\n return host;\n }\n\n final List<String> matches = findPrefixMatches(host);\n if (matches.isEmpty()) {\n return host; // no pfx matches, let it fail upstream\n }\n\n if (match...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_45
{ "fields": [], "file": "helios-client/src/test/java/com/spotify/helios/common/descriptors/HostSelectorTest.java", "identifier": "HostSelectorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotInOperatorSerialization() throws Exception {\n final HostSelector orig = HostSelector.parse(\"a notin (foo,bar)\");\n final HostSelector parsed = Json.read(Json.asString(orig), HostSelector.class);\n assertEquals(orig, parsed);\n }", "class_method_signature": "HostSe...
{ "fields": [ { "declarator": "IN_BIPREDICATE =\n new BiPredicate<String, Object>() {\n @Override\n public boolean test(final String a, final Object b) {\n @SuppressWarnings(\"unchecked\") final Iterable<String> iterable = (Iterable<String>) b;\n return Iterables.contain...
{ "body": "public static HostSelector parse(final String str) {\n checkNotNull(str);\n\n final Matcher matcher = PATTERN.matcher(str);\n if (matcher.matches()) {\n final String label = matcher.group(1);\n final String opStr = matcher.group(2);\n final String value = matcher.group(3);\n\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_223
{ "fields": [ { "declarator": "NO_SELECTOR_ARG = Collections.emptyList()", "modifier": "private static final", "original_string": "private static final List<String> NO_SELECTOR_ARG = Collections.emptyList();", "type": "List<String>", "var_name": "NO_SELECTOR_ARG" }, { "...
{ "body": "@Test\n public void listHostsNameFilter() {\n when(model.listHosts(\"foo.example\")).thenReturn(hosts);\n assertThat(resource.list(\"foo.example\", NO_SELECTOR_ARG), equalTo(hosts));\n\n when(model.listHosts(\"host1\")).thenReturn(ImmutableList.of(\"host1.foo.example.com\"));\n assertThat(reso...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(HostsResource.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(HostsResource.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "@GET\n @Produces(APPLICATION_JSON)\n @Timed\n @ExceptionMetered\n public List<String> list(@QueryParam(\"namePattern\") final String namePattern,\n @QueryParam(\"selector\") final List<String> hostSelectors) {\n\n List<String> hosts = namePattern == null ? model.listHosts()...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_12
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testValidPortTagsPass() {\n final Job j = Job.newBuilder().setName(\"foo\").setVersion(\"1\").setImage(\"foobar\").build();\n final Job.Builder builder = j.toBuilder();\n final Map<String, PortMapping> ports = ImmutableMap.of(\"add_ports1\", PortMapping.of(1234),\n \"ad...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "public Set<String> validate(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n\n errors.addAll(validateJobId(job));\n errors.addAll(validateJobImage(job.getImage()));\n errors.addAll(validateJobHostName(job.getHostname()));\n\n // Check that there's not external port collisio...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_235
{ "fields": [], "file": "helios-services/src/test/java/com/spotify/helios/master/metrics/TotalHealthCheckGaugeTest.java", "identifier": "TotalHealthCheckGaugeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAllFail() {\n final HealthCheckRegistry registry = new HealthCheckRegistry();\n registry.register(\"fail1\", stubHealthCheck(HealthCheck.Result.unhealthy(\"error\")));\n registry.register(\"fail2\", stubHealthCheck(HealthCheck.Result.unhealthy(\"error\")));\n\n final To...
{ "fields": [ { "declarator": "registry", "modifier": "private final", "original_string": "private final HealthCheckRegistry registry;", "type": "HealthCheckRegistry", "var_name": "registry" } ], "file": "helios-services/src/main/java/com/spotify/helios/master/metrics/TotalHe...
{ "body": "@Override\n public Integer getValue() {\n final SortedMap<String, HealthCheck.Result> results = registry.runHealthChecks();\n return results.values().stream().allMatch(HealthCheck.Result::isHealthy) ? 1 : 0;\n }", "class_method_signature": "TotalHealthCheckGauge.getValue()", "constructor": fals...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_1
{ "fields": [], "file": "helios-client/src/test/java/com/spotify/helios/common/PomVersionTest.java", "identifier": "PomVersionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testComparable() {\n final PomVersion v1 = new PomVersion(false, 1, 0, 5);\n final PomVersion v2 = new PomVersion(false, 2, 1, 0);\n\n assertTrue(v1.compareTo(v2) < 0);\n assertTrue(v2.compareTo(v1) > 0);\n }", "class_method_signature": "PomVersionTest.testComparable()",...
{ "fields": [ { "declarator": "isSnapshot", "modifier": "private final", "original_string": "private final boolean isSnapshot;", "type": "boolean", "var_name": "isSnapshot" }, { "declarator": "major", "modifier": "private final", "original_string": "private ...
{ "body": "@Override\n public int compareTo(@NotNull PomVersion pv) {\n return ComparisonChain.start()\n .compare(this.major, pv.major)\n .compare(this.minor, pv.minor)\n .compare(this.patch, pv.patch)\n .compareTrueFirst(this.isSnapshot, pv.isSnapshot)\n .result();\n }", "cl...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_53
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" ...
{ "body": "@Test\n public void testJsonSerializationFromInternalPortOnly() throws Exception {\n final PortMapping pm = PortMapping.builder()\n .internalPort(456)\n .build();\n final String json = toJson(pm);\n assertThat(json, equalTo(stringFromResource(\"portmapping-serialized-internal-port-o...
{ "fields": [ { "declarator": "TCP = \"tcp\"", "modifier": "public static final", "original_string": "public static final String TCP = \"tcp\";", "type": "String", "var_name": "TCP" }, { "declarator": "UDP = \"udp\"", "modifier": "public static final", "orig...
{ "body": "public static Builder builder() {\n return new Builder().protocol(TCP);\n }", "class_method_signature": "PortMapping.builder()", "constructor": false, "full_signature": "public static Builder builder()", "identifier": "builder", "invocations": [ "protocol" ], "modifiers": "public stat...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_0
{ "fields": [], "file": "helios-client/src/test/java/com/spotify/helios/common/PomVersionTest.java", "identifier": "PomVersionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFailures() {\n try {\n PomVersion.parse(\"1.2\");\n fail(\"should throw\");\n } catch (RuntimeException e) { // ok\n assertTrue(\"should contain something about format\", e.getMessage().contains(\"format\"));\n }\n\n try {\n PomVersion.parse(\"1.2.3....
{ "fields": [ { "declarator": "isSnapshot", "modifier": "private final", "original_string": "private final boolean isSnapshot;", "type": "boolean", "var_name": "isSnapshot" }, { "declarator": "major", "modifier": "private final", "original_string": "private ...
{ "body": "public static PomVersion parse(final String str) {\n boolean isSnapshot = false;\n String version = str;\n if (str.endsWith(\"-SNAPSHOT\")) {\n isSnapshot = true;\n version = version.substring(0, str.length() - 9);\n }\n\n final Iterable<String> bits = Splitter.on(\".\").split(vers...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_52
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" ...
{ "body": "@Test\n public void testJsonSerializationWithDefaults() throws Exception {\n final PortMapping pm = PortMapping.builder()\n .internalPort(456)\n .externalPort(123)\n .build();\n final String json = toJson(pm);\n assertThat(json, equalTo(stringFromResource(\"portmapping-defaul...
{ "fields": [ { "declarator": "TCP = \"tcp\"", "modifier": "public static final", "original_string": "public static final String TCP = \"tcp\";", "type": "String", "var_name": "TCP" }, { "declarator": "UDP = \"udp\"", "modifier": "public static final", "orig...
{ "body": "public static Builder builder() {\n return new Builder().protocol(TCP);\n }", "class_method_signature": "PortMapping.builder()", "constructor": false, "full_signature": "public static Builder builder()", "identifier": "builder", "invocations": [ "protocol" ], "modifiers": "public stat...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_234
{ "fields": [], "file": "helios-services/src/test/java/com/spotify/helios/master/metrics/TotalHealthCheckGaugeTest.java", "identifier": "TotalHealthCheckGaugeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOneFails() {\n final HealthCheckRegistry registry = new HealthCheckRegistry();\n registry.register(\"pass1\", stubHealthCheck(HealthCheck.Result.healthy()));\n registry.register(\"fail1\", stubHealthCheck(HealthCheck.Result.unhealthy(\"error\")));\n\n final TotalHealthC...
{ "fields": [ { "declarator": "registry", "modifier": "private final", "original_string": "private final HealthCheckRegistry registry;", "type": "HealthCheckRegistry", "var_name": "registry" } ], "file": "helios-services/src/main/java/com/spotify/helios/master/metrics/TotalHe...
{ "body": "@Override\n public Integer getValue() {\n final SortedMap<String, HealthCheck.Result> results = registry.runHealthChecks();\n return results.values().stream().allMatch(HealthCheck.Result::isHealthy) ? 1 : 0;\n }", "class_method_signature": "TotalHealthCheckGauge.getValue()", "constructor": fals...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_222
{ "fields": [ { "declarator": "NO_SELECTOR_ARG = Collections.emptyList()", "modifier": "private static final", "original_string": "private static final List<String> NO_SELECTOR_ARG = Collections.emptyList();", "type": "List<String>", "var_name": "NO_SELECTOR_ARG" }, { "...
{ "body": "@Test\n public void listHosts() {\n assertThat(resource.list(null, NO_SELECTOR_ARG), equalTo(hosts));\n }", "class_method_signature": "HostsResourceTest.listHosts()", "constructor": false, "full_signature": "@Test public void listHosts()", "identifier": "listHosts", "invocations": [ "ass...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(HostsResource.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(HostsResource.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "@GET\n @Produces(APPLICATION_JSON)\n @Timed\n @ExceptionMetered\n public List<String> list(@QueryParam(\"namePattern\") final String namePattern,\n @QueryParam(\"selector\") final List<String> hostSelectors) {\n\n List<String> hosts = namePattern == null ? model.listHosts()...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_13
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testPortMappingCollisionFails() throws Exception {\n final Job job = Job.newBuilder()\n .setName(\"foo\")\n .setVersion(\"1\")\n .setImage(\"bar\")\n .setPorts(ImmutableMap.of(\"1\", PortMapping.of(1, 1),\n \"2\", PortMapping.of(2, 1)))\n ...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "public Set<String> validate(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n\n errors.addAll(validateJobId(job));\n errors.addAll(validateJobImage(job.getImage()));\n errors.addAll(validateJobHostName(job.getHostname()));\n\n // Check that there's not external port collisio...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_44
{ "fields": [], "file": "helios-client/src/test/java/com/spotify/helios/common/descriptors/HostSelectorTest.java", "identifier": "HostSelectorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotInOperatorEquality() {\n assertEquals(\n HostSelector.parse(\"a notin (foo,bar)\"),\n HostSelector.parse(\"a notin (foo, bar)\")\n );\n\n assertEquals(\n HostSelector.parse(\"a notin (foo,bar)\"),\n HostSelector.parse(\"a notin (bar,foo)\")\n...
{ "fields": [ { "declarator": "IN_BIPREDICATE =\n new BiPredicate<String, Object>() {\n @Override\n public boolean test(final String a, final Object b) {\n @SuppressWarnings(\"unchecked\") final Iterable<String> iterable = (Iterable<String>) b;\n return Iterables.contain...
{ "body": "public static HostSelector parse(final String str) {\n checkNotNull(str);\n\n final Matcher matcher = PATTERN.matcher(str);\n if (matcher.matches()) {\n final String label = matcher.group(1);\n final String opStr = matcher.group(2);\n final String value = matcher.group(3);\n\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_127
{ "fields": [ { "declarator": "SEARCH_PATH = new Name[]{ Name.fromConstantString(\"bar.com\"),\n Name.fromConstantString(\"foo.com\") }", "modifier": "private static final", "original_string": "private static final Name[] SEARCH_PATH = new N...
{ "body": "@Test\n public void testAmbiguousWithSearchPathDisambiguation() throws Exception {\n final HostResolver resolver = new HostResolver(\n ImmutableSet.of(\"host1.foo.com\", \"host2.foo.com\"),\n SEARCH_PATH);\n\n // Even with path disambiguation, we can't disambiguate\n assertEquals(\"...
{ "fields": [ { "declarator": "EMPTY_PATH = new Name[]{}", "modifier": "private static final", "original_string": "private static final Name[] EMPTY_PATH = new Name[]{};", "type": "Name[]", "var_name": "EMPTY_PATH" }, { "declarator": "allHosts", "modifier": "priva...
{ "body": "String resolveName(final String host) {\n // passed FQDN, all set\n if (allHosts.contains(host)) {\n return host;\n }\n\n final List<String> matches = findPrefixMatches(host);\n if (matches.isEmpty()) {\n return host; // no pfx matches, let it fail upstream\n }\n\n if (match...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_68
{ "fields": [], "file": "helios-client/src/test/java/com/spotify/helios/client/GoogleCredentialsAccessTokenSupplierTest.java", "identifier": "GoogleCredentialsAccessTokenSupplierTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetWithStaticToken() {\n final AccessToken token = new AccessToken(\"token\", null);\n final GoogleCredentialsAccessTokenSupplier supplier =\n new GoogleCredentialsAccessTokenSupplier(true, token, null);\n assertThat(supplier.get(), equalTo(Optional.of(token)));\n ...
{ "fields": [ { "declarator": "LOG =\n LoggerFactory.getLogger(GoogleCredentialsAccessTokenSupplier.class)", "modifier": "private static final", "original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(GoogleCredentialsAccessTokenSupplier.class);", "type": ...
{ "body": "@Override\n public Optional<AccessToken> get() {\n Optional<AccessToken> tokenOpt = Optional.absent();\n\n if (enabled) {\n if (staticToken != null) {\n tokenOpt = Optional.of(staticToken);\n } else {\n try {\n synchronized (lock) {\n if (credentials == nu...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_87
{ "fields": [ { "declarator": "IP_A = InetAddresses.forString(\"1.2.3.4\")", "modifier": "private static final", "original_string": "private static final InetAddress IP_A = InetAddresses.forString(\"1.2.3.4\");", "type": "InetAddress", "var_name": "IP_A" }, { "declarato...
{ "body": "@Test\n public void testInvalidUri_NoPort() throws Exception {\n final DnsResolver resolver = mock(DnsResolver.class);\n when(resolver.resolve(\"example.com\")).thenReturn(IPS_1);\n exception.expect(IllegalArgumentException.class);\n Endpoints.of(ImmutableList.of(new URI(\"http\", \"example.co...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Endpoints.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(Endpoints.class);", "type": "Logger", "var_name": "log" }, { "declarator": "...
{ "body": "public static Supplier<List<Endpoint>> of(final Supplier<List<URI>> uriSupplier) {\n return of(uriSupplier, DEFAULT_DNS_RESOLVER);\n }", "class_method_signature": "Endpoints.of(final Supplier<List<URI>> uriSupplier)", "constructor": false, "full_signature": "public static Supplier<List<Endpoint>>...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_170
{ "fields": [], "file": "helios-services/src/test/java/com/spotify/helios/agent/AddExtraHostContainerDecoratorTest.java", "identifier": "AddExtraHostContainerDecoratorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void invalidArgument() {\n assertThat(isValidArg(\"abcdefg\"), is(false));\n }", "class_method_signature": "AddExtraHostContainerDecoratorTest.invalidArgument()", "constructor": false, "full_signature": "@Test public void invalidArgument()", "identifier": "invalidArgument", "i...
{ "fields": [ { "declarator": "extraHosts", "modifier": "private final", "original_string": "private final List<String> extraHosts;", "type": "List<String>", "var_name": "extraHosts" } ], "file": "helios-services/src/main/java/com/spotify/helios/agent/AddExtraHostContainerDec...
{ "body": "public static boolean isValidArg(String arg) {\n final String[] args = arg.split(\":\");\n if (args.length != 2) {\n return false;\n }\n\n final String ip = args[1];\n return InetAddresses.isInetAddress(ip);\n }", "class_method_signature": "AddExtraHostContainerDecorator.isValidArg(S...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_91
{ "fields": [ { "declarator": "temporaryFolder = new TemporaryFolder()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final TemporaryFolder temporaryFolder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "temporaryFolder" }, { ...
{ "body": "@Test\n public void testComputeTargetsMultipleEndpoints() throws Exception {\n final List<String> argsList = Lists.newArrayList(\n SUBCOMMAND, \"-d\", Joiner.on(\",\").join(DOMAINS));\n for (final String endpoint : ENDPOINTS) {\n argsList.add(\"--master\");\n argsList.add(endpoint);...
{ "fields": [ { "declarator": "NAME_AND_VERSION = \"Spotify Helios CLI \" + Version.POM_VERSION", "modifier": "private static final", "original_string": "private static final String NAME_AND_VERSION = \"Spotify Helios CLI \" + Version.POM_VERSION;", "type": "String", "var_name": "NAM...
{ "body": "public List<Target> getTargets() {\n return targets;\n }", "class_method_signature": "CliParser.getTargets()", "constructor": false, "full_signature": "public List<Target> getTargets()", "identifier": "getTargets", "invocations": [], "modifiers": "public", "parameters": "()", "return": ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_166
{ "fields": [ { "declarator": "flapController", "modifier": "@Mock", "original_string": "@Mock FlapController flapController;", "type": "FlapController", "var_name": "flapController" }, { "declarator": "statusUpdater", "modifier": "@Mock", "original_string":...
{ "body": "@Test\n public void verifyImagePullFailureTrumpsFlappingState() throws Exception {\n when(flapController.isFlapping()).thenReturn(true);\n sut.failed(new ImagePullFailedException(\"foobar\", \"failure\"), \"container error\");\n verify(statusUpdater).setThrottleState(IMAGE_PULL_FAILED);\n veri...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(TaskMonitor.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(TaskMonitor.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n public void failed(final Throwable th, String containerError) {\n if (th instanceof InterruptedException) {\n // Ignore failures due to interruptions as they're used when tearing down the agent and do\n // not indicate actual runner failures.\n return;\n }\n if (th inst...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_189
{ "fields": [ { "declarator": "MANUAL_DEPLOYMENT_GROUP = DeploymentGroup.newBuilder()\n .setName(\"my_group\")\n .setRolloutOptions(RolloutOptions.getDefault())\n .setRollingUpdateReason(MANUAL)\n .build()", "modifier": "private static final", "original_string": "private stat...
{ "body": "@Test\n public void testErrorWhenIgnoreFailuresIsTrue() {\n final DeploymentGroup deploymentGroup = DeploymentGroup.newBuilder()\n .setName(\"ignore_failure_group\")\n .setRolloutOptions(RolloutOptions.newBuilder()\n .setIgnoreFailures(true)\n .build()\n )\n ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(RollingUpdateOpFactory.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(RollingUpdateOpFactory.class);", "type": "Logger", "var_name": "log" }, ...
{ "body": "public RollingUpdateOp error(final String msg, final String host,\n final RollingUpdateError errorCode,\n final Map<String, Object> metadata) {\n final List<ZooKeeperOperation> operations = Lists.newArrayList();\n final String errMsg = isNul...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_29
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testImageNameWithManyNameComponents() {\n final Job job = VALID_JOB.toBuilder()\n .setImage(\"b.gcr.io/cloudsql-docker/and/more/components/gce-proxy:1.05\")\n .build();\n\n assertThat(validator.validate(job), is(empty()));\n }", "class_method_signature": "JobVali...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "public Set<String> validate(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n\n errors.addAll(validateJobId(job));\n errors.addAll(validateJobImage(job.getImage()));\n errors.addAll(validateJobHostName(job.getHostname()));\n\n // Check that there's not external port collisio...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_218
{ "fields": [ { "declarator": "model = mock(MasterModel.class)", "modifier": "private final", "original_string": "private final MasterModel model = mock(MasterModel.class);", "type": "MasterModel", "var_name": "model" }, { "declarator": "capabilities = ImmutableSet.of()...
{ "body": "@Test\n public void testListJobsWithHostNameFilter() throws Exception {\n // one host matches this name pattern\n final String namePattern = \"foo\";\n when(model.listHosts(namePattern)).thenReturn(ImmutableList.of(\"foobar.example.net\"));\n\n final JobId jobId1 = JobId.parse(\"foobar:1\");\n...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(JobsResource.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(JobsResource.class);", "type": "Logger", "var_name": "log" }, { "declarat...
{ "body": "@GET\n @Produces(APPLICATION_JSON)\n @Timed\n @ExceptionMetered\n public Map<JobId, Job> list(\n @QueryParam(\"q\") @DefaultValue(\"\") final String query,\n @QueryParam(\"hostPattern\") @DefaultValue(\"\") final String hostPattern) {\n\n final Map<JobId, Job> allJobs;\n if (!hostPatter...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_131
{ "fields": [ { "declarator": "options = mock(Namespace.class)", "modifier": "private final", "original_string": "private final Namespace options = mock(Namespace.class);", "type": "Namespace", "var_name": "options" }, { "declarator": "client = mock(HeliosClient.class)"...
{ "body": "@Test\n public void testFilterJobAndHost() throws Exception {\n when(options.getString(\"job\")).thenReturn(\"foo\");\n when(options.getString(\"host\")).thenReturn(\"host\");\n\n final JobId jobId1 = JobId.parse(\"foo:bar\");\n final JobId jobId2 = JobId.parse(\"foo:bat\");\n final Job job...
{ "fields": [ { "declarator": "jobArg", "modifier": "private final", "original_string": "private final Argument jobArg;", "type": "Argument", "var_name": "jobArg" }, { "declarator": "hostArg", "modifier": "private final", "original_string": "private final Ar...
{ "body": "@Override\n int run(final Namespace options, final HeliosClient client, final PrintStream out,\n final boolean json, final BufferedReader stdin)\n throws ExecutionException, InterruptedException {\n final String jobIdString = options.getString(jobArg.getDest());\n final String hostPatt...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_146
{ "fields": [ { "declarator": "GROUP_NAME = \"my_group\"", "modifier": "private static final", "original_string": "private static final String GROUP_NAME = \"my_group\";", "type": "String", "var_name": "GROUP_NAME" }, { "declarator": "options = mock(Namespace.class)", ...
{ "body": "@Test\n public void testRemoveDeploymentGroupRemoved() throws Exception {\n when(client.removeDeploymentGroup(GROUP_NAME))\n .thenReturn(immediateFuture(new RemoveDeploymentGroupResponse(Status.REMOVED)));\n\n final int ret = command.run(options, client, out, false, null);\n final String o...
{ "fields": [ { "declarator": "nameArg", "modifier": "private final", "original_string": "private final Argument nameArg;", "type": "Argument", "var_name": "nameArg" } ], "file": "helios-tools/src/main/java/com/spotify/helios/cli/command/DeploymentGroupRemoveCommand.java", ...
{ "body": "@Override\n int run(final Namespace options, final HeliosClient client, final PrintStream out,\n final boolean json, final BufferedReader stdin)\n throws ExecutionException, InterruptedException, IOException {\n final String name = options.getString(nameArg.getDest());\n\n final Remove...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_111
{ "fields": [ { "declarator": "GROUP_NAME = \"my_group\"", "modifier": "private static final", "original_string": "private static final String GROUP_NAME = \"my_group\";", "type": "String", "var_name": "GROUP_NAME" }, { "declarator": "JOB_ID = new JobId(\"foo\", \"2\", ...
{ "body": "@Test\n public void testRollingUpdateJson() throws Exception {\n when(client.rollingUpdate(anyString(), any(JobId.class), any(RolloutOptions.class)))\n .thenReturn(immediateFuture(new RollingUpdateResponse(RollingUpdateResponse.Status.OK)));\n\n when(client.deploymentGroupStatus(GROUP_NAME))....
{ "fields": [ { "declarator": "POLL_INTERVAL_MILLIS = 1000", "modifier": "private static final", "original_string": "private static final long POLL_INTERVAL_MILLIS = 1000;", "type": "long", "var_name": "POLL_INTERVAL_MILLIS" }, { "declarator": "sleepFunction", "mo...
{ "body": "@Override\n protected int runWithJob(final Namespace options, final HeliosClient client,\n final PrintStream out, final boolean json, final Job job,\n final BufferedReader stdin)\n throws ExecutionException, InterruptedException, IOException {\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_238
{ "fields": [ { "declarator": "hosts = ImmutableMap.of(\n \"foo-a1\", ImmutableMap.of(\"role\", \"foo\"),\n \"foo-a2\", ImmutableMap.of(\"role\", \"foo\", \"special\", \"yes\"),\n \"bar-a1\", ImmutableMap.of(\"role\", \"bar\", \"pool\", \"a\"),\n \"bar-b1\", ImmutableMap.of(\"role\", \"b...
{ "body": "@Test\n public void testDeploymentGroupWithNoSelectors() {\n final DeploymentGroup deploymentGroup = group();\n assertThat(matcher.getMatchingHosts(deploymentGroup), empty());\n }", "class_method_signature": "HostMatcherTest.testDeploymentGroupWithNoSelectors()", "constructor": false, "full_s...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(HostMatcher.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(HostMatcher.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "public List<String> getMatchingHosts(final DeploymentGroup deploymentGroup) {\n final List<HostSelector> selectors = deploymentGroup.getHostSelectors();\n if (selectors == null || selectors.isEmpty()) {\n log.error(\"skipping deployment group with no host selectors: \" + deploymentGroup.getName(...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_107
{ "fields": [ { "declarator": "GROUP_NAME = \"my_group\"", "modifier": "private static final", "original_string": "private static final String GROUP_NAME = \"my_group\";", "type": "String", "var_name": "GROUP_NAME" }, { "declarator": "JOB_ID = new JobId(\"foo\", \"2\", ...
{ "body": "@Test\n public void testRollingUpdateAsync() throws Exception {\n when(client.rollingUpdate(anyString(), any(JobId.class), any(RolloutOptions.class)))\n .thenReturn(immediateFuture(new RollingUpdateResponse(RollingUpdateResponse.Status.OK)));\n\n when(options.getBoolean(\"async\")).thenReturn...
{ "fields": [ { "declarator": "POLL_INTERVAL_MILLIS = 1000", "modifier": "private static final", "original_string": "private static final long POLL_INTERVAL_MILLIS = 1000;", "type": "long", "var_name": "POLL_INTERVAL_MILLIS" }, { "declarator": "sleepFunction", "mo...
{ "body": "@Override\n protected int runWithJob(final Namespace options, final HeliosClient client,\n final PrintStream out, final boolean json, final Job job,\n final BufferedReader stdin)\n throws ExecutionException, InterruptedException, IOException {\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_150
{ "fields": [], "file": "helios-tools/src/test/java/com/spotify/helios/cli/OutputTest.java", "identifier": "OutputTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testHumanDuration() throws Exception {\n assertThat(humanDuration(standardSeconds(0)), is(\"0 seconds\"));\n\n assertThat(humanDuration(standardSeconds(1)), is(\"1 second\"));\n assertThat(humanDuration(standardSeconds(2)), is(\"2 seconds\"));\n assertThat(humanDuration(sta...
{ "fields": [], "file": "helios-tools/src/main/java/com/spotify/helios/cli/Output.java", "identifier": "Output", "interfaces": "", "methods": [ { "class_method_signature": "Output.humanDuration(final long millis)", "constructor": false, "full_signature": "public static String humanDurati...
{ "body": "public static String humanDuration(final long millis) {\n return humanDuration(Duration.millis(millis));\n }", "class_method_signature": "Output.humanDuration(final long millis)", "constructor": false, "full_signature": "public static String humanDuration(final long millis)", "identifier": "hum...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_48
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" ...
{ "body": "@Test\n public void testJsonDeserializationFromPartial() throws Exception {\n final PortMapping pm = portMappingFromResource(\"portmapping-partial.json\");\n assertThat(pm, equalTo(PortMapping.builder()\n .externalPort(123)\n .internalPort(456)\n .protocol(TCP)\n .build()...
{ "fields": [ { "declarator": "TCP = \"tcp\"", "modifier": "public static final", "original_string": "public static final String TCP = \"tcp\";", "type": "String", "var_name": "TCP" }, { "declarator": "UDP = \"udp\"", "modifier": "public static final", "orig...
{ "body": "public static Builder builder() {\n return new Builder().protocol(TCP);\n }", "class_method_signature": "PortMapping.builder()", "constructor": false, "full_signature": "public static Builder builder()", "identifier": "builder", "invocations": [ "protocol" ], "modifiers": "public stat...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_33
{ "fields": [], "file": "helios-client/src/test/java/com/spotify/helios/common/descriptors/JobTest.java", "identifier": "JobTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNormalizedExcludesEmptyStrings() throws Exception {\n final Job j = Job.newBuilder().setName(\"x\").setImage(\"x\").setVersion(\"x\")\n .setRegistrationDomain(\"\").build();\n assertFalse(Json.asNormalizedString(j).contains(\"registrationDomain\"));\n }", "class_met...
{ "fields": [ { "declarator": "EMPTY_ENV = emptyMap()", "modifier": "public static final", "original_string": "public static final Map<String, String> EMPTY_ENV = emptyMap();", "type": "Map<String, String>", "var_name": "EMPTY_ENV" }, { "declarator": "EMPTY_RESOURCES = ...
{ "body": "public static Builder newBuilder() {\n return new Builder();\n }", "class_method_signature": "Job.newBuilder()", "constructor": false, "full_signature": "public static Builder newBuilder()", "identifier": "newBuilder", "invocations": [], "modifiers": "public static", "parameters": "()", ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_202
{ "fields": [ { "declarator": "ffwd = mock(FastForward.class)", "modifier": "private final", "original_string": "private final FastForward ffwd = mock(FastForward.class);", "type": "FastForward", "var_name": "ffwd" }, { "declarator": "metricRegistry = new MetricRegistry...
{ "body": "@Test\n public void testMeter() throws Exception {\n metricRegistry.meter(\"the-meter\");\n\n reporter.reportOnce();\n\n verifyMeterStats(\"the-meter\", \"meter\");\n }", "class_method_signature": "FastForwardReporterTest.testMeter()", "constructor": false, "full_signature": "@Test public ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(FastForwardReporter.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(FastForwardReporter.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@VisibleForTesting\n void reportOnce() {\n\n // resolve the additional attributes once per report\n additionalAttributes = additionalAttributesSupplier.get();\n if (additionalAttributes == null) {\n additionalAttributes = Collections.emptyMap();\n }\n\n metricRegistry.getGauges().forEa...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_193
{ "fields": [ { "declarator": "PATH = \"/foos\"", "modifier": "private static final", "original_string": "private static final String PATH = \"/foos\";", "type": "String", "var_name": "PATH" }, { "declarator": "zk", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void verifyNodesAreRetainedWhenZkGoesDown() throws Exception {\n // Create two nodes\n final String foo1 = \"/foos/foo1\";\n final String foo2 = \"/foos/foo2\";\n final Set<String> paths = ImmutableSet.of(foo1, foo2);\n for (final String path : paths) {\n ensure(path, ne...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PersistentPathChildrenCache.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PersistentPathChildrenCache.class);", "type": "Logger", "var_name": "log...
{ "body": "public Map<String, T> getNodes() {\n return snapshot.get();\n }", "class_method_signature": "PersistentPathChildrenCache.getNodes()", "constructor": false, "full_signature": "public Map<String, T> getNodes()", "identifier": "getNodes", "invocations": [ "get" ], "modifiers": "public", ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_64
{ "fields": [ { "declarator": "resolver = mock(Resolver.class)", "modifier": "private final", "original_string": "private final Resolver resolver = mock(Resolver.class);", "type": "Resolver", "var_name": "resolver" } ], "file": "helios-client/src/test/java/com/spotify/helios/...
{ "body": "@Test\n public void testGet() {\n final URI uri = URI.create(\"https://foo.bar.com\");\n when(resolver.resolve(\"foo\", \"bar\")).thenReturn(ImmutableList.of(uri));\n final PeriodicResolver sut = PeriodicResolver.create(\"foo\", \"bar\", resolver,\n Executors.newSingleThreadScheduledExecut...
{ "fields": [ { "declarator": "endpoints", "modifier": "private", "original_string": "private List<URI> endpoints;", "type": "List<URI>", "var_name": "endpoints" } ], "file": "helios-client/src/main/java/com/spotify/helios/common/PeriodicResolver.java", "identifier": "Perio...
{ "body": "@Override\n public List<URI> get() {\n return endpoints;\n }", "class_method_signature": "PeriodicResolver.get()", "constructor": false, "full_signature": "@Override public List<URI> get()", "identifier": "get", "invocations": [], "modifiers": "@Override public", "parameters": "()", "r...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_185
{ "fields": [ { "declarator": "MANUAL_DEPLOYMENT_GROUP = DeploymentGroup.newBuilder()\n .setName(\"my_group\")\n .setRolloutOptions(RolloutOptions.getDefault())\n .setRollingUpdateReason(MANUAL)\n .build()", "modifier": "private static final", "original_string": "private stat...
{ "body": "@Test\n public void testNextTaskWithOps() {\n final DeploymentGroupTasks deploymentGroupTasks = DeploymentGroupTasks.newBuilder()\n .setTaskIndex(0)\n .setRolloutTasks(Lists.newArrayList(\n RolloutTask.of(RolloutTask.Action.UNDEPLOY_OLD_JOBS, \"host1\"),\n RolloutTas...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(RollingUpdateOpFactory.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(RollingUpdateOpFactory.class);", "type": "Logger", "var_name": "log" }, ...
{ "body": "public RollingUpdateOp nextTask() {\n return nextTask(Collections.<ZooKeeperOperation>emptyList());\n }", "class_method_signature": "RollingUpdateOpFactory.nextTask()", "constructor": false, "full_signature": "public RollingUpdateOp nextTask()", "identifier": "nextTask", "invocations": [ ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_72
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "decl...
{ "body": "@Test\n public void testFailureOnTimeout() throws Exception {\n when(delegate.request(any(URI.class), anyString(), any(byte[].class),\n Matchers.<Map<String, List<String>>>any()))\n .thenReturn(Futures.<Response>immediateFailedFuture(new IOException()))\n .thenReturn(Futures.<Respo...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(RetryingRequestDispatcher.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(RetryingRequestDispatcher.class);", "type": "Logger", "var_name": "log" ...
{ "body": "@Override\n public ListenableFuture<Response> request(final URI uri,\n final String method,\n final byte[] entityBytes,\n final Map<String, List<String>> headers) {\n final l...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_25
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testExpiry() {\n // make a date that's 24 hours behind\n final java.util.Date d = new java.util.Date(System.currentTimeMillis() - (86400 * 1000));\n final Job j = Job.newBuilder().setName(\"foo\").setVersion(\"1\").setImage(\"foobar\")\n .setExpires(d).build();\n ass...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "public Set<String> validate(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n\n errors.addAll(validateJobId(job));\n errors.addAll(validateJobImage(job.getImage()));\n errors.addAll(validateJobHostName(job.getHostname()));\n\n // Check that there's not external port collisio...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_214
{ "fields": [ { "declarator": "ROLE_SELECTOR = HostSelector.parse(\"role=my_role\")", "modifier": "private static final", "original_string": "private static final HostSelector ROLE_SELECTOR = HostSelector.parse(\"role=my_role\");", "type": "HostSelector", "var_name": "ROLE_SELECTOR" ...
{ "body": "@Test\n public void testRollingUpdateDeploymentGroupDoesNotExist() throws Exception {\n doThrow(new DeploymentGroupDoesNotExistException(\"\")).when(model).rollingUpdate(\n any(DeploymentGroup.class), any(JobId.class), any(RolloutOptions.class));\n\n final Response response = resource.rolling...
{ "fields": [ { "declarator": "model", "modifier": "private final", "original_string": "private final MasterModel model;", "type": "MasterModel", "var_name": "model" }, { "declarator": "CREATED_RESPONSE =\n new CreateDeploymentGroupResponse(CreateDeploymentGroupRes...
{ "body": "@POST\n @Path(\"/{name}/rolling-update\")\n @Produces(APPLICATION_JSON)\n @Timed\n @ExceptionMetered\n public Response rollingUpdate(@PathParam(\"name\") @Valid final String name,\n @Valid final RollingUpdateRequest args) {\n try {\n final DeploymentGroup deploym...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_136
{ "fields": [ { "declarator": "JOB_ID = new JobId(\"foo-job\", \"0.1.0\")", "modifier": "private static final", "original_string": "private static final JobId JOB_ID = new JobId(\"foo-job\", \"0.1.0\");", "type": "JobId", "var_name": "JOB_ID" }, { "declarator": "GROUP_N...
{ "body": "@Test\n public void testDeploymentGroupStatusJson() throws Exception {\n final List<DeploymentGroupStatusResponse.HostStatus> hostStatuses = Lists.newArrayList();\n hostStatuses.add(new DeploymentGroupStatusResponse.HostStatus(\n \"host1\", JOB_ID, TaskStatus.State.RUNNING));\n hostStatuse...
{ "fields": [ { "declarator": "nameArg", "modifier": "private final", "original_string": "private final Argument nameArg;", "type": "Argument", "var_name": "nameArg" }, { "declarator": "fullArg", "modifier": "private final", "original_string": "private final...
{ "body": "@Override\n int run(final Namespace options, final HeliosClient client, final PrintStream out,\n final boolean json, final BufferedReader stdin)\n throws ExecutionException, InterruptedException {\n final String name = options.getString(nameArg.getDest());\n final boolean full = option...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_161
{ "fields": [ { "declarator": "executor = Executors.newCachedThreadPool()", "modifier": "private final", "original_string": "private final ExecutorService executor = Executors.newCachedThreadPool();", "type": "ExecutorService", "var_name": "executor" }, { "declarator": ...
{ "body": "@Test\n public void verifySupervisorHandlesUndeployingOfNotRunningContainerWithGracePeriod()\n throws Exception {\n\n final int gracePeriod = 5;\n final Job job = JOB.toBuilder()\n .setGracePeriod(gracePeriod)\n .build();\n\n final Supervisor sut = createSupervisor(job);\n\n ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Supervisor.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(Supervisor.class);", "type": "Logger", "var_name": "log" }, { "declarator":...
{ "body": "@SuppressWarnings(\"MissingSwitchDefault\")\n public void setGoal(final Goal goal) {\n if (this.goal == goal) {\n return;\n }\n log.debug(\"Supervisor {}: setting goal: {}\", job.getId(), goal);\n this.goal = goal;\n statusUpdater.setGoal(goal);\n switch (goal) {\n case START:\...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_79
{ "fields": [ { "declarator": "USER = \"user\"", "modifier": "private static final", "original_string": "private static final String USER = \"user\";", "type": "String", "var_name": "USER" }, { "declarator": "CERTIFICATE_PATH = Paths.get(getResource(\"UIDCACert.pem\").g...
{ "body": "@Test\n public void testOneIdentity_ResponseIsOk() throws Exception {\n\n final AgentProxy proxy = mock(AgentProxy.class);\n final Identity identity = mockIdentity();\n\n final AuthenticatingHttpConnector authConnector =\n createAuthenticatingConnector(Optional.of(proxy), ImmutableList.of(...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(AuthenticatingHttpConnector.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(AuthenticatingHttpConnector.class);", "type": "Logger", "var_name": "log...
{ "body": "@Override\n public HttpURLConnection connect(final URI uri, final String method, final byte[] entity,\n final Map<String, List<String>> headers) throws HeliosException {\n final Endpoint endpoint = endpointIterator.next();\n\n // convert the URI whose hostname porti...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_96
{ "fields": [ { "declarator": "temporaryFolder = new TemporaryFolder()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final TemporaryFolder temporaryFolder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "temporaryFolder" }, { ...
{ "body": "@Test\n public void testInsecureHttpsDisabledByDefault() throws Exception {\n final CliParser parser = new CliParser(toArray(singleEndpointArgs));\n\n assertFalse(\"GlobalArg 'insecure' should default to false\",\n parser.getNamespace().getBoolean(\"insecure\"));\n }", "class_method_signat...
{ "fields": [ { "declarator": "NAME_AND_VERSION = \"Spotify Helios CLI \" + Version.POM_VERSION", "modifier": "private static final", "original_string": "private static final String NAME_AND_VERSION = \"Spotify Helios CLI \" + Version.POM_VERSION;", "type": "String", "var_name": "NAM...
{ "body": "public Namespace getNamespace() {\n return options;\n }", "class_method_signature": "CliParser.getNamespace()", "constructor": false, "full_signature": "public Namespace getNamespace()", "identifier": "getNamespace", "invocations": [], "modifiers": "public", "parameters": "()", "return"...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_177
{ "fields": [ { "declarator": "TIMESTAMP = 8675309L", "modifier": "private static final", "original_string": "private static final long TIMESTAMP = 8675309L;", "type": "long", "var_name": "TIMESTAMP" }, { "declarator": "HOSTNAME = \"hostname\"", "modifier": "priva...
{ "body": "@Test\n public void testWriteWithZooKeeperDown() throws Exception {\n zk.stop();\n writer.saveHistoryItem(TASK_STATUS, TIMESTAMP);\n zk.start();\n final TaskStatusEvent historyItem = Iterables.getOnlyElement(awaitHistoryItems());\n assertEquals(JOB_ID, historyItem.getStatus().getJob().getId...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(TaskHistoryWriter.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(TaskHistoryWriter.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "public void saveHistoryItem(final TaskStatus status) throws InterruptedException {\n saveHistoryItem(status, System.currentTimeMillis());\n }", "class_method_signature": "TaskHistoryWriter.saveHistoryItem(final TaskStatus status)", "constructor": false, "full_signature": "public void saveHistoryI...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_198
{ "fields": [ { "declarator": "temporaryFolder = new TemporaryFolder()", "modifier": "@Rule public final", "original_string": "@Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "temporaryFolder" } ], "file": "...
{ "body": "@Test\n public void test() throws Exception {\n final File f = temporaryFolder.newFile();\n final String absolutePath = f.getAbsolutePath();\n final FileOutputStream fos = new FileOutputStream(absolutePath);\n final ByteBuffer bytes = Charsets.UTF_8.encode(\n \"nameserver 127.0.0.1\\nse...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ResolverConfReader.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ResolverConfReader.class);", "type": "Logger", "var_name": "log" } ], "fi...
{ "body": "public static String getDomainFromResolverConf(final String file) {\n try (final InputStream in = new FileInputStream(file)) {\n final InputStreamReader isr = new InputStreamReader(in);\n try (final BufferedReader br = new BufferedReader(isr)) {\n String line;\n while ((line = br...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_80
{ "fields": [ { "declarator": "USER = \"user\"", "modifier": "private static final", "original_string": "private static final String USER = \"user\";", "type": "String", "var_name": "USER" }, { "declarator": "CERTIFICATE_PATH = Paths.get(getResource(\"UIDCACert.pem\").g...
{ "body": "@Test\n public void testOneIdentity_ResponseIsUnauthorized() throws Exception {\n\n final AgentProxy proxy = mock(AgentProxy.class);\n final Identity identity = mockIdentity();\n\n final AuthenticatingHttpConnector authConnector =\n createAuthenticatingConnector(Optional.of(proxy), Immutab...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(AuthenticatingHttpConnector.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(AuthenticatingHttpConnector.class);", "type": "Logger", "var_name": "log...
{ "body": "@Override\n public HttpURLConnection connect(final URI uri, final String method, final byte[] entity,\n final Map<String, List<String>> headers) throws HeliosException {\n final Endpoint endpoint = endpointIterator.next();\n\n // convert the URI whose hostname porti...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_120
{ "fields": [ { "declarator": "GROUP_NAME = \"my_group\"", "modifier": "private static final", "original_string": "private static final String GROUP_NAME = \"my_group\";", "type": "String", "var_name": "GROUP_NAME" }, { "declarator": "JOB_ID = new JobId(\"foo\", \"2\", ...
{ "body": "@Test\n public void testJobWithNoOptions() throws Exception {\n final JobId jobId = new JobId(\"bar\", \"2\", \"1212121212121212121\");\n final Job job = Job.newBuilder()\n .setName(jobId.getName())\n .setVersion(jobId.getVersion())\n .setHash(jobId.getHash())\n .build();...
{ "fields": [ { "declarator": "POLL_INTERVAL_MILLIS = 1000", "modifier": "private static final", "original_string": "private static final long POLL_INTERVAL_MILLIS = 1000;", "type": "long", "var_name": "POLL_INTERVAL_MILLIS" }, { "declarator": "sleepFunction", "mo...
{ "body": "@Override\n protected int runWithJob(final Namespace options, final HeliosClient client,\n final PrintStream out, final boolean json, final Job job,\n final BufferedReader stdin)\n throws ExecutionException, InterruptedException, IOException {\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_38
{ "fields": [], "file": "helios-client/src/test/java/com/spotify/helios/common/descriptors/HostSelectorTest.java", "identifier": "HostSelectorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseEquals() {\n assertEquals(new HostSelector(\"A\", HostSelector.Operator.EQUALS, \"B\"),\n HostSelector.parse(\"A=B\"));\n assertEquals(new HostSelector(\"A\", HostSelector.Operator.EQUALS, \"B\"),\n HostSelector.parse(\"A = B\"));\n assertEquals(new Host...
{ "fields": [ { "declarator": "IN_BIPREDICATE =\n new BiPredicate<String, Object>() {\n @Override\n public boolean test(final String a, final Object b) {\n @SuppressWarnings(\"unchecked\") final Iterable<String> iterable = (Iterable<String>) b;\n return Iterables.contain...
{ "body": "public static HostSelector parse(final String str) {\n checkNotNull(str);\n\n final Matcher matcher = PATTERN.matcher(str);\n if (matcher.matches()) {\n final String label = matcher.group(1);\n final String opStr = matcher.group(2);\n final String value = matcher.group(3);\n\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_209
{ "fields": [ { "declarator": "ROLE_SELECTOR = HostSelector.parse(\"role=my_role\")", "modifier": "private static final", "original_string": "private static final HostSelector ROLE_SELECTOR = HostSelector.parse(\"role=my_role\");", "type": "HostSelector", "var_name": "ROLE_SELECTOR" ...
{ "body": "@Test\n public void testGetNonExistingDeploymentGroup() throws Exception {\n when(model.getDeploymentGroup(anyString())).thenThrow(\n new DeploymentGroupDoesNotExistException(\"\"));\n\n final Response response = resource.getDeploymentGroup(\"foobar\");\n assertEquals(Response.Status.NOT_F...
{ "fields": [ { "declarator": "model", "modifier": "private final", "original_string": "private final MasterModel model;", "type": "MasterModel", "var_name": "model" }, { "declarator": "CREATED_RESPONSE =\n new CreateDeploymentGroupResponse(CreateDeploymentGroupRes...
{ "body": "@GET\n @Path(\"/{name}\")\n @Produces(APPLICATION_JSON)\n @Timed\n @ExceptionMetered\n public Response getDeploymentGroup(@PathParam(\"name\") final String name) {\n try {\n return Response.ok(model.getDeploymentGroup(name)).build();\n } catch (final DeploymentGroupDoesNotExistException e) ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_43
{ "fields": [], "file": "helios-client/src/test/java/com/spotify/helios/common/descriptors/HostSelectorTest.java", "identifier": "HostSelectorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testInOperatorSerialization() throws Exception {\n final HostSelector orig = HostSelector.parse(\"a in (foo,bar)\");\n final HostSelector parsed = Json.read(Json.asString(orig), HostSelector.class);\n assertEquals(orig, parsed);\n }", "class_method_signature": "HostSelector...
{ "fields": [ { "declarator": "IN_BIPREDICATE =\n new BiPredicate<String, Object>() {\n @Override\n public boolean test(final String a, final Object b) {\n @SuppressWarnings(\"unchecked\") final Iterable<String> iterable = (Iterable<String>) b;\n return Iterables.contain...
{ "body": "public static HostSelector parse(final String str) {\n checkNotNull(str);\n\n final Matcher matcher = PATTERN.matcher(str);\n if (matcher.matches()) {\n final String label = matcher.group(1);\n final String opStr = matcher.group(2);\n final String value = matcher.group(3);\n\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_225
{ "fields": [ { "declarator": "NO_SELECTOR_ARG = Collections.emptyList()", "modifier": "private static final", "original_string": "private static final List<String> NO_SELECTOR_ARG = Collections.emptyList();", "type": "List<String>", "var_name": "NO_SELECTOR_ARG" }, { "...
{ "body": "@Test\n public void listHostsSelectorFilterMissingStatus() {\n when(model.getHostLabels(hosts.get(0))).thenReturn(emptyMap());\n assertThat(resource.list(null, ImmutableList.of(\"site=foo\")),\n equalTo(hosts.subList(1, hosts.size())));\n\n assertThat(resource.list(null, ImmutableList.of(\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(HostsResource.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(HostsResource.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "@GET\n @Produces(APPLICATION_JSON)\n @Timed\n @ExceptionMetered\n public List<String> list(@QueryParam(\"namePattern\") final String namePattern,\n @QueryParam(\"selector\") final List<String> hostSelectors) {\n\n List<String> hosts = namePattern == null ? model.listHosts()...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_14
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testIdMismatchFails() throws Exception {\n final Job job = new Job(JobId.fromString(\"foo:bar:badf00d\"),\n \"bar\", EMPTY_HOSTNAME, EMPTY_CREATED, EMPTY_COMMAND, EMPTY_ENV,\n EMPTY_RESOURCES, EMPTY_PORTS,\n EMPTY_REGISTRATION, EMPTY_GRACE_PERIOD, EMPTY_VOLUMES,...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "public Set<String> validate(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n\n errors.addAll(validateJobId(job));\n errors.addAll(validateJobImage(job.getImage()));\n errors.addAll(validateJobHostName(job.getHostname()));\n\n // Check that there's not external port collisio...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_233
{ "fields": [], "file": "helios-services/src/test/java/com/spotify/helios/master/metrics/TotalHealthCheckGaugeTest.java", "identifier": "TotalHealthCheckGaugeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAllHealthy() {\n final HealthCheckRegistry registry = new HealthCheckRegistry();\n registry.register(\"pass1\", stubHealthCheck(HealthCheck.Result.healthy()));\n registry.register(\"pass2\", stubHealthCheck(HealthCheck.Result.healthy()));\n\n final TotalHealthCheckGauge...
{ "fields": [ { "declarator": "registry", "modifier": "private final", "original_string": "private final HealthCheckRegistry registry;", "type": "HealthCheckRegistry", "var_name": "registry" } ], "file": "helios-services/src/main/java/com/spotify/helios/master/metrics/TotalHe...
{ "body": "@Override\n public Integer getValue() {\n final SortedMap<String, HealthCheck.Result> results = registry.runHealthChecks();\n return results.values().stream().allMatch(HealthCheck.Result::isHealthy) ? 1 : 0;\n }", "class_method_signature": "TotalHealthCheckGauge.getValue()", "constructor": fals...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_7
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testValidNamesPass() {\n final Job.Builder b = Job.newBuilder().setVersion(\"1\").setImage(\"bar\");\n assertThat(validator.validate(b.setName(\"foo\").build()), is(empty()));\n assertThat(validator.validate(b.setName(\"17\").build()), is(empty()));\n assertThat(validator.v...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "public Set<String> validate(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n\n errors.addAll(validateJobId(job));\n errors.addAll(validateJobImage(job.getImage()));\n errors.addAll(validateJobHostName(job.getHostname()));\n\n // Check that there's not external port collisio...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_55
{ "fields": [], "file": "helios-client/src/test/java/com/spotify/helios/common/descriptors/HealthCheckTest.java", "identifier": "HealthCheckTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testHttpWithoutPort() {\n HealthCheck.newHttpHealthCheck().setPath(\"/healthcheck\").build();\n }", "class_method_signature": "HealthCheckTest.testHttpWithoutPort()", "constructor": false, "full_signature": "@Test(expected = IllegalA...
{ "fields": [ { "declarator": "EXEC = \"exec\"", "modifier": "public static final", "original_string": "public static final String EXEC = \"exec\";", "type": "String", "var_name": "EXEC" }, { "declarator": "HTTP = \"http\"", "modifier": "public static final", ...
{ "body": "public static HttpHealthCheck.Builder newHttpHealthCheck() {\n return HttpHealthCheck.newBuilder();\n }", "class_method_signature": "HealthCheck.newHttpHealthCheck()", "constructor": false, "full_signature": "public static HttpHealthCheck.Builder newHttpHealthCheck()", "identifier": "newHttpHea...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_22
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testInvalidHealthCheckFail() {\n final Job jobWithNoPorts = Job.newBuilder()\n .setName(\"foo\")\n .setVersion(\"1\")\n .setImage(\"foobar\")\n .setHealthCheck(HEALTH_CHECK)\n .build();\n\n assertEquals(1, validator.validate(jobWithNoPorts).size...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "public Set<String> validate(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n\n errors.addAll(validateJobId(job));\n errors.addAll(validateJobImage(job.getImage()));\n errors.addAll(validateJobHostName(job.getHostname()));\n\n // Check that there's not external port collisio...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_213
{ "fields": [ { "declarator": "ROLE_SELECTOR = HostSelector.parse(\"role=my_role\")", "modifier": "private static final", "original_string": "private static final HostSelector ROLE_SELECTOR = HostSelector.parse(\"role=my_role\");", "type": "HostSelector", "var_name": "ROLE_SELECTOR" ...
{ "body": "@Test\n public void testRemoveNonExistingDeploymentGroup() throws Exception {\n doThrow(new DeploymentGroupDoesNotExistException(\"\")).when(model)\n .removeDeploymentGroup(anyString());\n\n final Response response = resource.removeDeploymentGroup(\"foo\");\n assertEquals(Response.Status.O...
{ "fields": [ { "declarator": "model", "modifier": "private final", "original_string": "private final MasterModel model;", "type": "MasterModel", "var_name": "model" }, { "declarator": "CREATED_RESPONSE =\n new CreateDeploymentGroupResponse(CreateDeploymentGroupRes...
{ "body": "@DELETE\n @Path(\"/{name}\")\n @Produces(APPLICATION_JSON)\n @Timed\n @ExceptionMetered\n public Response removeDeploymentGroup(@PathParam(\"name\") @Valid final String name) {\n try {\n model.removeDeploymentGroup(name);\n return Response.ok(new RemoveDeploymentGroupResponse(\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_75
{ "fields": [ { "declarator": "USER = \"user\"", "modifier": "private static final", "original_string": "private static final String USER = \"user\";", "type": "String", "var_name": "USER" }, { "declarator": "CERTIFICATE_PATH = Paths.get(getResource(\"UIDCACert.pem\").g...
{ "body": "@Test\n public void testNoIdentities_ResponseIsOk() throws Exception {\n final AuthenticatingHttpConnector authConnector = createAuthenticatingConnector(\n Optional.<AgentProxy>absent(),\n ImmutableList.<Identity>of());\n\n final String path = \"/foo/bar\";\n\n final HttpsURLConnect...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(AuthenticatingHttpConnector.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(AuthenticatingHttpConnector.class);", "type": "Logger", "var_name": "log...
{ "body": "@Override\n public HttpURLConnection connect(final URI uri, final String method, final byte[] entity,\n final Map<String, List<String>> headers) throws HeliosException {\n final Endpoint endpoint = endpointIterator.next();\n\n // convert the URI whose hostname porti...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_182
{ "fields": [ { "declarator": "MANUAL_DEPLOYMENT_GROUP = DeploymentGroup.newBuilder()\n .setName(\"my_group\")\n .setRolloutOptions(RolloutOptions.getDefault())\n .setRollingUpdateReason(MANUAL)\n .build()", "modifier": "private static final", "original_string": "private stat...
{ "body": "@Test\n public void testStartManualWithHosts() throws Exception {\n // Create a DeploymentGroupTasks object with some rolloutTasks.\n final ArrayList<RolloutTask> rolloutTasks = Lists.newArrayList(\n RolloutTask.of(RolloutTask.Action.UNDEPLOY_OLD_JOBS, \"host1\"),\n RolloutTask.of(Roll...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(RollingUpdateOpFactory.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(RollingUpdateOpFactory.class);", "type": "Logger", "var_name": "log" }, ...
{ "body": "public RollingUpdateOp start(final DeploymentGroup deploymentGroup,\n final ZooKeeperClient client) throws KeeperException {\n client.ensurePath(Paths.statusDeploymentGroupTasks());\n\n final List<ZooKeeperOperation> ops = Lists.newArrayList();\n final List<Map<String...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_63
{ "fields": [ { "declarator": "JOB = Job.newBuilder()\n .setCommand(ImmutableList.of(\"BOGUS\"))\n .setImage(\"IMAGE\")\n .setName(\"NAME\")\n .setVersion(\"VERSION\")\n .build()", "modifier": "private static final", "original_string": "private static final Job JOB = Job...
{ "body": "@Test\n public void testSerializationOfEnvironment() throws Exception {\n\n final byte[] bytes = Json.asBytes(STATUS);\n\n final TaskStatus read = Json.read(bytes, TaskStatus.class);\n assertEquals(1, read.getEnv().size());\n assertEquals(\"VALUE\", read.getEnv().get(\"VAR\"));\n }", "class...
{ "fields": [ { "declarator": "EMPTY_PORTS = emptyMap()", "modifier": "private static final", "original_string": "private static final Map<String, PortMapping> EMPTY_PORTS = emptyMap();", "type": "Map<String, PortMapping>", "var_name": "EMPTY_PORTS" }, { "declarator": "...
{ "body": "public Map<String, String> getEnv() {\n return env;\n }", "class_method_signature": "TaskStatus.getEnv()", "constructor": false, "full_signature": "public Map<String, String> getEnv()", "identifier": "getEnv", "invocations": [], "modifiers": "public", "parameters": "()", "return": "Map<...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_194
{ "fields": [ { "declarator": "PATH = \"/foos\"", "modifier": "private static final", "original_string": "private static final String PATH = \"/foos\";", "type": "String", "var_name": "PATH" }, { "declarator": "zk", "modifier": "private", "original_string": ...
{ "body": "@Test\n public void verifyNodesRemovedWhilePathChildrenCacheIsDownAreDetected() throws Exception {\n // Create two nodes\n final String foo1 = \"/foos/foo1\";\n final String foo2 = \"/foos/foo2\";\n final Set<String> paths = ImmutableSet.of(foo1, foo2);\n for (final String path : paths) {\n...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PersistentPathChildrenCache.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PersistentPathChildrenCache.class);", "type": "Logger", "var_name": "log...
{ "body": "public Map<String, T> getNodes() {\n return snapshot.get();\n }", "class_method_signature": "PersistentPathChildrenCache.getNodes()", "constructor": false, "full_signature": "public Map<String, T> getNodes()", "identifier": "getNodes", "invocations": [ "get" ], "modifiers": "public", ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_34
{ "fields": [], "file": "helios-client/src/test/java/com/spotify/helios/common/descriptors/JobTest.java", "identifier": "JobTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void verifyCanParseJobWithUnknownFields() throws Exception {\n final Job job = Job.newBuilder()\n .setCommand(asList(\"foo\", \"bar\"))\n .setImage(\"foobar:4711\")\n .setName(\"foozbarz\")\n .setVersion(\"17\")\n .build();\n\n final String jobJson =...
{ "fields": [ { "declarator": "EMPTY_ENV = emptyMap()", "modifier": "public static final", "original_string": "public static final Map<String, String> EMPTY_ENV = emptyMap();", "type": "Map<String, String>", "var_name": "EMPTY_ENV" }, { "declarator": "EMPTY_RESOURCES = ...
{ "body": "public static Builder newBuilder() {\n return new Builder();\n }", "class_method_signature": "Job.newBuilder()", "constructor": false, "full_signature": "public static Builder newBuilder()", "identifier": "newBuilder", "invocations": [], "modifiers": "public static", "parameters": "()", ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_205
{ "fields": [ { "declarator": "AGENT_USER = \"agent-user\"", "modifier": "private static final", "original_string": "private static final String AGENT_USER = \"agent-user\";", "type": "String", "var_name": "AGENT_USER" }, { "declarator": "AGENT_PASSWORD = \"agent-pass\"...
{ "body": "@Test\n public void testInitializeAcl() throws Exception {\n // setup the initial helios tree\n final ZooKeeperClient zkClient = new DefaultZooKeeperClient(zk.curatorWithSuperAuth());\n zkClient.ensurePath(Paths.configId(CLUSTER_ID));\n new MasterZooKeeperRegistrar(\"helios-master\").tryToRegi...
{ "fields": [], "file": "helios-services/src/main/java/com/spotify/helios/servicescommon/ZooKeeperAclInitializer.java", "identifier": "ZooKeeperAclInitializer", "interfaces": "", "methods": [ { "class_method_signature": "ZooKeeperAclInitializer.main(final String[] args)", "constructor": false,...
{ "body": "static void initializeAcl(final String zooKeeperConnectionString,\n final String zooKeeperClusterId,\n final String masterUser,\n final String masterPassword,\n final String agentUser,\n ...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_157
{ "fields": [ { "declarator": "client = mock(ZooKeeperClient.class)", "modifier": "private final", "original_string": "private final ZooKeeperClient client = mock(ZooKeeperClient.class);", "type": "ZooKeeperClient", "var_name": "client" }, { "declarator": "agentName = \...
{ "body": "@Test\n public void alreadyRegistered_SameHostId() throws Exception {\n final boolean success = registrar.tryToRegister(client);\n assertTrue(success);\n\n // no need to re-write the id path\n verify(client, never()).createAndSetData(idPath, hostId.getBytes());\n }", "class_method_signature...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(AgentZooKeeperRegistrar.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(AgentZooKeeperRegistrar.class);", "type": "Logger", "var_name": "log" },...
{ "body": "@Override\n public boolean tryToRegister(ZooKeeperClient client)\n throws KeeperException, HostNotFoundException {\n final String idPath = Paths.configHostId(name);\n final String hostInfoPath = Paths.statusHostInfo(name);\n\n final Stat stat = client.exists(idPath);\n if (stat == null) {...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_229
{ "fields": [ { "declarator": "TIMEOUT_HOURS = 1000", "modifier": "private static final", "original_string": "private static final long TIMEOUT_HOURS = 1000;", "type": "long", "var_name": "TIMEOUT_HOURS" } ], "file": "helios-services/src/test/java/com/spotify/helios/master/re...
{ "body": "@Test\n public void testDeadAgentReaper() throws Exception {\n final MasterModel masterModel = mock(MasterModel.class);\n final Clock clock = mock(Clock.class);\n when(clock.now()).thenReturn(new Instant(HOURS.toMillis(2000)));\n\n final List<Datapoint> datapoints = Lists.newArrayList(\n ...
{ "fields": [ { "declarator": "PERMITS_PER_SECOND = 0.2", "modifier": "private static final", "original_string": "private static final double PERMITS_PER_SECOND = 0.2;", "type": "double", "var_name": "PERMITS_PER_SECOND" }, { "declarator": "SYSTEM_CLOCK = new SystemCloc...
{ "body": "public DeadAgentReaper(final MasterModel masterModel,\n final long timeoutHours) {\n this(masterModel, timeoutHours, SYSTEM_CLOCK, PERMITS_PER_SECOND, new Random().nextInt(DELAY));\n }", "class_method_signature": "DeadAgentReaper.DeadAgentReaper(final MasterModel masterModel,\...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_18
{ "fields": [ { "declarator": "HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1\").build()", "modifier": "private static final", "original_string": "private static final HealthCheck HEALTH_CHECK =\n HealthCheck.newHttpHealthCheck().setPath(\"/\").setPort(\"1...
{ "body": "@Test\n public void testInValidHostnamesFail() {\n final Job.Builder b = Job.newBuilder().setName(\"foo\").setVersion(\"1\").setImage(\"bar\");\n\n // 64 chars\n final String toolonghostname = Strings.repeat(\"hostname\", 8);\n assertEquals(newHashSet(\"Invalid hostname (\" + toolonghostname +...
{ "fields": [ { "declarator": "NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\")", "modifier": "private static final", "original_string": "private static final Pattern NAME_VERSION_PATTERN = Pattern.compile(\"[0-9a-zA-Z-_.]+\");", "type": "Pattern", "var_name": "NAME_VERSIO...
{ "body": "public Set<String> validate(final Job job) {\n final Set<String> errors = Sets.newHashSet();\n\n errors.addAll(validateJobId(job));\n errors.addAll(validateJobImage(job.getImage()));\n errors.addAll(validateJobHostName(job.getHostname()));\n\n // Check that there's not external port collisio...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...
20171642_100
{ "fields": [ { "declarator": "HOST = \"test-host\"", "modifier": "private static final", "original_string": "private static final String HOST = \"test-host\";", "type": "String", "var_name": "HOST" }, { "declarator": "options = mock(Namespace.class)", "modifier":...
{ "body": "@Test\n public void testNoId() throws Exception {\n when(options.getString(\"host\")).thenReturn(HOST);\n\n final int ret = command.run(options, client, out, false, null);\n\n assertThat(ret, equalTo(1));\n assertThat(baos.toString(), containsString(\"You must specify the hostname and id.\"));...
{ "fields": [ { "declarator": "hostArg", "modifier": "private final", "original_string": "private final Argument hostArg;", "type": "Argument", "var_name": "hostArg" }, { "declarator": "idArg", "modifier": "private final", "original_string": "private final A...
{ "body": "@Override\n int run(final Namespace options, final HeliosClient client, PrintStream out, final boolean json,\n final BufferedReader stdin)\n throws ExecutionException, InterruptedException {\n final String host = options.getString(hostArg.getDest());\n final String id = options.getStri...
{ "created": "5/26/2014 2:29:06 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20171642, "size": null, "stargazer_count": null, "stars": 2027, "updates": "2020-01-12T17:38:00+00:00", "url": "https://github.com/spotify/helios"...