id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
74169960_22 | {
"fields": [
{
"declarator": "env =\n EnvironmentDescription.builder()\n .clusterName(\"TestCluster\")\n .environmentName(\"TestEnvironment\")\n .environmentType(EnvironmentType.Daemon)\n .deploymentMethod(\"TestDeploymentMethod\")\n .taskDefinitionArn(\"te... | {
"body": "@Test\n public void noTasksToStopForDesiredTasks() {\n boolean stop = environment.isTaskStoppable(defaultTask().build());\n\n assertThat(stop).isFalse();\n }",
"class_method_signature": "DaemonEnvironmentTest.noTasksToStopForDesiredTasks()",
"constructor": false,
"full_signature": "@Test publ... | {
"fields": [
{
"declarator": "HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"))",
"modifier": "private static final",
"original_string": "private static final Set<String> HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"));",
"type":... | {
"body": "public boolean isTaskStoppable(Task t) {\n return t.getGroup().equals(environment.getEnvironmentName())\n && !t.getTaskDefinitionArn().equals(environment.getTaskDefinitionArn())\n && HEALTHY_STATES.contains(t.getStatus());\n }",
"class_method_signature": "DaemonEnvironment.isTaskStoppab... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_34 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "private static final",
"original_string": "private static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER_NAME = \"cluster1\"... | {
"body": "@Test\n public void invokesSchedulerCoreForDeploymentMethod() throws Exception {\n\n DescribeEnvironmentRequest describeEnvironmentRequest =\n DescribeEnvironmentRequest.builder().environmentId(environmentId).build();\n DescribeEnvironmentRevisionRequest describeEnvironmentRevisionRequest =\n... | {
"fields": [
{
"declarator": "data",
"modifier": "private final",
"original_string": "private final DataService data;",
"type": "DataService",
"var_name": "data"
},
{
"declarator": "ecs",
"modifier": "private final",
"original_string": "private final ECSAsy... | {
"body": "@SneakyThrows\n @Override\n public SchedulerOutput handleRequest(SchedulerInput input, Context context) {\n log.debug(\"Request: {}\", input);\n\n EnvironmentId environmentId = input.getEnvironmentId();\n\n Environment environment =\n data.describeEnvironment(\n DescribeEnv... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_63 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "private static final",
"original_string": "private static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER = \"mycluster\"",
... | {
"body": "@Test\n public void testListEnvironmentsWithoutEnvironmentNamePrefix() throws Exception {\n when(environmentDDBRecords.stream()).thenReturn(Stream.of(environmentDDBRecord));\n doReturn(environmentDDBRecords)\n .when(dynamoDBMapper)\n .query(eq(EnvironmentDDBRecord.class), any());\n ... | {
"fields": [
{
"declarator": "dynamoDBMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private DynamoDBMapper dynamoDBMapper;",
"type": "DynamoDBMapper",
"var_name": "dynamoDBMapper"
},
{
"declarator": "environmentMapper",
"modifier": "@NonNu... | {
"body": "@Override\n public List<Environment> listEnvironments(@NonNull final Cluster cluster)\n throws InternalServiceException {\n return listEnvironments(cluster, null);\n }",
"class_method_signature": "EnvironmentRepositoryDDB.listEnvironments(@NonNull final Cluster cluster)",
"constructor": false... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_14 | {
"fields": [
{
"declarator": "CLUSTER_1 = \"cluster1\"",
"modifier": "private static final",
"original_string": "private static final String CLUSTER_1 = \"cluster1\";",
"type": "String",
"var_name": "CLUSTER_1"
}
],
"file": "scheduling-manager/src/test/java/com/amazonaws/blo... | {
"body": "@Test\n public void returnsEmptyListWhenNoContainerInstances() {\n ECSAsyncClient ecs = mock(ECSAsyncClient.class);\n when(ecs.listContainerInstances(any()))\n .thenReturn(\n CompletableFuture.completedFuture(\n ListContainerInstancesResponse.builder().containerInsta... | {
"fields": [
{
"declarator": "ecs",
"modifier": "private final",
"original_string": "private final ECSAsyncClient ecs;",
"type": "ECSAsyncClient",
"var_name": "ecs"
},
{
"declarator": "listRequest",
"modifier": "private final",
"original_string": "private f... | {
"body": "public CompletableFuture<List<ContainerInstance>> describe() {\n return new PaginatedResponseIterator<>(ListContainerInstancesResponse::nextToken, this::list)\n .stream()\n .map(ListContainerInstancesResponse::containerInstanceArns)\n .filter(arns -> !arns.isEmpty())\n .map(t... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_1 | {
"fields": [
{
"declarator": "controller",
"modifier": "@Autowired",
"original_string": "@Autowired DescribeEnvironmentRevision controller;",
"type": "DescribeEnvironmentRevision",
"var_name": "controller"
},
{
"declarator": "mapper",
"modifier": "@Autowired",
... | {
"body": "@Test\n public void mapsInputsAndOutputsCorrectly() throws Exception {\n EnvironmentId id =\n EnvironmentId.builder()\n .accountId(ACCOUNT_ID)\n .cluster(TEST_CLUSTER)\n .environmentName(ENVIRONMENT_NAME)\n .build();\n\n EnvironmentRevision environm... | {
"fields": [
{
"declarator": "mapper",
"modifier": "@Autowired",
"original_string": "@Autowired DescribeEnvironmentRevisionMapper mapper;",
"type": "DescribeEnvironmentRevisionMapper",
"var_name": "mapper"
}
],
"file": "frontend-service/src/main/java/com/amazonaws/blox/front... | {
"body": "@RequestMapping(\n path = \"/{environmentName}/revisions/{environmentRevisionId}\",\n method = RequestMethod.GET\n )\n @ApiOperation(value = \"Describe Environment revisions\")\n public DescribeEnvironmentRevisionResponse describeEnvironmentRevision(\n @PathVariable(\"cluster\") String cluste... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_43 | {
"fields": [
{
"declarator": "repository = mock(EnvironmentRepository.class)",
"modifier": "",
"original_string": "EnvironmentRepository repository = mock(EnvironmentRepository.class);",
"type": "EnvironmentRepository",
"var_name": "repository"
},
{
"declarator": "mapp... | {
"body": "@Test\n public void itListsAllClusters() throws Exception {\n when(repository.listClusters(null, null))\n .thenReturn(asList(cluster(\"1\", \"alpha\"), cluster(\"2\", \"beta\"), cluster(\"3\", \"gamma\")));\n\n ListClustersResponse response = api.listClusters(ListClustersRequest.builder().bui... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private final",
"original_string": "@NonNull private final ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"mo... | {
"body": "public ListClustersResponse listClusters(@NonNull final ListClustersRequest request)\n throws InternalServiceException {\n try {\n List<Cluster> clusters =\n environmentRepository.listClusters(\n request.getAccountId(), request.getClusterNamePrefix());\n\n return Lis... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_55 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "private static final",
"original_string": "private static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER = \"cluster\"",
... | {
"body": "@Test(expected = ResourceNotFoundException.class)\n public void describeEnvironmentResourceNotFoundException() throws Exception {\n when(environmentRepository.getEnvironment(isA(EnvironmentId.class)))\n .thenThrow(new ResourceNotFoundException(ResourceType.ENVIRONMENT, ENVIRONMENT_NAME));\n d... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"modifier": "@N... | {
"body": "public DescribeEnvironmentResponse describeEnvironment(\n @NonNull final DescribeEnvironmentRequest describeEnvironmentRequest)\n throws ResourceNotFoundException, InternalServiceException {\n final com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentId environmentIdFromRequest =\n ... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_38 | {
"fields": [
{
"declarator": "environmentRepository",
"modifier": "@Mock private",
"original_string": "@Mock private EnvironmentRepository environmentRepository;",
"type": "EnvironmentRepository",
"var_name": "environmentRepository"
},
{
"declarator": "apiModelMapper",... | {
"body": "@Test(expected = InternalServiceException.class)\n public void testDeleteEnvironmentUnhandledException() throws Exception {\n when(environmentRepository.listEnvironmentRevisions(environmentId))\n .thenReturn(Collections.singletonList(environmentRevision));\n doThrow(NullPointerException.class... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private final",
"original_string": "@NonNull private final ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"mo... | {
"body": "public DeleteEnvironmentResponse deleteEnvironment(@NonNull DeleteEnvironmentRequest request)\n throws InternalServiceException, ResourceNotFoundException {\n final EnvironmentId environmentId =\n apiModelMapper.toModelEnvironmentId(request.getEnvironmentId());\n try {\n // Get the e... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_17 | {
"fields": [
{
"declarator": "env =\n EnvironmentDescription.builder()\n .clusterName(\"TestCluster\")\n .environmentName(\"TestEnvironment\")\n .environmentType(EnvironmentType.Daemon)\n .deploymentMethod(\"TestDeploymentMethod\")\n .taskDefinitionArn(\"te... | {
"body": "@Test\n public void matchesTaskWithDifferentTaskDefinition() {\n boolean matches =\n environment.isMatchingTask(defaultTask().taskDefinitionArn(\"different-taskdef\").build());\n\n assertThat(matches).isTrue();\n }",
"class_method_signature": "DaemonEnvironmentTest.matchesTaskWithDifferent... | {
"fields": [
{
"declarator": "HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"))",
"modifier": "private static final",
"original_string": "private static final Set<String> HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"));",
"type":... | {
"body": "public boolean isMatchingTask(Task t) {\n return t.getGroup().equals(environment.getEnvironmentName())\n && HEALTHY_STATES.contains(t.getStatus());\n }",
"class_method_signature": "DaemonEnvironment.isMatchingTask(Task t)",
"constructor": false,
"full_signature": "public boolean isMatching... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_2 | {
"fields": [
{
"declarator": "controller",
"modifier": "@Autowired",
"original_string": "@Autowired CreateEnvironment controller;",
"type": "CreateEnvironment",
"var_name": "controller"
},
{
"declarator": "mapper",
"modifier": "@Autowired",
"original_string... | {
"body": "@Test\n public void mapsInputsAndOutputsCorrectly() throws Exception {\n EnvironmentId id =\n EnvironmentId.builder()\n .accountId(ACCOUNT_ID)\n .cluster(TEST_CLUSTER)\n .environmentName(ENVIRONMENT_NAME)\n .build();\n\n InstanceGroup instanceGroup ... | {
"fields": [
{
"declarator": "mapper",
"modifier": "@Autowired",
"original_string": "@Autowired CreateEnvironmentMapper mapper;",
"type": "CreateEnvironmentMapper",
"var_name": "mapper"
},
{
"declarator": "CLUSTER_PARAM_DESCRIPTION =\n \"The short name or full Ama... | {
"body": "@RequestMapping(method = RequestMethod.POST, consumes = \"application/json\")\n @ApiOperation(value = \"Create a new Environment\", notes = CREATE_ENVIRONMENT_NOTES)\n public CreateEnvironmentResponse createEnvironment(\n @ApiParam(name = \"cluster\", value = CLUSTER_PARAM_DESCRIPTION) @PathVariable... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_40 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "private static final",
"original_string": "private static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER = \"cluster\"",
... | {
"body": "@Test(expected = ResourceNotFoundException.class)\n public void describeEnvironmentRevisionResourceNotFoundException() throws Exception {\n when(environmentRepository.getEnvironmentRevision(isA(EnvironmentId.class), isA(String.class)))\n .thenThrow(\n new ResourceNotFoundException(\n ... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"modifier": "@N... | {
"body": "public DescribeEnvironmentRevisionResponse describeEnvironmentRevision(\n @NonNull final DescribeEnvironmentRevisionRequest describeEnvironmentRevisionRequest)\n throws ResourceNotFoundException, InternalServiceException {\n\n final com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentId en... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_56 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "private static final",
"original_string": "private static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER = \"cluster\"",
... | {
"body": "@Test(expected = InternalServiceException.class)\n public void describeEnvironmentInternalServiceException() throws Exception {\n when(environmentRepository.getEnvironment(isA(EnvironmentId.class)))\n .thenThrow(new InternalServiceException(\"\"));\n describeEnvironmentApi.describeEnvironment... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"modifier": "@N... | {
"body": "public DescribeEnvironmentResponse describeEnvironment(\n @NonNull final DescribeEnvironmentRequest describeEnvironmentRequest)\n throws ResourceNotFoundException, InternalServiceException {\n final com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentId environmentIdFromRequest =\n ... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_76 | {
"fields": [
{
"declarator": "RANDOM_ERROR_CODE = 123456",
"modifier": "private static final",
"original_string": "private static final Integer RANDOM_ERROR_CODE = 123456;",
"type": "Integer",
"var_name": "RANDOM_ERROR_CODE"
},
{
"declarator": "VALID_MESSAGE = \"Someth... | {
"body": "@Test\n public void itPrefersMessageFromDataOverMessageFromError() {\n ObjectNode response =\n response(\n error(\n ThrowableSerializationMixin.ERROR_CODE,\n VALID_MESSAGE,\n data(RuntimeException.class.getTypeName(), \"message=\" + OTHER_M... | {
"fields": [
{
"declarator": "mapper",
"modifier": "private final",
"original_string": "private final ObjectMapper mapper;",
"type": "ObjectMapper",
"var_name": "mapper"
}
],
"file": "json-rpc-core/src/main/java/com/amazonaws/blox/jsonrpc/PojoExceptionResolver.java",
"iden... | {
"body": "@Override\n public Throwable resolveException(final ObjectNode response) {\n log.trace(\"Resolving exception from JSON response {}\", response);\n\n final JsonNode error = response.get(JsonRpcBasicServer.ERROR);\n if (error == null || !error.isObject()) {\n log.warn(\"No error information fo... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_21 | {
"fields": [
{
"declarator": "env =\n EnvironmentDescription.builder()\n .clusterName(\"TestCluster\")\n .environmentName(\"TestEnvironment\")\n .environmentType(EnvironmentType.Daemon)\n .deploymentMethod(\"TestDeploymentMethod\")\n .taskDefinitionArn(\"te... | {
"body": "@Test\n public void hasTaskToStop() {\n boolean stop =\n environment.isTaskStoppable(defaultTask().taskDefinitionArn(\"different-taskdef\").build());\n\n assertThat(stop).isTrue();\n }",
"class_method_signature": "DaemonEnvironmentTest.hasTaskToStop()",
"constructor": false,
"full_sign... | {
"fields": [
{
"declarator": "HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"))",
"modifier": "private static final",
"original_string": "private static final Set<String> HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"));",
"type":... | {
"body": "public boolean isTaskStoppable(Task t) {\n return t.getGroup().equals(environment.getEnvironmentName())\n && !t.getTaskDefinitionArn().equals(environment.getTaskDefinitionArn())\n && HEALTHY_STATES.contains(t.getStatus());\n }",
"class_method_signature": "DaemonEnvironment.isTaskStoppab... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_37 | {
"fields": [
{
"declarator": "environmentRepository",
"modifier": "@Mock private",
"original_string": "@Mock private EnvironmentRepository environmentRepository;",
"type": "EnvironmentRepository",
"var_name": "environmentRepository"
},
{
"declarator": "apiModelMapper",... | {
"body": "@Test(expected = InternalServiceException.class)\n public void testDeleteEnvironmentInternalServiceException() throws Exception {\n when(environmentRepository.listEnvironmentRevisions(environmentId))\n .thenReturn(Collections.singletonList(environmentRevision));\n doThrow(InternalServiceExcep... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private final",
"original_string": "@NonNull private final ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"mo... | {
"body": "public DeleteEnvironmentResponse deleteEnvironment(@NonNull DeleteEnvironmentRequest request)\n throws InternalServiceException, ResourceNotFoundException {\n final EnvironmentId environmentId =\n apiModelMapper.toModelEnvironmentId(request.getEnvironmentId());\n try {\n // Get the e... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_60 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "private static final",
"original_string": "private static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER = \"mycluster\"",
... | {
"body": "@Test\n public void testGetEnvironmentRevisionNotFound() throws Exception {\n // Given\n when(dynamoDBMapper.load(\n EnvironmentRevisionDDBRecord.class,\n environmentId.generateAccountIdClusterEnvironmentName(),\n ENVIRONMENT_REVISION_ID))\n .thenReturn(null);... | {
"fields": [
{
"declarator": "dynamoDBMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private DynamoDBMapper dynamoDBMapper;",
"type": "DynamoDBMapper",
"var_name": "dynamoDBMapper"
},
{
"declarator": "environmentMapper",
"modifier": "@NonNu... | {
"body": "@Override\n public EnvironmentRevision getEnvironmentRevision(\n @NonNull final EnvironmentId environmentId, @NonNull final String environmentRevisionId)\n throws ResourceNotFoundException, InternalServiceException {\n final String accountIdClusterEnvironmentName =\n environmentId.gene... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_61 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "private static final",
"original_string": "private static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER = \"mycluster\"",
... | {
"body": "@Test\n public void testGetEnvironmentRevisionInternalError() throws Exception {\n // Given\n when(dynamoDBMapper.load(\n EnvironmentRevisionDDBRecord.class,\n environmentId.generateAccountIdClusterEnvironmentName(),\n ENVIRONMENT_REVISION_ID))\n .thenThrow(Am... | {
"fields": [
{
"declarator": "dynamoDBMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private DynamoDBMapper dynamoDBMapper;",
"type": "DynamoDBMapper",
"var_name": "dynamoDBMapper"
},
{
"declarator": "environmentMapper",
"modifier": "@NonNu... | {
"body": "@Override\n public EnvironmentRevision getEnvironmentRevision(\n @NonNull final EnvironmentId environmentId, @NonNull final String environmentRevisionId)\n throws ResourceNotFoundException, InternalServiceException {\n final String accountIdClusterEnvironmentName =\n environmentId.gene... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_36 | {
"fields": [
{
"declarator": "environmentRepository",
"modifier": "@Mock private",
"original_string": "@Mock private EnvironmentRepository environmentRepository;",
"type": "EnvironmentRepository",
"var_name": "environmentRepository"
},
{
"declarator": "apiModelMapper",... | {
"body": "@Test(expected = ResourceNotFoundException.class)\n public void testDeleteEnvironmentResourceNotFoundException() throws Exception {\n when(environmentRepository.getEnvironment(environmentId)).thenThrow(resourceNotFoundException);\n\n deleteEnvironmentApi.deleteEnvironment(deleteEnvironmentRequest);\... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private final",
"original_string": "@NonNull private final ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"mo... | {
"body": "public DeleteEnvironmentResponse deleteEnvironment(@NonNull DeleteEnvironmentRequest request)\n throws InternalServiceException, ResourceNotFoundException {\n final EnvironmentId environmentId =\n apiModelMapper.toModelEnvironmentId(request.getEnvironmentId());\n try {\n // Get the e... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_20 | {
"fields": [
{
"declarator": "env =\n EnvironmentDescription.builder()\n .clusterName(\"TestCluster\")\n .environmentName(\"TestEnvironment\")\n .environmentType(EnvironmentType.Daemon)\n .deploymentMethod(\"TestDeploymentMethod\")\n .taskDefinitionArn(\"te... | {
"body": "@Test\n public void startsTasksThatMatchesEnvironmentAndInstance() {\n ContainerInstance instance = ContainerInstance.builder().arn(\"instance-1\").build();\n\n StartTask task = environment.startTaskFor(instance);\n\n assertSoftly(\n s -> {\n s.assertThat(task.getClusterName()).is... | {
"fields": [
{
"declarator": "HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"))",
"modifier": "private static final",
"original_string": "private static final Set<String> HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"));",
"type":... | {
"body": "public StartTask startTaskFor(ContainerInstance i) {\n return StartTask.builder()\n .clusterName(environment.getClusterName())\n .containerInstanceArn(i.getArn())\n .taskDefinitionArn(environment.getTaskDefinitionArn())\n .group(environment.getEnvironmentName())\n .bui... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_57 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "private static final",
"original_string": "private static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER = \"cluster\"",
... | {
"body": "@Test(expected = InternalServiceException.class)\n public void describeEnvironmentInternalServiceExceptionWithUnknownException() throws Exception {\n when(environmentRepository.getEnvironment(isA(EnvironmentId.class)))\n .thenThrow(new IllegalStateException(\"\"));\n describeEnvironmentApi.de... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"modifier": "@N... | {
"body": "public DescribeEnvironmentResponse describeEnvironment(\n @NonNull final DescribeEnvironmentRequest describeEnvironmentRequest)\n throws ResourceNotFoundException, InternalServiceException {\n final com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentId environmentIdFromRequest =\n ... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_41 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "private static final",
"original_string": "private static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER = \"cluster\"",
... | {
"body": "@Test(expected = InternalServiceException.class)\n public void describeEnvironmentRevisionInternalServiceException() throws Exception {\n when(environmentRepository.getEnvironmentRevision(isA(EnvironmentId.class), isA(String.class)))\n .thenThrow(new InternalServiceException(\"\"));\n describ... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"modifier": "@N... | {
"body": "public DescribeEnvironmentRevisionResponse describeEnvironmentRevision(\n @NonNull final DescribeEnvironmentRevisionRequest describeEnvironmentRevisionRequest)\n throws ResourceNotFoundException, InternalServiceException {\n\n final com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentId en... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_3 | {
"fields": [
{
"declarator": "controller",
"modifier": "@Autowired",
"original_string": "@Autowired DeleteEnvironment controller;",
"type": "DeleteEnvironment",
"var_name": "controller"
},
{
"declarator": "mapper",
"modifier": "@Autowired",
"original_string... | {
"body": "@Test\n public void mapsInputsAndOutputsCorrectly() throws Exception {\n EnvironmentId id =\n EnvironmentId.builder()\n .accountId(ACCOUNT_ID)\n .cluster(TEST_CLUSTER)\n .environmentName(ENVIRONMENT_NAME)\n .build();\n\n Environment environment =\n ... | {
"fields": [
{
"declarator": "mapper",
"modifier": "@Autowired",
"original_string": "@Autowired DeleteEnvironmentMapper mapper;",
"type": "DeleteEnvironmentMapper",
"var_name": "mapper"
}
],
"file": "frontend-service/src/main/java/com/amazonaws/blox/frontend/operations/Delet... | {
"body": "@RequestMapping(path = \"/{environmentName}\", method = RequestMethod.DELETE)\n @ApiOperation(value = \"Delete an Environment by name\")\n public DeleteEnvironmentResponse deleteEnvironment(\n @PathVariable(\"cluster\") String cluster,\n @PathVariable(\"environmentName\") String environmentName... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_16 | {
"fields": [
{
"declarator": "env =\n EnvironmentDescription.builder()\n .clusterName(\"TestCluster\")\n .environmentName(\"TestEnvironment\")\n .environmentType(EnvironmentType.Daemon)\n .deploymentMethod(\"TestDeploymentMethod\")\n .taskDefinitionArn(\"te... | {
"body": "@Test\n public void matchesHealthyTasksWithSameTaskDefinition() {\n boolean matches =\n environment.isMatchingTask(\n defaultTask().taskDefinitionArn(env.getTaskDefinitionArn()).status(\"RUNNING\").build());\n\n assertThat(matches).isTrue();\n }",
"class_method_signature": "Daem... | {
"fields": [
{
"declarator": "HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"))",
"modifier": "private static final",
"original_string": "private static final Set<String> HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"));",
"type":... | {
"body": "public boolean isMatchingTask(Task t) {\n return t.getGroup().equals(environment.getEnvironmentName())\n && HEALTHY_STATES.contains(t.getStatus());\n }",
"class_method_signature": "DaemonEnvironment.isMatchingTask(Task t)",
"constructor": false,
"full_signature": "public boolean isMatching... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_8 | {
"fields": [
{
"declarator": "requestArgument =\n ArgumentCaptor.forClass(InvokeRequest.class)",
"modifier": "private final",
"original_string": "private final ArgumentCaptor<InvokeRequest> requestArgument =\n ArgumentCaptor.forClass(InvokeRequest.class);",
"type": "ArgumentCapt... | {
"body": "@Test\n public void callUsesRequestReply() {\n function.callAsync(new TestInput(\"test\")).join();\n\n verify(client).invoke(requestArgument.capture());\n assertThat(\n requestArgument.getValue().invocationType(),\n equalTo(InvocationType.RequestResponse.toString()));\n }",
"clas... | {
"fields": [
{
"declarator": "lambda",
"modifier": "private final",
"original_string": "private final LambdaAsyncClient lambda;",
"type": "LambdaAsyncClient",
"var_name": "lambda"
},
{
"declarator": "reader",
"modifier": "private final",
"original_string": ... | {
"body": "@Override\n public CompletableFuture<OUT> callAsync(IN input) {\n CompletableFuture<OUT> response =\n callLambda(InvocationType.RequestResponse, input).thenApply(this::deserialize);\n\n response.thenAccept(r -> log.debug(\"response from {}: {}\", functionName, r));\n\n return response;\n ... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_70 | {
"fields": [
{
"declarator": "RANDOM_ERROR_CODE = 123456",
"modifier": "private static final",
"original_string": "private static final Integer RANDOM_ERROR_CODE = 123456;",
"type": "Integer",
"var_name": "RANDOM_ERROR_CODE"
},
{
"declarator": "VALID_MESSAGE = \"Someth... | {
"body": "@Test\n public void itDeserializesPojoExceptionsWithJsonCreatorConstructor() {\n ObjectNode response =\n response(\n error(\n ThrowableSerializationMixin.ERROR_CODE,\n VALID_MESSAGE,\n data(PojoTestException.class.getTypeName(), \"someValue... | {
"fields": [
{
"declarator": "mapper",
"modifier": "private final",
"original_string": "private final ObjectMapper mapper;",
"type": "ObjectMapper",
"var_name": "mapper"
}
],
"file": "json-rpc-core/src/main/java/com/amazonaws/blox/jsonrpc/PojoExceptionResolver.java",
"iden... | {
"body": "@Override\n public Throwable resolveException(final ObjectNode response) {\n log.trace(\"Resolving exception from JSON response {}\", response);\n\n final JsonNode error = response.get(JsonRpcBasicServer.ERROR);\n if (error == null || !error.isObject()) {\n log.warn(\"No error information fo... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_27 | {
"fields": [
{
"declarator": "env =\n EnvironmentDescription.builder()\n .clusterName(\"TestCluster\")\n .environmentName(\"TestEnvironment\")\n .environmentType(EnvironmentType.Daemon)\n .deploymentMethod(\"TestDeploymentMethod\")\n .taskDefinitionArn(\"te... | {
"body": "@Test\n public void hasHealthyTasksWithAnotherVersion() {\n boolean isMissingHealthyTask =\n environment.isMissingHealthyTask(\n Collections.singletonList(\n defaultTask().taskDefinitionArn(\"different-taskdef\").build()));\n\n assertThat(isMissingHealthyTask).isFals... | {
"fields": [
{
"declarator": "HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"))",
"modifier": "private static final",
"original_string": "private static final Set<String> HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"));",
"type":... | {
"body": "public boolean isMissingHealthyTask(List<Task> tasks) {\n return tasks.stream().noneMatch(this::isMatchingTask);\n }",
"class_method_signature": "DaemonEnvironment.isMissingHealthyTask(List<Task> tasks)",
"constructor": false,
"full_signature": "public boolean isMissingHealthyTask(List<Task> task... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_31 | {
"fields": [
{
"declarator": "CLUSTER_ARN = \"cluster\"",
"modifier": "private static final",
"original_string": "private static final String CLUSTER_ARN = \"cluster\";",
"type": "String",
"var_name": "CLUSTER_ARN"
},
{
"declarator": "snapshot =\n new ClusterSnaps... | {
"body": "@Test\n public void tasksForInstanceReturnsCorrectTasksForGivenInstance() {\n given(instance(\"i-1\"), instance(\"i-2\"), instance(\"i-3\"));\n given(task(\"i-1\", \"t-1\"), task(\"i-1\", \"t-2\"), task(\"i-2\", \"t-3\"));\n\n ClusterSummary summary = new ClusterSummary(snapshot);\n\n assertTh... | {
"fields": [
{
"declarator": "snapshot",
"modifier": "private final",
"original_string": "private final ClusterSnapshot snapshot;",
"type": "ClusterSnapshot",
"var_name": "snapshot"
},
{
"declarator": "tasksByInstanceArn",
"modifier": "private final",
"orig... | {
"body": "public List<Task> tasksForInstance(ContainerInstance instance) {\n String arn = instance.getArn();\n\n if (instancesByInstanceArn.containsKey(arn)) {\n return tasksByInstanceArn.getOrDefault(arn, Collections.emptyList());\n } else {\n throw new IndexOutOfBoundsException(\n Strin... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_66 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "private static final",
"original_string": "private static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER = \"mycluster\"",
... | {
"body": "@Test\n public void testDeleteEnvironmentSuccess() throws Exception {\n doNothing()\n .when(dynamoDBMapper)\n .delete(any(EnvironmentDDBRecord.class), eq(SaveBehavior.CLOBBER.config()));\n\n environmentRepositoryDDB.deleteEnvironment(environmentId);\n verify(dynamoDBMapper, times(1)... | {
"fields": [
{
"declarator": "dynamoDBMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private DynamoDBMapper dynamoDBMapper;",
"type": "DynamoDBMapper",
"var_name": "dynamoDBMapper"
},
{
"declarator": "environmentMapper",
"modifier": "@NonNu... | {
"body": "@Override\n public void deleteEnvironment(@NonNull final EnvironmentId environmentId)\n throws InternalServiceException {\n try {\n dynamoDBMapper.delete(\n EnvironmentDDBRecord.withKeys(\n environmentId.generateAccountIdCluster(), environmentId.getEnvironmentName()),\n ... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_11 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "public static final",
"original_string": "public static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "FIRST_CLUSTER_NAME = \"cluste... | {
"body": "@Test\n public void invokesManagerAsynchronouslyForAllClusters() throws Exception {\n when(data.listClusters(any()))\n .thenReturn(new ListClustersResponse(Arrays.asList(CLUSTER1, CLUSTER2)));\n\n when(manager.triggerAsync(input.capture())).thenReturn(CompletableFuture.completedFuture(null));... | {
"fields": [
{
"declarator": "dataService",
"modifier": "final",
"original_string": "final DataService dataService;",
"type": "DataService",
"var_name": "dataService"
},
{
"declarator": "stateFunction",
"modifier": "final",
"original_string": "final LambdaF... | {
"body": "@Override\n @SneakyThrows // TODO add checked exception handling\n public Void handleRequest(CloudWatchEvent<Map> input, Context context) {\n log.debug(\"Reconciler request: {}\", input);\n\n ListClustersResponse r = dataService.listClusters(ListClustersRequest.builder().build());\n List<Cluster... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_4 | {
"fields": [
{
"declarator": "NEW_TASK_DEFINITION = \"new_task_definition\"",
"modifier": "private static final",
"original_string": "private static final String NEW_TASK_DEFINITION = \"new_task_definition\";",
"type": "String",
"var_name": "NEW_TASK_DEFINITION"
},
{
"... | {
"body": "@Test\n public void mapsInputsAndOutputsCorrectly() throws Exception {\n EnvironmentId id =\n EnvironmentId.builder()\n .accountId(ACCOUNT_ID)\n .cluster(TEST_CLUSTER)\n .environmentName(ENVIRONMENT_NAME)\n .build();\n\n when(dataService.updateEnvir... | {
"fields": [
{
"declarator": "mapper",
"modifier": "@Autowired",
"original_string": "@Autowired UpdateEnvironmentMapper mapper;",
"type": "UpdateEnvironmentMapper",
"var_name": "mapper"
}
],
"file": "frontend-service/src/main/java/com/amazonaws/blox/frontend/operations/Updat... | {
"body": "@RequestMapping(\n path = \"/{environmentName}\",\n method = RequestMethod.PUT,\n consumes = \"application/json\"\n )\n @ApiOperation(value = \"Update an existing Environment\")\n public UpdateEnvironmentResponse updateEnvironment(\n @PathVariable(\"cluster\") String cluster,\n @PathV... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_46 | {
"fields": [
{
"declarator": "request",
"modifier": "private",
"original_string": "private ListEnvironmentsRequest request;",
"type": "ListEnvironmentsRequest",
"var_name": "request"
},
{
"declarator": "apiModelMapper",
"modifier": "@Mock private",
"origina... | {
"body": "@Test\n public void testListEnvironments() throws Exception {\n when(environmentRepository.listEnvironments(cluster, null))\n .thenReturn(Collections.singletonList(environment));\n\n final ListEnvironmentsResponse response = api.listEnvironments(request);\n\n verify(apiModelMapper).toModel... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"modifier": "@N... | {
"body": "public ListEnvironmentsResponse listEnvironments(@NonNull final ListEnvironmentsRequest request)\n throws InternalServiceException {\n\n final Cluster cluster = apiModelMapper.toModelCluster(request.getCluster());\n\n try {\n final List<Environment> environments =\n environmentRepo... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_50 | {
"fields": [
{
"declarator": "ENVIRONMENT_REVISION_ID = \"revision-id\"",
"modifier": "private static final",
"original_string": "private static final String ENVIRONMENT_REVISION_ID = \"revision-id\";",
"type": "String",
"var_name": "ENVIRONMENT_REVISION_ID"
},
{
"decl... | {
"body": "@Test\n public void startDeployment() throws Exception {\n // Given\n when(environmentRepository.getEnvironment(environmentId)).thenReturn(environment);\n when(environmentRepository.getEnvironmentRevision(environmentId, ENVIRONMENT_REVISION_ID))\n .thenReturn(environmentRevision);\n\n /... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private final",
"original_string": "@NonNull private final ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"mo... | {
"body": "public StartDeploymentResponse startDeployment(@NonNull final StartDeploymentRequest request)\n throws ResourceNotFoundException, InternalServiceException {\n try {\n final EnvironmentId environmentId =\n apiModelMapper.toModelEnvironmentId(request.getEnvironmentId());\n final En... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_51 | {
"fields": [
{
"declarator": "ENVIRONMENT_REVISION_ID = \"revision-id\"",
"modifier": "private static final",
"original_string": "private static final String ENVIRONMENT_REVISION_ID = \"revision-id\";",
"type": "String",
"var_name": "ENVIRONMENT_REVISION_ID"
},
{
"decl... | {
"body": "@Test(expected = ResourceNotFoundException.class)\n public void startDeploymentResourceNotFoundException() throws Exception {\n when(environmentRepository.getEnvironment(environmentId))\n .thenThrow(new ResourceNotFoundException(ResourceType.ENVIRONMENT, \"env-name\"));\n\n api.startDeploymen... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private final",
"original_string": "@NonNull private final ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"mo... | {
"body": "public StartDeploymentResponse startDeployment(@NonNull final StartDeploymentRequest request)\n throws ResourceNotFoundException, InternalServiceException {\n try {\n final EnvironmentId environmentId =\n apiModelMapper.toModelEnvironmentId(request.getEnvironmentId());\n final En... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_47 | {
"fields": [
{
"declarator": "request",
"modifier": "private",
"original_string": "private ListEnvironmentsRequest request;",
"type": "ListEnvironmentsRequest",
"var_name": "request"
},
{
"declarator": "apiModelMapper",
"modifier": "@Mock private",
"origina... | {
"body": "@Test\n public void testListEnvironmentsEmptyResult() throws Exception {\n when(environmentRepository.listEnvironments(cluster, null)).thenReturn(Collections.emptyList());\n\n final ListEnvironmentsResponse response = api.listEnvironments(request);\n\n verify(apiModelMapper).toModelCluster(cluste... | {
"fields": [
{
"declarator": "apiModelMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private ApiModelMapper apiModelMapper;",
"type": "ApiModelMapper",
"var_name": "apiModelMapper"
},
{
"declarator": "environmentRepository",
"modifier": "@N... | {
"body": "public ListEnvironmentsResponse listEnvironments(@NonNull final ListEnvironmentsRequest request)\n throws InternalServiceException {\n\n final Cluster cluster = apiModelMapper.toModelCluster(request.getCluster());\n\n try {\n final List<Environment> environments =\n environmentRepo... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_5 | {
"fields": [
{
"declarator": "CLUSTER = \"myCluster\"",
"modifier": "private static final",
"original_string": "private static final String CLUSTER = \"myCluster\";",
"type": "String",
"var_name": "CLUSTER"
},
{
"declarator": "ENVIRONMENT_NAME = \"TestEnvironment\"",
... | {
"body": "@Test\n public void testStartDeployment() throws Exception {\n // Given\n final StartDeploymentRequest dsRequest = mock(StartDeploymentRequest.class);\n final StartDeploymentResponse dsResponse = mock(StartDeploymentResponse.class);\n final StartDeployment.StartDeploymentResponse feResponse =\... | {
"fields": [
{
"declarator": "mapper",
"modifier": "@Autowired",
"original_string": "@Autowired StartDeploymentMapper mapper;",
"type": "StartDeploymentMapper",
"var_name": "mapper"
}
],
"file": "frontend-service/src/main/java/com/amazonaws/blox/frontend/operations/StartDepl... | {
"body": "@RequestMapping(path = \"/{environmentName}/deployments\", method = RequestMethod.POST)\n @ApiOperation(value = \"Deploy Environment revision\")\n public StartDeploymentResponse startDeployment(\n @PathVariable(\"cluster\") String cluster,\n @PathVariable(\"environmentName\") String environment... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_10 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"12345678012\"",
"modifier": "public static final",
"original_string": "public static final String ACCOUNT_ID = \"12345678012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER_NAME = \"cluster1\"",
... | {
"body": "@Test\n @SuppressWarnings(\"unchecked\")\n public void invokesSchedulerForAllEnvironments() throws Exception {\n when(dataService.listEnvironments(ListEnvironmentsRequest.builder().cluster(CLUSTER).build()))\n .thenReturn(\n ListEnvironmentsResponse.builder()\n .enviro... | {
"fields": [
{
"declarator": "data",
"modifier": "private final",
"original_string": "private final DataService data;",
"type": "DataService",
"var_name": "data"
},
{
"declarator": "ecs",
"modifier": "private final",
"original_string": "private final ECSSta... | {
"body": "@Override\n @SneakyThrows // TODO add checked exception handling\n public ManagerOutput handleRequest(ManagerInput input, Context context) {\n log.debug(\"Manager request: {}\", input);\n\n ListEnvironmentsResponse r =\n data.listEnvironments(\n ListEnvironmentsRequest.builder().c... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_67 | {
"fields": [
{
"declarator": "ACCOUNT_ID = \"123456789012\"",
"modifier": "private static final",
"original_string": "private static final String ACCOUNT_ID = \"123456789012\";",
"type": "String",
"var_name": "ACCOUNT_ID"
},
{
"declarator": "CLUSTER = \"mycluster\"",
... | {
"body": "@Test\n public void testDeleteEnvironmentInternalError() throws Exception {\n doThrow(AmazonServiceException.class)\n .when(dynamoDBMapper)\n .delete(any(EnvironmentDDBRecord.class), eq(SaveBehavior.CLOBBER.config()));\n\n thrown.expect(InternalServiceException.class);\n thrown.expe... | {
"fields": [
{
"declarator": "dynamoDBMapper",
"modifier": "@NonNull private",
"original_string": "@NonNull private DynamoDBMapper dynamoDBMapper;",
"type": "DynamoDBMapper",
"var_name": "dynamoDBMapper"
},
{
"declarator": "environmentMapper",
"modifier": "@NonNu... | {
"body": "@Override\n public void deleteEnvironment(@NonNull final EnvironmentId environmentId)\n throws InternalServiceException {\n try {\n dynamoDBMapper.delete(\n EnvironmentDDBRecord.withKeys(\n environmentId.generateAccountIdCluster(), environmentId.getEnvironmentName()),\n ... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_30 | {
"fields": [
{
"declarator": "CLUSTER_ARN = \"cluster\"",
"modifier": "private static final",
"original_string": "private static final String CLUSTER_ARN = \"cluster\";",
"type": "String",
"var_name": "CLUSTER_ARN"
},
{
"declarator": "snapshot =\n new ClusterSnaps... | {
"body": "@Test\n public void tasksForInstanceReturnsNoTasksForEmptyInstance() {\n given(instance(\"i-1\"));\n\n ClusterSummary summary = new ClusterSummary(snapshot);\n\n assertThat(summary.tasksForInstance(instance(\"i-1\"))).isEmpty();\n }",
"class_method_signature": "ClusterSummaryTest.tasksForInsta... | {
"fields": [
{
"declarator": "snapshot",
"modifier": "private final",
"original_string": "private final ClusterSnapshot snapshot;",
"type": "ClusterSnapshot",
"var_name": "snapshot"
},
{
"declarator": "tasksByInstanceArn",
"modifier": "private final",
"orig... | {
"body": "public List<Task> tasksForInstance(ContainerInstance instance) {\n String arn = instance.getArn();\n\n if (instancesByInstanceArn.containsKey(arn)) {\n return tasksByInstanceArn.getOrDefault(arn, Collections.emptyList());\n } else {\n throw new IndexOutOfBoundsException(\n Strin... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_26 | {
"fields": [
{
"declarator": "env =\n EnvironmentDescription.builder()\n .clusterName(\"TestCluster\")\n .environmentName(\"TestEnvironment\")\n .environmentType(EnvironmentType.Daemon)\n .deploymentMethod(\"TestDeploymentMethod\")\n .taskDefinitionArn(\"te... | {
"body": "@Test\n public void hasHealthyTasks() {\n boolean isMissingHealthyTask =\n environment.isMissingHealthyTask(Collections.singletonList(defaultTask().build()));\n\n assertThat(isMissingHealthyTask).isFalse();\n }",
"class_method_signature": "DaemonEnvironmentTest.hasHealthyTasks()",
"const... | {
"fields": [
{
"declarator": "HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"))",
"modifier": "private static final",
"original_string": "private static final Set<String> HEALTHY_STATES =\n new HashSet<>(Arrays.asList(\"RUNNING\", \"PENDING\"));",
"type":... | {
"body": "public boolean isMissingHealthyTask(List<Task> tasks) {\n return tasks.stream().noneMatch(this::isMatchingTask);\n }",
"class_method_signature": "DaemonEnvironment.isMissingHealthyTask(List<Task> tasks)",
"constructor": false,
"full_signature": "public boolean isMissingHealthyTask(List<Task> task... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_71 | {
"fields": [
{
"declarator": "RANDOM_ERROR_CODE = 123456",
"modifier": "private static final",
"original_string": "private static final Integer RANDOM_ERROR_CODE = 123456;",
"type": "Integer",
"var_name": "RANDOM_ERROR_CODE"
},
{
"declarator": "VALID_MESSAGE = \"Someth... | {
"body": "@Test\n public void itReturnsNullForNonErrorResponse() {\n ObjectNode response = response(null);\n\n Throwable throwable = resolver.resolveException(response);\n\n assertThat(throwable).isNull();\n }",
"class_method_signature": "PojoExceptionResolverTest.itReturnsNullForNonErrorResponse()",
... | {
"fields": [
{
"declarator": "mapper",
"modifier": "private final",
"original_string": "private final ObjectMapper mapper;",
"type": "ObjectMapper",
"var_name": "mapper"
}
],
"file": "json-rpc-core/src/main/java/com/amazonaws/blox/jsonrpc/PojoExceptionResolver.java",
"iden... | {
"body": "@Override\n public Throwable resolveException(final ObjectNode response) {\n log.trace(\"Resolving exception from JSON response {}\", response);\n\n final JsonNode error = response.get(JsonRpcBasicServer.ERROR);\n if (error == null || !error.isObject()) {\n log.warn(\"No error information fo... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
74169960_9 | {
"fields": [
{
"declarator": "requestArgument =\n ArgumentCaptor.forClass(InvokeRequest.class)",
"modifier": "private final",
"original_string": "private final ArgumentCaptor<InvokeRequest> requestArgument =\n ArgumentCaptor.forClass(InvokeRequest.class);",
"type": "ArgumentCapt... | {
"body": "@Test\n public void triggerUsesEventInvocation() {\n function.triggerAsync(new TestInput(\"test\")).join();\n\n verify(client).invoke(requestArgument.capture());\n assertThat(\n requestArgument.getValue().invocationType(), equalTo(InvocationType.Event.toString()));\n }",
"class_method_s... | {
"fields": [
{
"declarator": "lambda",
"modifier": "private final",
"original_string": "private final LambdaAsyncClient lambda;",
"type": "LambdaAsyncClient",
"var_name": "lambda"
},
{
"declarator": "reader",
"modifier": "private final",
"original_string": ... | {
"body": "@Override\n public CompletableFuture<Void> triggerAsync(IN input) {\n CompletableFuture<InvokeResponse> response = callLambda(InvocationType.Event, input);\n\n return response.thenAccept(\n r -> log.debug(\"response from {}: {}\", functionName, r.statusCode()));\n }",
"class_method_signatu... | {
"created": null,
"fork": null,
"fork_count": 83,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 74169960,
"size": 5805,
"stargazer_count": 930,
"stars": null,
"updates": null,
"url": "https://github.com/blox/blox"
} |
107536049_7 | {
"fields": [
{
"declarator": "_client = new ArtemisDiscoveryHttpClient(ArtemisClientConstants.DiscoveryClientConfig)",
"modifier": "private final",
"original_string": "private final ArtemisDiscoveryHttpClient _client = new ArtemisDiscoveryHttpClient(ArtemisClientConstants.DiscoveryClientConfig)... | {
"body": "@Test\n public void testGetService_ShouldReturnIntances() throws Exception {\n final Service service = _client.getService(new DiscoveryConfig(ArtemisClientConstants.RegistryService.Net.serviceKey));\n Assert.assertNotNull(service);\n Assert.assertTrue(service.getInstances().size() >... | {
"fields": [],
"file": "artemis-client/src/main/java/com/ctrip/soa/artemis/client/discovery/ArtemisDiscoveryHttpClient.java",
"identifier": "ArtemisDiscoveryHttpClient",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArtemisDiscoveryHttpClient.ArtemisDiscoveryHttpClient(final ArtemisCl... | {
"body": "public Service getService(final DiscoveryConfig discoveryConfig) {\n Preconditions.checkArgument(discoveryConfig != null, \"discoveryConfig\");\n final List<Service> services = getServices(Lists.newArrayList(discoveryConfig));\n if (services.size() > 0) {\n return services.g... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_58 | {
"fields": [
{
"declarator": "groupOperationDao = GroupOperationDao.INSTANCE",
"modifier": "private final",
"original_string": "private final GroupOperationDao groupOperationDao = GroupOperationDao.INSTANCE;",
"type": "GroupOperationDao",
"var_name": "groupOperationDao"
},
{... | {
"body": "@Test\n public void testQuery() throws Exception {\n groupOperationDao.insertOrUpdate(newGroupOperation());\n groupOperationDao.insertOrUpdate(newGroupOperation());\n Assert.assertTrue(groupOperationDao.query().size() >= 2);\n }",
"class_method_signature": "GroupOperationDaoTes... | {
"fields": [
{
"declarator": "INSTANCE = new GroupOperationDao()",
"modifier": "public static final",
"original_string": "public static final GroupOperationDao INSTANCE = new GroupOperationDao();",
"type": "GroupOperationDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-man... | {
"body": "public List<GroupOperationModel> query() {\n return DataConfig.jdbcTemplate().query(\"select group_id, operation from service_group_operation\",\n new RowMapper<GroupOperationModel>() {\n @Override\n public GroupOperationModel mapRow(ResultSet rs,... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_19 | {
"fields": [
{
"declarator": "webSocketEndpoint = \"/ws/endpoint\"",
"modifier": "private static",
"original_string": "private static String webSocketEndpoint = \"/ws/endpoint\";",
"type": "String",
"var_name": "webSocketEndpoint"
}
],
"file": "artemis-client/src/test/java/c... | {
"body": "@Test\n public void testGetHttpUrl() {\n final AddressContext context = newAddressContext(\"http://localhost:8080\");\n Assert.assertEquals(\"http://localhost:8080\", context.getHttpUrl());\n Assert.assertEquals(\"http://localhost:8080/path\", context.customHttpUrl(\"path\"));\n ... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(AddressContext.class)",
"modifier": "private static final",
"original_string": "private static final Logger _logger = LoggerFactory.getLogger(AddressContext.class);",
"type": "Logger",
"var_name": "_logger"
},
{... | {
"body": "public String getHttpUrl() {\n return _httpUrl;\n }",
"class_method_signature": "AddressContext.getHttpUrl()",
"constructor": false,
"full_signature": "public String getHttpUrl()",
"identifier": "getHttpUrl",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": ... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_35 | {
"fields": [
{
"declarator": "_instanceLogDao = InstanceLogDao.INSTANCE",
"modifier": "",
"original_string": "InstanceLogDao _instanceLogDao = InstanceLogDao.INSTANCE;",
"type": "InstanceLogDao",
"var_name": "_instanceLogDao"
}
],
"file": "artemis-management/src/test/java/co... | {
"body": "@Test\n public void testInsert() {\n final InstanceLogModel log1 = InstanceLogModels.newInstanceLogModel();\n final InstanceLogModel log2 = InstanceLogModels.newInstanceLogModel();\n log1.setComplete(true);\n log2.setComplete(true);\n final List<InstanceLogModel> logs ... | {
"fields": [
{
"declarator": "INSTANCE = new InstanceLogDao()",
"modifier": "public static final",
"original_string": "public static final InstanceLogDao INSTANCE = new InstanceLogDao();",
"type": "InstanceLogDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/src/... | {
"body": "public void insert(final InstanceLogModel... logs) {\n if ((logs == null) || (logs.length == 0)) {\n return;\n }\n this.insert(Lists.newArrayList(logs));\n }",
"class_method_signature": "InstanceLogDao.insert(final InstanceLogModel... logs)",
"constructor": false,
"... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_62 | {
"fields": [
{
"declarator": "groupInstanceDao = GroupInstanceDao.INSTANCE",
"modifier": "private final",
"original_string": "private final GroupInstanceDao groupInstanceDao = GroupInstanceDao.INSTANCE;",
"type": "GroupInstanceDao",
"var_name": "groupInstanceDao"
},
{
... | {
"body": "@Test\n public void testDeleteByFilters() {\n GroupInstanceModel groupInstance1 = newGroupInstance();\n GroupInstanceModel groupInstance2 = newGroupInstance();\n groupInstanceDao.insert(groupInstance1, groupInstance2);\n query(groupInstance1, 1);\n query(groupInstance2... | {
"fields": [
{
"declarator": "INSTANCE = new GroupInstanceDao()",
"modifier": "public static final",
"original_string": "public static final GroupInstanceDao INSTANCE = new GroupInstanceDao();",
"type": "GroupInstanceDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-managem... | {
"body": "protected void deleteByFilters(final List<GroupInstanceModel> filters){\n checkInsertOrUpdateArgument(filters);\n DataConfig.jdbcTemplate().batchUpdate(\"delete from service_group_instance where group_id = ? and instance_id=?\", new BatchPreparedStatementSetter() {\n @Override\n ... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_74 | {
"fields": [
{
"declarator": "zoneOperationLogDao = ZoneOperationLogDao.INSTANCE",
"modifier": "",
"original_string": "ZoneOperationLogDao zoneOperationLogDao = ZoneOperationLogDao.INSTANCE;",
"type": "ZoneOperationLogDao",
"var_name": "zoneOperationLogDao"
},
{
"decla... | {
"body": "@Test\n public void testInsert() {\n final ZoneOperationLogModel log1 = newZoneOperationLogModel();\n final ZoneOperationLogModel log2 = newZoneOperationLogModel();\n log1.setComplete(true);\n log2.setComplete(true);\n final List<ZoneOperationLogModel> logs = Lists.new... | {
"fields": [
{
"declarator": "INSTANCE = new ZoneOperationLogDao()",
"modifier": "public static final",
"original_string": "public static final ZoneOperationLogDao INSTANCE = new ZoneOperationLogDao();",
"type": "ZoneOperationLogDao",
"var_name": "INSTANCE"
}
],
"file": "art... | {
"body": "public void insert(final ZoneOperationLogModel... logs) {\n if ((logs == null) || (logs.length == 0)) {\n return;\n }\n this.insert(Lists.newArrayList(logs));\n }",
"class_method_signature": "ZoneOperationLogDao.insert(final ZoneOperationLogModel... logs)",
"construct... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_23 | {
"fields": [],
"file": "artemis-client/src/test/java/com/ctrip/soa/artemis/client/common/ConditionsTest.java",
"identifier": "ConditionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void verifyInstance() {\n {\n Assert.assertFalse(Conditions.verifyInstance(new Instance()));\n }\n\n {\n Assert.assertTrue(Conditions.verifyInstance(Instances.newInstance()));\n }\n }",
"class_method_signature": "ConditionsTest.verify... | {
"fields": [],
"file": "artemis-client/src/main/java/com/ctrip/soa/artemis/client/common/Conditions.java",
"identifier": "Conditions",
"interfaces": "",
"methods": [
{
"class_method_signature": "Conditions.verifyInstance(final Instance instance)",
"constructor": false,
"full_signature":... | {
"body": "public static boolean verifyInstance(final Instance instance) {\n return (instance != null)\n && !StringValues.isNullOrWhitespace(instance.getInstanceId())\n && !StringValues.isNullOrWhitespace(instance.getServiceId())\n && !StringValues.isNullOrWhitespac... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_54 | {
"fields": [
{
"declarator": "serviceInstanceDao = ServiceInstanceDao.INSTANCE",
"modifier": "private final",
"original_string": "private final ServiceInstanceDao serviceInstanceDao = ServiceInstanceDao.INSTANCE;",
"type": "ServiceInstanceDao",
"var_name": "serviceInstanceDao"
}... | {
"body": "@Test\n public void testInsertOrUpdate() throws Exception {\n ServiceInstanceModel serviceInstance = newServiceInstance();\n serviceInstanceDao.insertOrUpdate(serviceInstance);\n serviceInstanceDao.insertOrUpdate(serviceInstance);\n assertServiceInstance(serviceInstance, quer... | {
"fields": [
{
"declarator": "INSTANCE = new ServiceInstanceDao()",
"modifier": "public static final",
"original_string": "public static final ServiceInstanceDao INSTANCE = new ServiceInstanceDao();",
"type": "ServiceInstanceDao",
"var_name": "INSTANCE"
}
],
"file": "artemis... | {
"body": "protected void insertOrUpdate(final ServiceInstanceModel... groupInstances) {\n insertOrUpdate(Lists.newArrayList(groupInstances));\n }",
"class_method_signature": "ServiceInstanceDao.insertOrUpdate(final ServiceInstanceModel... groupInstances)",
"constructor": false,
"full_signature": "pro... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_15 | {
"fields": [
{
"declarator": "_instances = new AtomicReference<Set<Instance>>(new HashSet<Instance>())",
"modifier": "private final",
"original_string": "private final AtomicReference<Set<Instance>> _instances = new AtomicReference<Set<Instance>>(new HashSet<Instance>());",
"type": "Atomi... | {
"body": "@Test\n public void testRegister() {\n final Set<Instance> instances = Instances.newInstances(2);\n repository.register(instances);\n Assert.assertTrue(_instances.get().containsAll(instances));\n }",
"class_method_signature": "InstanceRepositoryTest.testRegister()",
"construc... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(InstanceRepository.class)",
"modifier": "private static final",
"original_string": "private static final Logger _logger = LoggerFactory.getLogger(InstanceRepository.class);",
"type": "Logger",
"var_name": "_logger"
... | {
"body": "public void register(final Set<Instance> instances) {\n if (CollectionUtils.isEmpty(instances)) {\n return;\n }\n _client.unregister(instances);\n updateInstances(instances, RegisterType.register);\n }",
"class_method_signature": "InstanceRepository.register(fina... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_42 | {
"fields": [
{
"declarator": "groupDao = GroupDao.INSTANCE",
"modifier": "private final",
"original_string": "private final GroupDao groupDao = GroupDao.INSTANCE;",
"type": "GroupDao",
"var_name": "groupDao"
},
{
"declarator": "random = new SecureRandom()",
"modi... | {
"body": "@Test\n public void testSelect() {\n GroupModel group = newGroup();\n groupDao.insertOrUpdate(group);\n GroupModel filter = new GroupModel();\n filter.setServiceId(group.getServiceId());\n filter.setName(group.getName());\n GroupModel newGroup = groupDao.select(... | {
"fields": [
{
"declarator": "INSTANCE = new GroupDao()",
"modifier": "public static final",
"original_string": "public static final GroupDao INSTANCE = new GroupDao();",
"type": "GroupDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/src/main/java/com/ctrip/soa/... | {
"body": "public List<GroupModel> select(GroupModel filter) {\n ValueCheckers.notNull(filter, \"filter\");\n Map<String, String> conditions = Maps.newHashMap();\n conditions.put(\"id=?\", filter.getId() == null ? null : Long.toString(filter.getId()));\n conditions.put(\"service_id=?\", fi... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_39 | {
"fields": [
{
"declarator": "groupDao = GroupDao.INSTANCE",
"modifier": "private final",
"original_string": "private final GroupDao groupDao = GroupDao.INSTANCE;",
"type": "GroupDao",
"var_name": "groupDao"
},
{
"declarator": "random = new SecureRandom()",
"modi... | {
"body": "@Test\n public void testGenerateGroup() {\n GroupModel group = newGroup();\n GroupModel newGroup = groupDao.generateGroup(group);\n Assert.assertNotNull(newGroup.getId());\n assertGroup(newGroup, group);\n }",
"class_method_signature": "GroupDaoTest.testGenerateGroup()",... | {
"fields": [
{
"declarator": "INSTANCE = new GroupDao()",
"modifier": "public static final",
"original_string": "public static final GroupDao INSTANCE = new GroupDao();",
"type": "GroupDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/src/main/java/com/ctrip/soa/... | {
"body": "protected GroupModel generateGroup(GroupModel group) {\n GroupModel filter = new GroupModel();\n filter.setServiceId(group.getServiceId());\n filter.setRegionId(group.getRegionId());\n filter.setZoneId(group.getZoneId());\n filter.setName(group.getName());\n List<G... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_81 | {
"fields": [],
"file": "artemis-common/src/test/java/com/ctrip/soa/artemis/util/ServiceGroupsTest.java",
"identifier": "ServiceGroupsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFixWeight() {\n Assert.assertEquals(ServiceGroups.DEFAULT_WEIGHT_VALUE, ServiceGroups.fixWeight(null));\n Assert.assertEquals(ServiceGroups.MIN_WEIGHT_VALUE, ServiceGroups.fixWeight(ServiceGroups.MIN_WEIGHT_VALUE));\n Assert.assertEquals(ServiceGroups.MAX_WEI... | {
"fields": [
{
"declarator": "DEFAULT_GROUP_ID = \"default\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_GROUP_ID = \"default\";",
"type": "String",
"var_name": "DEFAULT_GROUP_ID"
},
{
"declarator": "MAX_WEIGHT_VALUE = 10... | {
"body": "public static int fixWeight(Integer weight) {\n if (weight == null || weight < MIN_WEIGHT_VALUE) {\n return DEFAULT_WEIGHT_VALUE;\n }\n\n if (weight > MAX_WEIGHT_VALUE) {\n return MAX_WEIGHT_VALUE;\n }\n\n return weight;\n }",
"class_method_sign... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_78 | {
"fields": [
{
"declarator": "tree",
"modifier": "private",
"original_string": "private SearchTree<String,String> tree;",
"type": "SearchTree<String,String>",
"var_name": "tree"
},
{
"declarator": "key1 = Lists.newArrayList(\"10\")",
"modifier": "private",
... | {
"body": "@Test\n public void testGet() throws Exception {\n Assert.assertNull(tree.get(null));\n Assert.assertNull(tree.get(new ArrayList<String>()));\n Assert.assertEquals(\"key1\", tree.get(key1));\n Assert.assertEquals(null, tree.get(key2));\n Assert.assertEquals(\"key3\", t... | {
"fields": [
{
"declarator": "children = Maps.newHashMap()",
"modifier": "private final",
"original_string": "private final Map<K, SearchTree<K, V>> children = Maps.newHashMap();",
"type": "Map<K, SearchTree<K, V>>",
"var_name": "children"
},
{
"declarator": "value",
... | {
"body": "public V get(List<K> cascadingFactors) {\n if (CollectionValues.isNullOrEmpty(cascadingFactors)) {\n return value;\n }\n List<K> factors = Lists.newArrayList(cascadingFactors);\n SearchTree<K, V> g = children.get(factors.remove(0));\n if (g == null) {\n ... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_79 | {
"fields": [
{
"declarator": "tree",
"modifier": "private",
"original_string": "private SearchTree<String,String> tree;",
"type": "SearchTree<String,String>",
"var_name": "tree"
},
{
"declarator": "key1 = Lists.newArrayList(\"10\")",
"modifier": "private",
... | {
"body": "@Test\n public void testAdd() throws Exception {\n SearchTree<String,String> tree = new SearchTree<>();\n tree.add(null, null);\n }",
"class_method_signature": "SearchTreeTest.testAdd()",
"constructor": false,
"full_signature": "@Test public void testAdd()",
"identifier": "testA... | {
"fields": [
{
"declarator": "children = Maps.newHashMap()",
"modifier": "private final",
"original_string": "private final Map<K, SearchTree<K, V>> children = Maps.newHashMap();",
"type": "Map<K, SearchTree<K, V>>",
"var_name": "children"
},
{
"declarator": "value",
... | {
"body": "public void add(List<K> cascadingFactors, V value) {\n if (CollectionValues.isNullOrEmpty(cascadingFactors)) {\n this.value = value;\n return;\n }\n List<K> factors = Lists.newArrayList(cascadingFactors);\n K factor = factors.remove(0);\n ValueChecke... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_80 | {
"fields": [
{
"declarator": "tree",
"modifier": "private",
"original_string": "private SearchTree<String,String> tree;",
"type": "SearchTree<String,String>",
"var_name": "tree"
},
{
"declarator": "key1 = Lists.newArrayList(\"10\")",
"modifier": "private",
... | {
"body": "@Test\n public void testFirst() throws Exception {\n Assert.assertNull(tree.first(null));\n Assert.assertNull(tree.first(new ArrayList<String>()));\n Assert.assertEquals(\"key1\", tree.first(key1));\n Assert.assertEquals(\"key1\", tree.first(key2));\n Assert.assertEqua... | {
"fields": [
{
"declarator": "children = Maps.newHashMap()",
"modifier": "private final",
"original_string": "private final Map<K, SearchTree<K, V>> children = Maps.newHashMap();",
"type": "Map<K, SearchTree<K, V>>",
"var_name": "children"
},
{
"declarator": "value",
... | {
"body": "public V first(List<K> cascadingFactors) {\n if (value != null || CollectionValues.isNullOrEmpty(cascadingFactors)) {\n return value;\n }\n List<K> factors = Lists.newArrayList(cascadingFactors);\n SearchTree<K, V> g = children.get(factors.remove(0));\n if (g =... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_38 | {
"fields": [
{
"declarator": "routeRuleLogDao = RouteRuleLogDao.INSTANCE",
"modifier": "private",
"original_string": "private RouteRuleLogDao routeRuleLogDao = RouteRuleLogDao.INSTANCE;",
"type": "RouteRuleLogDao",
"var_name": "routeRuleLogDao"
},
{
"declarator": "rand... | {
"body": "@Test\n public void testInsert() {\n final RouteRuleLogModel log1 = newModel();\n final RouteRuleLogModel log2 = newModel();\n final List<RouteRuleLogModel> logs = Lists.newArrayList(log1, log2);\n routeRuleLogDao.insert(log1, log2);\n for (final RouteRuleLogModel log ... | {
"fields": [
{
"declarator": "INSTANCE = new RouteRuleLogDao()",
"modifier": "public static final",
"original_string": "public static final RouteRuleLogDao INSTANCE = new RouteRuleLogDao();",
"type": "RouteRuleLogDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/... | {
"body": "public void insert(final RouteRuleLogModel... logs) {\n if ((logs == null) || (logs.length == 0)) {\n return;\n }\n this.insert(Lists.newArrayList(logs));\n }",
"class_method_signature": "RouteRuleLogDao.insert(final RouteRuleLogModel... logs)",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_43 | {
"fields": [
{
"declarator": "serviceInstanceLogDao = ServiceInstanceLogDao.INSTANCE",
"modifier": "private",
"original_string": "private ServiceInstanceLogDao serviceInstanceLogDao = ServiceInstanceLogDao.INSTANCE;",
"type": "ServiceInstanceLogDao",
"var_name": "serviceInstanceLogD... | {
"body": "@Test\n public void testInsert() {\n final ServiceInstanceLogModel log1 = newModel();\n final ServiceInstanceLogModel log2 = newModel();\n final List<ServiceInstanceLogModel> logs = Lists.newArrayList(log1, log2);\n serviceInstanceLogDao.insert(log1, log2);\n for (fina... | {
"fields": [
{
"declarator": "INSTANCE = new ServiceInstanceLogDao()",
"modifier": "public static final",
"original_string": "public static final ServiceInstanceLogDao INSTANCE = new ServiceInstanceLogDao();",
"type": "ServiceInstanceLogDao",
"var_name": "INSTANCE"
}
],
"fil... | {
"body": "protected void insert(final ServiceInstanceLogModel... logs) {\n if ((logs == null) || (logs.length == 0)) {\n return;\n }\n this.insert(Lists.newArrayList(logs));\n }",
"class_method_signature": "ServiceInstanceLogDao.insert(final ServiceInstanceLogModel... logs)",
"... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_14 | {
"fields": [
{
"declarator": "client = new ArtemisRegistryHttpClient(ArtemisClientConstants.RegistryClientConfig)",
"modifier": "private static final",
"original_string": "private static final ArtemisRegistryHttpClient client = new ArtemisRegistryHttpClient(ArtemisClientConstants.RegistryClient... | {
"body": "@Test\n public void testUnregister() throws Exception {\n client.unregister(Instances.newInstances(3));\n }",
"class_method_signature": "ArtemisRegistryHttpClientTest.testUnregister()",
"constructor": false,
"full_signature": "@Test public void testUnregister()",
"identifier": "testUnr... | {
"fields": [],
"file": "artemis-client/src/main/java/com/ctrip/soa/artemis/client/registry/ArtemisRegistryHttpClient.java",
"identifier": "ArtemisRegistryHttpClient",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArtemisRegistryHttpClient.ArtemisRegistryHttpClient(final ArtemisClientC... | {
"body": "public void unregister(final Set<Instance> instances) {\n try {\n Preconditions.checkArgument(!CollectionUtils.isEmpty(instances), \"instances\");\n final UnregisterRequest request = new UnregisterRequest(Lists.newArrayList(instances));\n final UnregisterResponse res... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_55 | {
"fields": [
{
"declarator": "businessDao = BusinessDao.INSTANCE",
"modifier": "private final",
"original_string": "private final BusinessDao businessDao = BusinessDao.INSTANCE;",
"type": "BusinessDao",
"var_name": "businessDao"
},
{
"declarator": "routeRuleDao = Route... | {
"body": "@Test\n public void testCreateServiceRouteRules() {\n OperationContext operator = newOperationContext();\n String serviceId = new BigInteger(130, random).toString(32);\n List<RouteRuleInfo> routeRuleInfos = newRouteRuleInfos(serviceId);\n businessDao.createServiceRouteRules(o... | {
"fields": [
{
"declarator": "INSTANCE = new BusinessDao()",
"modifier": "public static final",
"original_string": "public static final BusinessDao INSTANCE = new BusinessDao();",
"type": "BusinessDao",
"var_name": "INSTANCE"
},
{
"declarator": "routeRuleDao = RouteRul... | {
"body": "@Transactional\n public void createServiceRouteRules(OperationContext operationContext, final String serviceId, List<RouteRuleInfo> routeRuleInfos) {\n checkServiceRouteRules(serviceId, routeRuleInfos);\n\n List<RouteRuleModel> routeRuleModels = Lists.newArrayList();\n Map<String, G... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_22 | {
"fields": [
{
"declarator": "_addressRepository = new AddressRepository(ArtemisClientConstants.ClientId, ArtemisClientConstants.ManagerConfig,\n RestPaths.CLUSTER_UP_DISCOVERY_NODES_FULL_PATH)",
"modifier": "private final",
"original_string": "private final AddressRepository _addres... | {
"body": "@Test\n public void testRefresh() {\n _addressRepository.refresh();\n Assert.assertNotNull(_addressRepository.get());\n }",
"class_method_signature": "AddressRepositoryTest.testRefresh()",
"constructor": false,
"full_signature": "@Test public void testRefresh()",
"identifier": "... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(AddressRepository.class)",
"modifier": "private static final",
"original_string": "private static final Logger _logger = LoggerFactory.getLogger(AddressRepository.class);",
"type": "Logger",
"var_name": "_logger"
},... | {
"body": "protected void refresh() {\n try {\n _logger.info(\"start refresh service urls\");\n String domainUrl = _domainUrl.typedValue();\n if (StringValues.isNullOrWhitespace(domainUrl)) {\n _logger.error(\"domain url should not be null or empty for artemis cl... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_75 | {
"fields": [
{
"declarator": "zoneOperationDao = ZoneOperationDao.INSTANCE",
"modifier": "",
"original_string": "ZoneOperationDao zoneOperationDao = ZoneOperationDao.INSTANCE;",
"type": "ZoneOperationDao",
"var_name": "zoneOperationDao"
},
{
"declarator": "random = new... | {
"body": "@Test\n public void testInsertOrUpdate() {\n ZoneOperationModel zone = newZoneOperation();\n zoneOperationDao.insertOrUpdate(zone);\n assertZoneOperation(zone, query(zone));\n zoneOperationDao.insertOrUpdate(zone);\n assertZoneOperation(zone, query(zone));\n }",
"... | {
"fields": [
{
"declarator": "INSTANCE = new ZoneOperationDao()",
"modifier": "public static final",
"original_string": "public static final ZoneOperationDao INSTANCE = new ZoneOperationDao();",
"type": "ZoneOperationDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-managem... | {
"body": "public void insertOrUpdate(ZoneOperationModel... operationModels) {\n insertOrUpdate(Lists.newArrayList(operationModels));\n }",
"class_method_signature": "ZoneOperationDao.insertOrUpdate(ZoneOperationModel... operationModels)",
"constructor": false,
"full_signature": "public void insertOrU... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_63 | {
"fields": [
{
"declarator": "groupInstanceDao = GroupInstanceDao.INSTANCE",
"modifier": "private final",
"original_string": "private final GroupInstanceDao groupInstanceDao = GroupInstanceDao.INSTANCE;",
"type": "GroupInstanceDao",
"var_name": "groupInstanceDao"
},
{
... | {
"body": "@Test\n public void testSelect() {\n GroupInstanceModel groupInstance = newGroupInstance();\n groupInstanceDao.insert(groupInstance);\n GroupInstanceModel filter = new GroupInstanceModel();\n filter.setGroupId(groupInstance.getGroupId());\n filter.setInstanceId(groupIn... | {
"fields": [
{
"declarator": "INSTANCE = new GroupInstanceDao()",
"modifier": "public static final",
"original_string": "public static final GroupInstanceDao INSTANCE = new GroupInstanceDao();",
"type": "GroupInstanceDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-managem... | {
"body": "public List<GroupInstanceModel> select(GroupInstanceModel filter) {\n ValueCheckers.notNull(filter, \"filter\");\n Map<String, String> conditions = Maps.newHashMap();\n conditions.put(\"id=?\", filter.getId() == null ? null : Long.toString(filter.getId()));\n conditions.put(\"gr... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_34 | {
"fields": [
{
"declarator": "serverDao = ServerDao.INSTANCE",
"modifier": "private final",
"original_string": "private final ServerDao serverDao = ServerDao.INSTANCE;",
"type": "ServerDao",
"var_name": "serverDao"
}
],
"file": "artemis-management/src/test/java/com/ctrip/soa... | {
"body": "@Test\n public void testDestroyServers() {\n final ServerModel server1 = ServerModels.newServerModel();\n final ServerModel server2 = ServerModels.newServerModel();\n serverDao.insert(server1, server2);\n Assert.assertTrue(query(server1).size() == 1);\n Assert.assertTr... | {
"fields": [
{
"declarator": "INSTANCE = new ServerDao()",
"modifier": "public static final",
"original_string": "public static final ServerDao INSTANCE = new ServerDao();",
"type": "ServerDao",
"var_name": "INSTANCE"
},
{
"declarator": "queryServerSql = \"select disti... | {
"body": "public void destroyServers(final List<ServerKey> serverKeys) {\n if (CollectionUtils.isEmpty(serverKeys)) {\n return;\n }\n DataConfig.jdbcTemplate().batchUpdate(\"delete from server where region_id=? and server_id=?\",\n new BatchPreparedStatementSetter() {\n... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_18 | {
"fields": [
{
"declarator": "addr = ArtemisClientConstants.DiscoveryClientConfig.addressManager()",
"modifier": "private final",
"original_string": "private final AddressManager addr = ArtemisClientConstants.DiscoveryClientConfig.addressManager();",
"type": "AddressManager",
"var_n... | {
"body": "@Test\n public void testMarkUnavailable() throws InterruptedException, ExecutionException, TimeoutException{\n final AddressContext context = addr.getContext();\n Assert.assertTrue(context.isAavailable());\n context.markUnavailable();\n Assert.assertFalse(context.isAavailable... | {
"fields": [
{
"declarator": "_addressContext = new AtomicReference<AddressContext>()",
"modifier": "private final",
"original_string": "private final AtomicReference<AddressContext> _addressContext = new AtomicReference<AddressContext>();",
"type": "AtomicReference<AddressContext>",
... | {
"body": "public AddressContext getContext() {\n AddressContext context = _addressContext.get();\n if (!context.isAavailable() || context.isExpired()) {\n context = newAddressContext();\n _addressContext.set(context);\n }\n return context;\n }",
"class_method_si... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_6 | {
"fields": [
{
"declarator": "_client = new ArtemisDiscoveryHttpClient(ArtemisClientConstants.DiscoveryClientConfig)",
"modifier": "private final",
"original_string": "private final ArtemisDiscoveryHttpClient _client = new ArtemisDiscoveryHttpClient(ArtemisClientConstants.DiscoveryClientConfig)... | {
"body": "@Test\n public void testGetService_ShouldReturnEmptyInstances() {\n Assert.assertTrue(CollectionUtils.isEmpty(_client.getService(Services.newDiscoverConfig()).getInstances()));\n }",
"class_method_signature": "ArtemisDiscoveryHttpClientTest.testGetService_ShouldReturnEmptyInstances()",
"co... | {
"fields": [],
"file": "artemis-client/src/main/java/com/ctrip/soa/artemis/client/discovery/ArtemisDiscoveryHttpClient.java",
"identifier": "ArtemisDiscoveryHttpClient",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArtemisDiscoveryHttpClient.ArtemisDiscoveryHttpClient(final ArtemisCl... | {
"body": "public Service getService(final DiscoveryConfig discoveryConfig) {\n Preconditions.checkArgument(discoveryConfig != null, \"discoveryConfig\");\n final List<Service> services = getServices(Lists.newArrayList(discoveryConfig));\n if (services.size() > 0) {\n return services.g... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_59 | {
"fields": [
{
"declarator": "groupOperationDao = GroupOperationDao.INSTANCE",
"modifier": "private final",
"original_string": "private final GroupOperationDao groupOperationDao = GroupOperationDao.INSTANCE;",
"type": "GroupOperationDao",
"var_name": "groupOperationDao"
},
{... | {
"body": "@Test\n public void testDelete() throws Exception {\n GroupOperationModel groupOperation = newGroupOperation();\n groupOperationDao.insertOrUpdate(groupOperation);\n assertGroupOperation(groupOperation, query(groupOperation));\n groupOperationDao.delete(groupOperation);\n ... | {
"fields": [
{
"declarator": "INSTANCE = new GroupOperationDao()",
"modifier": "public static final",
"original_string": "public static final GroupOperationDao INSTANCE = new GroupOperationDao();",
"type": "GroupOperationDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-man... | {
"body": "protected void delete(GroupOperationModel groupOperation) {\n delete(Lists.newArrayList(groupOperation));\n }",
"class_method_signature": "GroupOperationDao.delete(GroupOperationModel groupOperation)",
"constructor": false,
"full_signature": "protected void delete(GroupOperationModel groupO... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_52 | {
"fields": [
{
"declarator": "serviceInstanceDao = ServiceInstanceDao.INSTANCE",
"modifier": "private final",
"original_string": "private final ServiceInstanceDao serviceInstanceDao = ServiceInstanceDao.INSTANCE;",
"type": "ServiceInstanceDao",
"var_name": "serviceInstanceDao"
}... | {
"body": "@Test\n public void testDelete() throws Exception {\n ServiceInstanceModel serviceInstance = newServiceInstance();\n serviceInstanceDao.insertOrUpdate(serviceInstance);\n ServiceInstanceModel newServiceInstance = query(serviceInstance);\n assertServiceInstance(serviceInstance... | {
"fields": [
{
"declarator": "INSTANCE = new ServiceInstanceDao()",
"modifier": "public static final",
"original_string": "public static final ServiceInstanceDao INSTANCE = new ServiceInstanceDao();",
"type": "ServiceInstanceDao",
"var_name": "INSTANCE"
}
],
"file": "artemis... | {
"body": "protected void delete(final Long... ids) {\n delete(Lists.newArrayList(ids));\n }",
"class_method_signature": "ServiceInstanceDao.delete(final Long... ids)",
"constructor": false,
"full_signature": "protected void delete(final Long... ids)",
"identifier": "delete",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_13 | {
"fields": [
{
"declarator": "client = new ArtemisRegistryHttpClient(ArtemisClientConstants.RegistryClientConfig)",
"modifier": "private static final",
"original_string": "private static final ArtemisRegistryHttpClient client = new ArtemisRegistryHttpClient(ArtemisClientConstants.RegistryClient... | {
"body": "@Test\n public void testRegister() throws Exception {\n client.register(Instances.newInstances(3));\n }",
"class_method_signature": "ArtemisRegistryHttpClientTest.testRegister()",
"constructor": false,
"full_signature": "@Test public void testRegister()",
"identifier": "testRegister",
... | {
"fields": [],
"file": "artemis-client/src/main/java/com/ctrip/soa/artemis/client/registry/ArtemisRegistryHttpClient.java",
"identifier": "ArtemisRegistryHttpClient",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArtemisRegistryHttpClient.ArtemisRegistryHttpClient(final ArtemisClientC... | {
"body": "public void register(final Set<Instance> instances) {\n try {\n Preconditions.checkArgument(!CollectionUtils.isEmpty(instances), \"instances\");\n final RegisterRequest request = new RegisterRequest(Lists.newArrayList(instances));\n final RegisterResponse response = ... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_44 | {
"fields": [
{
"declarator": "groupTagDao = GroupTagDao.INSTANCE",
"modifier": "private final",
"original_string": "private final GroupTagDao groupTagDao = GroupTagDao.INSTANCE;",
"type": "GroupTagDao",
"var_name": "groupTagDao"
},
{
"declarator": "random = new SecureR... | {
"body": "@Test\n public void testQuery() throws Exception {\n groupTagDao.insertOrUpdate(newGroupTag());\n groupTagDao.insertOrUpdate(newGroupTag());\n Assert.assertTrue(groupTagDao.query().size() >= 2);\n }",
"class_method_signature": "GroupTagDaoTest.testQuery()",
"constructor": fal... | {
"fields": [
{
"declarator": "INSTANCE = new GroupTagDao()",
"modifier": "public static final",
"original_string": "public static final GroupTagDao INSTANCE = new GroupTagDao();",
"type": "GroupTagDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/src/main/java/co... | {
"body": "public List<GroupTagModel> query() {\n return DataConfig.jdbcTemplate().query(\"select group_id, tag, value from service_group_tag\",\n new RowMapper<GroupTagModel>() {\n @Override\n public GroupTagModel mapRow(ResultSet rs, int i) throws SQLExcep... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_68 | {
"fields": [
{
"declarator": "routeRuleGroupDao = RouteRuleGroupDao.INSTANCE",
"modifier": "private final",
"original_string": "private final RouteRuleGroupDao routeRuleGroupDao = RouteRuleGroupDao.INSTANCE;",
"type": "RouteRuleGroupDao",
"var_name": "routeRuleGroupDao"
},
{... | {
"body": "@Test\n public void testRelease() {\n for (RouteRuleGroupModel routeRuleGroup : newRouteRuleGroups()) {\n routeRuleGroupDao.insertOrUpdate(routeRuleGroup);\n RouteRuleGroupModel valueBeforeReleased = query(routeRuleGroup);\n assertRouteRuleGroup(routeRuleGroup, va... | {
"fields": [
{
"declarator": "INSTANCE = new RouteRuleGroupDao()",
"modifier": "public static final",
"original_string": "public static final RouteRuleGroupDao INSTANCE = new RouteRuleGroupDao();",
"type": "RouteRuleGroupDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-man... | {
"body": "protected void release(final List<RouteRuleGroupModel> models) {\n checkReleaseArgument(models);\n DataConfig.jdbcTemplate().batchUpdate(\"update service_route_rule_group set weight = unreleased_weight where route_rule_id=? and group_id=?\",\n new BatchPreparedStatementSetter()... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_29 | {
"fields": [
{
"declarator": "registrySessionConnected = new CountDownLatch(1)",
"modifier": "private final",
"original_string": "private final CountDownLatch registrySessionConnected = new CountDownLatch(1);",
"type": "CountDownLatch",
"var_name": "registrySessionConnected"
},
... | {
"body": "@Test\n public void testCheckHealth() {\n registrySessionIsExpired.set(true);\n registrySessionContext.checkHealth();\n registrySessionIsExpired.set(false);\n }",
"class_method_signature": "WebSocketSessionContextTest.testCheckHealth()",
"constructor": false,
"full_signatur... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(WebSocketSessionContext.class)",
"modifier": "private static final",
"original_string": "private static final Logger _logger = LoggerFactory.getLogger(WebSocketSessionContext.class);",
"type": "Logger",
"var_name": "_lo... | {
"body": "public void checkHealth() {\n if (_isChecking.compareAndSet(false, true)) {\n try {\n boolean available = _addressContext.get().isAavailable()\n && !isExpired()\n && isAvailable();\n\n if (!available) {\n ... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_1 | {
"fields": [
{
"declarator": "_serviceId = Services.newServiceId()",
"modifier": "private final",
"original_string": "private final String _serviceId = Services.newServiceId();",
"type": "String",
"var_name": "_serviceId"
},
{
"declarator": "_discoveryConfig = new Disc... | {
"body": "@Test\n public void testDeleteInstance() {\n ServiceContext context = new ServiceContext(_discoveryConfig);\n Instance instance1 = Instances.newInstance(_serviceId);\n Assert.assertTrue(context.addInstance(instance1));\n Assert.assertEquals(1, context.newService().getInstance... | {
"fields": [
{
"declarator": "discoveryConfig",
"modifier": "private final",
"original_string": "private final DiscoveryConfig discoveryConfig;",
"type": "DiscoveryConfig",
"var_name": "discoveryConfig"
},
{
"declarator": "serviceId",
"modifier": "private final",... | {
"body": "public synchronized boolean deleteInstance(Instance instance) {\n if (instance == null)\n return false;\n\n List<Instance> instances = service.getInstances();\n if (instances == null)\n return false;\n\n return instances.remove(instance);\n }",
"class_... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_48 | {
"fields": [
{
"declarator": "routeRuleDao = RouteRuleDao.INSTANCE",
"modifier": "private final",
"original_string": "private final RouteRuleDao routeRuleDao = RouteRuleDao.INSTANCE;",
"type": "RouteRuleDao",
"var_name": "routeRuleDao"
},
{
"declarator": "random = new ... | {
"body": "@Test\n public void testInsertOrUpdate() {\n RouteRuleModel routeRule = newRouteRule();\n routeRuleDao.insertOrUpdate(routeRule);\n assertRouteRule(routeRule, query(routeRule));\n routeRuleDao.insertOrUpdate(routeRule);\n assertRouteRule(routeRule, query(routeRule));\n... | {
"fields": [
{
"declarator": "INSTANCE = new RouteRuleDao()",
"modifier": "public static final",
"original_string": "public static final RouteRuleDao INSTANCE = new RouteRuleDao();",
"type": "RouteRuleDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/src/main/jav... | {
"body": "protected void insertOrUpdate(RouteRuleModel... models) {\n insertOrUpdate(Lists.newArrayList(models));\n }",
"class_method_signature": "RouteRuleDao.insertOrUpdate(RouteRuleModel... models)",
"constructor": false,
"full_signature": "protected void insertOrUpdate(RouteRuleModel... models)",... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_33 | {
"fields": [
{
"declarator": "serverDao = ServerDao.INSTANCE",
"modifier": "private final",
"original_string": "private final ServerDao serverDao = ServerDao.INSTANCE;",
"type": "ServerDao",
"var_name": "serverDao"
}
],
"file": "artemis-management/src/test/java/com/ctrip/soa... | {
"body": "@Test\n public void testInsert() {\n final ServerModel server1 = ServerModels.newServerModel();\n final ServerModel server2 = ServerModels.newServerModel();\n final List<ServerModel> servers = Lists.newArrayList(server1, server2);\n serverDao.insert(server1, server2);\n ... | {
"fields": [
{
"declarator": "INSTANCE = new ServerDao()",
"modifier": "public static final",
"original_string": "public static final ServerDao INSTANCE = new ServerDao();",
"type": "ServerDao",
"var_name": "INSTANCE"
},
{
"declarator": "queryServerSql = \"select disti... | {
"body": "public void insert(final ServerModel... servers) {\n if ((servers == null) || (servers.length == 0)) {\n return;\n }\n this.insert(Lists.newArrayList(servers));\n }",
"class_method_signature": "ServerDao.insert(final ServerModel... servers)",
"constructor": false,
"... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_64 | {
"fields": [
{
"declarator": "routeRuleGroupDao = RouteRuleGroupDao.INSTANCE",
"modifier": "private final",
"original_string": "private final RouteRuleGroupDao routeRuleGroupDao = RouteRuleGroupDao.INSTANCE;",
"type": "RouteRuleGroupDao",
"var_name": "routeRuleGroupDao"
},
{... | {
"body": "@Test\n public void testInsertOrUpdate() {\n for (RouteRuleGroupModel routeRuleGroup : newRouteRuleGroups()) {\n routeRuleGroupDao.insertOrUpdate(routeRuleGroup);\n assertRouteRuleGroup(routeRuleGroup, query(routeRuleGroup));\n routeRuleGroup.setUnreleasedWeight(n... | {
"fields": [
{
"declarator": "INSTANCE = new RouteRuleGroupDao()",
"modifier": "public static final",
"original_string": "public static final RouteRuleGroupDao INSTANCE = new RouteRuleGroupDao();",
"type": "RouteRuleGroupDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-man... | {
"body": "protected void insertOrUpdate(final RouteRuleGroupModel... models) {\n insertOrUpdate(Lists.newArrayList(models));\n }",
"class_method_signature": "RouteRuleGroupDao.insertOrUpdate(final RouteRuleGroupModel... models)",
"constructor": false,
"full_signature": "protected void insertOrUpdate(... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_72 | {
"fields": [
{
"declarator": "groupInstanceLogDao = GroupInstanceLogDao.INSTANCE",
"modifier": "private",
"original_string": "private GroupInstanceLogDao groupInstanceLogDao = GroupInstanceLogDao.INSTANCE;",
"type": "GroupInstanceLogDao",
"var_name": "groupInstanceLogDao"
},
... | {
"body": "@Test\n public void testInsert() {\n final GroupInstanceLogModel log1 = newModel();\n final GroupInstanceLogModel log2 = newModel();\n final List<GroupInstanceLogModel> logs = Lists.newArrayList(log1, log2);\n groupInstanceLogDao.insert(log1, log2);\n for (final GroupI... | {
"fields": [
{
"declarator": "INSTANCE = new GroupInstanceLogDao()",
"modifier": "public static final",
"original_string": "public static final GroupInstanceLogDao INSTANCE = new GroupInstanceLogDao();",
"type": "GroupInstanceLogDao",
"var_name": "INSTANCE"
}
],
"file": "art... | {
"body": "protected void insert(final GroupInstanceLogModel... logs) {\n if ((logs == null) || (logs.length == 0)) {\n return;\n }\n this.insert(Lists.newArrayList(logs));\n }",
"class_method_signature": "GroupInstanceLogDao.insert(final GroupInstanceLogModel... logs)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_25 | {
"fields": [],
"file": "artemis-client/src/test/java/com/ctrip/soa/artemis/client/common/ConditionsTest.java",
"identifier": "ConditionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void verifyService() {\n {\n Assert.assertFalse(Conditions.verifyService(new Service()));\n }\n\n {\n Assert.assertTrue(Conditions.verifyService(new Service(Services.newServiceId())));\n }\n }",
"class_method_signature": "ConditionsTe... | {
"fields": [],
"file": "artemis-client/src/main/java/com/ctrip/soa/artemis/client/common/Conditions.java",
"identifier": "Conditions",
"interfaces": "",
"methods": [
{
"class_method_signature": "Conditions.verifyInstance(final Instance instance)",
"constructor": false,
"full_signature":... | {
"body": "public static boolean verifyService(final Service service) {\n return (service != null)\n && !StringValues.isNullOrWhitespace(service.getServiceId());\n }",
"class_method_signature": "Conditions.verifyService(final Service service)",
"constructor": false,
"full_signature": "p... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_24 | {
"fields": [],
"file": "artemis-client/src/test/java/com/ctrip/soa/artemis/client/common/ConditionsTest.java",
"identifier": "ConditionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void verifyInstances() {\n {\n final Instance[] instances = new Instance[]{Instances.newInstance(), new Instance()};\n Assert.assertFalse(Conditions.verifyInstances(instances));\n Assert.assertFalse(Conditions.verifyInstances(Lists.newArrayList(inst... | {
"fields": [],
"file": "artemis-client/src/main/java/com/ctrip/soa/artemis/client/common/Conditions.java",
"identifier": "Conditions",
"interfaces": "",
"methods": [
{
"class_method_signature": "Conditions.verifyInstance(final Instance instance)",
"constructor": false,
"full_signature":... | {
"body": "public static boolean verifyInstances(final Instance[] instances) {\n if ((instances == null) || (instances.length == 0)) {\n return false;\n }\n for (final Instance instance : instances) {\n if (!verifyInstance(instance)) {\n return false;\n ... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_73 | {
"fields": [
{
"declarator": "groupLogDao = GroupLogDao.INSTANCE",
"modifier": "private",
"original_string": "private GroupLogDao groupLogDao = GroupLogDao.INSTANCE;",
"type": "GroupLogDao",
"var_name": "groupLogDao"
},
{
"declarator": "random = new SecureRandom()",
... | {
"body": "@Test\n public void testInsert() {\n final GroupLogModel log1 = newModel();\n final GroupLogModel log2 = newModel();\n final List<GroupLogModel> logs = Lists.newArrayList(log1, log2);\n groupLogDao.insert(log1, log2);\n for (final GroupLogModel log : logs) {\n ... | {
"fields": [
{
"declarator": "INSTANCE = new GroupLogDao()",
"modifier": "public static final",
"original_string": "public static final GroupLogDao INSTANCE = new GroupLogDao();",
"type": "GroupLogDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/src/main/java/co... | {
"body": "public void insert(final GroupLogModel... logs) {\n if ((logs == null) || (logs.length == 0)) {\n return;\n }\n this.insert(Lists.newArrayList(logs));\n }",
"class_method_signature": "GroupLogDao.insert(final GroupLogModel... logs)",
"constructor": false,
"full_sign... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_65 | {
"fields": [
{
"declarator": "routeRuleGroupDao = RouteRuleGroupDao.INSTANCE",
"modifier": "private final",
"original_string": "private final RouteRuleGroupDao routeRuleGroupDao = RouteRuleGroupDao.INSTANCE;",
"type": "RouteRuleGroupDao",
"var_name": "routeRuleGroupDao"
},
{... | {
"body": "@Test\n public void testInsert() {\n for (RouteRuleGroupModel routeRuleGroup : newRouteRuleGroups()) {\n routeRuleGroupDao.insert(routeRuleGroup);\n assertRouteRuleGroup(routeRuleGroup, query(routeRuleGroup));\n routeRuleGroup.setUnreleasedWeight(null);\n ... | {
"fields": [
{
"declarator": "INSTANCE = new RouteRuleGroupDao()",
"modifier": "public static final",
"original_string": "public static final RouteRuleGroupDao INSTANCE = new RouteRuleGroupDao();",
"type": "RouteRuleGroupDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-man... | {
"body": "protected void insert(final RouteRuleGroupModel... models) {\n insert(Lists.newArrayList(models));\n }",
"class_method_signature": "RouteRuleGroupDao.insert(final RouteRuleGroupModel... models)",
"constructor": false,
"full_signature": "protected void insert(final RouteRuleGroupModel... mod... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_32 | {
"fields": [
{
"declarator": "_serverLogDao = ServerLogDao.INSTANCE",
"modifier": "",
"original_string": "ServerLogDao _serverLogDao = ServerLogDao.INSTANCE;",
"type": "ServerLogDao",
"var_name": "_serverLogDao"
}
],
"file": "artemis-management/src/test/java/com/ctrip/soa/ar... | {
"body": "@Test\n public void testInsert() {\n final ServerLogModel log1 = ServerLogModels.newServerLogModel();\n final ServerLogModel log2 = ServerLogModels.newServerLogModel();\n final List<ServerLogModel> logs = Lists.newArrayList(log1, log2);\n\n log1.setComplete(true);\n lo... | {
"fields": [
{
"declarator": "INSTANCE = new ServerLogDao()",
"modifier": "public static final",
"original_string": "public static final ServerLogDao INSTANCE = new ServerLogDao();",
"type": "ServerLogDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/src/main/jav... | {
"body": "public void insert(final ServerLogModel... logs) {\n if ((logs == null) || (logs.length == 0)) {\n return;\n }\n this.insert(Lists.newArrayList(logs));\n }",
"class_method_signature": "ServerLogDao.insert(final ServerLogModel... logs)",
"constructor": false,
"full_s... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_49 | {
"fields": [
{
"declarator": "routeRuleDao = RouteRuleDao.INSTANCE",
"modifier": "private final",
"original_string": "private final RouteRuleDao routeRuleDao = RouteRuleDao.INSTANCE;",
"type": "RouteRuleDao",
"var_name": "routeRuleDao"
},
{
"declarator": "random = new ... | {
"body": "@Test\n public void testDelete() {\n RouteRuleModel routeRule = newRouteRule();\n routeRuleDao.insertOrUpdate(routeRule);\n RouteRuleModel copy1 = query(routeRule);\n routeRuleDao.delete(copy1.getId());\n Assert.assertNull(query(routeRule, 0));\n routeRuleDao.in... | {
"fields": [
{
"declarator": "INSTANCE = new RouteRuleDao()",
"modifier": "public static final",
"original_string": "public static final RouteRuleDao INSTANCE = new RouteRuleDao();",
"type": "RouteRuleDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/src/main/jav... | {
"body": "protected void delete(final Long... ids) {\n delete(Lists.newArrayList(ids));\n }",
"class_method_signature": "RouteRuleDao.delete(final Long... ids)",
"constructor": false,
"full_signature": "protected void delete(final Long... ids)",
"identifier": "delete",
"invocations": [
"delet... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_0 | {
"fields": [
{
"declarator": "_serviceId = Services.newServiceId()",
"modifier": "private final",
"original_string": "private final String _serviceId = Services.newServiceId();",
"type": "String",
"var_name": "_serviceId"
},
{
"declarator": "_discoveryConfig = new Disc... | {
"body": "@Test\n public void testAddListener() {\n final ServiceChangeListener listener1 = emptyListener();\n context.addListener(listener1);\n Assert.assertEquals(1, context.getListeners().size());\n Assert.assertTrue(context.getListeners().contains(listener1));\n final Servic... | {
"fields": [
{
"declarator": "discoveryConfig",
"modifier": "private final",
"original_string": "private final DiscoveryConfig discoveryConfig;",
"type": "DiscoveryConfig",
"var_name": "discoveryConfig"
},
{
"declarator": "serviceId",
"modifier": "private final",... | {
"body": "public synchronized void addListener(final ServiceChangeListener listener) {\n if (listener == null) {\n return;\n }\n listeners.add(listener);\n }",
"class_method_signature": "ServiceContext.addListener(final ServiceChangeListener listener)",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_28 | {
"fields": [
{
"declarator": "registrySessionConnected = new CountDownLatch(1)",
"modifier": "private final",
"original_string": "private final CountDownLatch registrySessionConnected = new CountDownLatch(1);",
"type": "CountDownLatch",
"var_name": "registrySessionConnected"
},
... | {
"body": "@Test\n public void testIsExpired() {\n Assert.assertFalse(registrySessionContext.isExpired());\n }",
"class_method_signature": "WebSocketSessionContextTest.testIsExpired()",
"constructor": false,
"full_signature": "@Test public void testIsExpired()",
"identifier": "testIsExpired",
"... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(WebSocketSessionContext.class)",
"modifier": "private static final",
"original_string": "private static final Logger _logger = LoggerFactory.getLogger(WebSocketSessionContext.class);",
"type": "Logger",
"var_name": "_lo... | {
"body": "protected boolean isExpired() {\n return System.currentTimeMillis() >= (_lastUpdatedTime + _ttl.typedValue());\n }",
"class_method_signature": "WebSocketSessionContext.isExpired()",
"constructor": false,
"full_signature": "protected boolean isExpired()",
"identifier": "isExpired",
"invo... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_69 | {
"fields": [
{
"declarator": "routeRuleGroupDao = RouteRuleGroupDao.INSTANCE",
"modifier": "private final",
"original_string": "private final RouteRuleGroupDao routeRuleGroupDao = RouteRuleGroupDao.INSTANCE;",
"type": "RouteRuleGroupDao",
"var_name": "routeRuleGroupDao"
},
{... | {
"body": "@Test\n public void testPublish() {\n for (RouteRuleGroupModel routeRuleGroup : newRouteRuleGroups()) {\n routeRuleGroupDao.publish(routeRuleGroup);\n RouteRuleGroupModel published = query(routeRuleGroup);\n Assert.assertEquals(routeRuleGroup.getRouteRuleId(), pub... | {
"fields": [
{
"declarator": "INSTANCE = new RouteRuleGroupDao()",
"modifier": "public static final",
"original_string": "public static final RouteRuleGroupDao INSTANCE = new RouteRuleGroupDao();",
"type": "RouteRuleGroupDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-man... | {
"body": "protected void publish(final RouteRuleGroupModel... models) {\n publish(Lists.newArrayList(models));\n }",
"class_method_signature": "RouteRuleGroupDao.publish(final RouteRuleGroupModel... models)",
"constructor": false,
"full_signature": "protected void publish(final RouteRuleGroupModel...... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_45 | {
"fields": [
{
"declarator": "groupTagDao = GroupTagDao.INSTANCE",
"modifier": "private final",
"original_string": "private final GroupTagDao groupTagDao = GroupTagDao.INSTANCE;",
"type": "GroupTagDao",
"var_name": "groupTagDao"
},
{
"declarator": "random = new SecureR... | {
"body": "@Test\n public void testDelete() throws Exception {\n GroupTagModel groupTag = newGroupTag();\n groupTagDao.insertOrUpdate(groupTag);\n assertGroupOperation(groupTag, query(groupTag));\n groupTagDao.delete(groupTag);\n Assert.assertNull(query(groupTag));\n }",
"cl... | {
"fields": [
{
"declarator": "INSTANCE = new GroupTagDao()",
"modifier": "public static final",
"original_string": "public static final GroupTagDao INSTANCE = new GroupTagDao();",
"type": "GroupTagDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/src/main/java/co... | {
"body": "public void delete(GroupTagModel filter) {\n ValueCheckers.notNull(filter, \"filter\");\n final Map<String, String> conditions = Maps.newHashMap();\n conditions.put(\"group_id=?\", filter.getGroupId() == null ? null : Long.toString(filter.getGroupId()));\n conditions.put(\"tag=?... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_12 | {
"fields": [
{
"declarator": "_serviceRepository = new ServiceRepository(ArtemisClientConstants.DiscoveryClientConfig)",
"modifier": "private final",
"original_string": "private final ServiceRepository _serviceRepository = new ServiceRepository(ArtemisClientConstants.DiscoveryClientConfig);",
... | {
"body": "@Test\n public void testRegisterServiceChangeListener() {\n final DiscoveryConfig discoveryConfig = Services.newDiscoverConfig();\n _serviceRepository.registerServiceChangeListener(discoveryConfig, new DefaultServiceChangeListener());\n Assert.assertTrue(_serviceRepository.containsS... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ServiceRepository.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ServiceRepository.class);",
"type": "Logger",
"var_name": "logger"
},
... | {
"body": "public void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener) {\n if ((discoveryConfig == null) || (listener == null)) {\n return;\n }\n\n final String serviceId = StringValues.toLowerCase(discoveryConfig.getServiceId(... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_53 | {
"fields": [
{
"declarator": "serviceInstanceDao = ServiceInstanceDao.INSTANCE",
"modifier": "private final",
"original_string": "private final ServiceInstanceDao serviceInstanceDao = ServiceInstanceDao.INSTANCE;",
"type": "ServiceInstanceDao",
"var_name": "serviceInstanceDao"
}... | {
"body": "@Test\n public void testDeleteByFilters() throws Exception {\n ServiceInstanceModel serviceInstance1 = newServiceInstance();\n ServiceInstanceModel serviceInstance2 = newServiceInstance();\n serviceInstanceDao.insertOrUpdate(serviceInstance1, serviceInstance2);\n query(servic... | {
"fields": [
{
"declarator": "INSTANCE = new ServiceInstanceDao()",
"modifier": "public static final",
"original_string": "public static final ServiceInstanceDao INSTANCE = new ServiceInstanceDao();",
"type": "ServiceInstanceDao",
"var_name": "INSTANCE"
}
],
"file": "artemis... | {
"body": "protected void deleteByFilters(final List<ServiceInstanceModel> filters) {\n checkInsertOrUpdateArgument(filters);\n DataConfig.jdbcTemplate().batchUpdate(\"delete from service_instance where service_id = ? and instance_id=?\", new BatchPreparedStatementSetter() {\n @Override\n ... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_46 | {
"fields": [
{
"declarator": "groupTagDao = GroupTagDao.INSTANCE",
"modifier": "private final",
"original_string": "private final GroupTagDao groupTagDao = GroupTagDao.INSTANCE;",
"type": "GroupTagDao",
"var_name": "groupTagDao"
},
{
"declarator": "random = new SecureR... | {
"body": "@Test\n public void testInsertOrUpdate() throws Exception {\n GroupTagModel GroupTag = newGroupTag();\n groupTagDao.insertOrUpdate(GroupTag);\n groupTagDao.insertOrUpdate(GroupTag);\n assertGroupOperation(GroupTag, query(GroupTag));\n }",
"class_method_signature": "Group... | {
"fields": [
{
"declarator": "INSTANCE = new GroupTagDao()",
"modifier": "public static final",
"original_string": "public static final GroupTagDao INSTANCE = new GroupTagDao();",
"type": "GroupTagDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/src/main/java/co... | {
"body": "public void insertOrUpdate(GroupTagModel... models) {\n insertOrUpdate(Lists.newArrayList(models));\n }",
"class_method_signature": "GroupTagDao.insertOrUpdate(GroupTagModel... models)",
"constructor": false,
"full_signature": "public void insertOrUpdate(GroupTagModel... models)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_11 | {
"fields": [
{
"declarator": "_serviceRepository = new ServiceRepository(ArtemisClientConstants.DiscoveryClientConfig)",
"modifier": "private final",
"original_string": "private final ServiceRepository _serviceRepository = new ServiceRepository(ArtemisClientConstants.DiscoveryClientConfig);",
... | {
"body": "@Test\n public void testGetService() {\n final DiscoveryConfig discoveryConfig = Services.newDiscoverConfig();\n final String serviceId = discoveryConfig.getServiceId();\n final Service service = _serviceRepository.getService(discoveryConfig);\n Assert.assertEquals(serviceId,... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ServiceRepository.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ServiceRepository.class);",
"type": "Logger",
"var_name": "logger"
},
... | {
"body": "public Service getService(final DiscoveryConfig discoveryConfig) {\n if (discoveryConfig == null) {\n return new Service();\n }\n\n final String serviceId = StringValues.toLowerCase(discoveryConfig.getServiceId());\n if (StringValues.isNullOrWhitespace(serviceId))\n ... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_50 | {
"fields": [
{
"declarator": "routeRuleDao = RouteRuleDao.INSTANCE",
"modifier": "private final",
"original_string": "private final RouteRuleDao routeRuleDao = RouteRuleDao.INSTANCE;",
"type": "RouteRuleDao",
"var_name": "routeRuleDao"
},
{
"declarator": "random = new ... | {
"body": "@Test\n public void testSelect() {\n RouteRuleModel routeRule = newRouteRule();\n routeRuleDao.insertOrUpdate(routeRule);\n RouteRuleModel filter = new RouteRuleModel();\n filter.setName(routeRule.getName());\n filter.setServiceId(routeRule.getServiceId());\n As... | {
"fields": [
{
"declarator": "INSTANCE = new RouteRuleDao()",
"modifier": "public static final",
"original_string": "public static final RouteRuleDao INSTANCE = new RouteRuleDao();",
"type": "RouteRuleDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-management/src/main/jav... | {
"body": "public List<RouteRuleModel> select(RouteRuleModel filter) {\n ValueCheckers.notNull(filter, \"filter\");\n Map<String, String> conditions = Maps.newHashMap();\n conditions.put(\"id=?\", filter.getId() == null ? null : Long.toString(filter.getId()));\n conditions.put(\"service_id... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_27 | {
"fields": [
{
"declarator": "registrySessionConnected = new CountDownLatch(1)",
"modifier": "private final",
"original_string": "private final CountDownLatch registrySessionConnected = new CountDownLatch(1);",
"type": "CountDownLatch",
"var_name": "registrySessionConnected"
},
... | {
"body": "@Test(timeout=5000)\n public void testConnect() {\n final WebSocketSession session = registrySessionContext.get();\n if (registrySessionContext.isAvailable()) {\n WebSocketSessionContext.disconnect(session);\n Assert.assertFalse(session.isOpen());\n }\n ... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(WebSocketSessionContext.class)",
"modifier": "private static final",
"original_string": "private static final Logger _logger = LoggerFactory.getLogger(WebSocketSessionContext.class);",
"type": "Logger",
"var_name": "_lo... | {
"body": "protected void connect() {\n if (_isConnecting.compareAndSet(false, true)) {\n try {\n if (rateLimiter.isRateLimited(\"connect\")) {\n _logger.error(\"WebSocketSessionContext reconnect times exceed expected value for a period time\");\n ... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_70 | {
"fields": [
{
"declarator": "groupOperationLogDao = GroupOperationLogDao.INSTANCE",
"modifier": "private",
"original_string": "private GroupOperationLogDao groupOperationLogDao = GroupOperationLogDao.INSTANCE;",
"type": "GroupOperationLogDao",
"var_name": "groupOperationLogDao"
... | {
"body": "@Test\n public void testInsert() {\n final GroupOperationLogModel log1 = newModel();\n final GroupOperationLogModel log2 = newModel();\n log1.setComplete(true);\n log2.setComplete(true);\n final List<GroupOperationLogModel> logs = Lists.newArrayList(log1, log2);\n ... | {
"fields": [
{
"declarator": "INSTANCE = new GroupOperationLogDao()",
"modifier": "public static final",
"original_string": "public static final GroupOperationLogDao INSTANCE = new GroupOperationLogDao();",
"type": "GroupOperationLogDao",
"var_name": "INSTANCE"
}
],
"file": ... | {
"body": "public void insert(final GroupOperationLogModel... logs) {\n if ((logs == null) || (logs.length == 0)) {\n return;\n }\n this.insert(Lists.newArrayList(logs));\n }",
"class_method_signature": "GroupOperationLogDao.insert(final GroupOperationLogModel... logs)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_66 | {
"fields": [
{
"declarator": "routeRuleGroupDao = RouteRuleGroupDao.INSTANCE",
"modifier": "private final",
"original_string": "private final RouteRuleGroupDao routeRuleGroupDao = RouteRuleGroupDao.INSTANCE;",
"type": "RouteRuleGroupDao",
"var_name": "routeRuleGroupDao"
},
{... | {
"body": "@Test\n public void testDelete() {\n for (RouteRuleGroupModel routeRuleGroup : newRouteRuleGroups()) {\n routeRuleGroupDao.insertOrUpdate(routeRuleGroup);\n RouteRuleGroupModel copy = query(routeRuleGroup);\n routeRuleGroupDao.delete(copy.getId());\n As... | {
"fields": [
{
"declarator": "INSTANCE = new RouteRuleGroupDao()",
"modifier": "public static final",
"original_string": "public static final RouteRuleGroupDao INSTANCE = new RouteRuleGroupDao();",
"type": "RouteRuleGroupDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-man... | {
"body": "protected void delete(final Long... ids) {\n delete(Lists.newArrayList(ids));\n }",
"class_method_signature": "RouteRuleGroupDao.delete(final Long... ids)",
"constructor": false,
"full_signature": "protected void delete(final Long... ids)",
"identifier": "delete",
"invocations": [
"... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_31 | {
"fields": [
{
"declarator": "zoneRepository = ZoneRepository.getInstance()",
"modifier": "private",
"original_string": "private ZoneRepository zoneRepository = ZoneRepository.getInstance();",
"type": "ZoneRepository",
"var_name": "zoneRepository"
},
{
"declarator": "z... | {
"body": "@Test\n public void testRefreshCache() {\n zoneRepository.operateGroupOperations(operationContext, zoneOperations, false);\n int allZoneOperationsSize = zoneRepository.getAllZoneOperations(DeploymentConfig.regionId()).size();\n zoneRepository.refreshCache();\n Assert.assertEq... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ZoneRepository.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ZoneRepository.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "protected boolean refreshCache() {\n Set<String> changedServices;\n\n try {\n changedServices = refreshZoneOperations();\n } catch (Throwable ex) {\n logger.error(\"zone operation cache refresh failed\", ex);\n return false;\n }\n\n for (S... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_3 | {
"fields": [
{
"declarator": "_serviceId = Services.newServiceId()",
"modifier": "private final",
"original_string": "private final String _serviceId = Services.newServiceId();",
"type": "String",
"var_name": "_serviceId"
},
{
"declarator": "_discoveryConfig = new Disc... | {
"body": "@Test\n public void testIsAvailable() {\n ServiceContext context = new ServiceContext(_discoveryConfig);\n Assert.assertFalse(context.isAvailable());\n Instance instance = Instances.newInstance(_serviceId);\n Assert.assertTrue(context.addInstance(instance));\n Assert.a... | {
"fields": [
{
"declarator": "discoveryConfig",
"modifier": "private final",
"original_string": "private final DiscoveryConfig discoveryConfig;",
"type": "DiscoveryConfig",
"var_name": "discoveryConfig"
},
{
"declarator": "serviceId",
"modifier": "private final",... | {
"body": "public synchronized boolean isAvailable() {\n Service service = this.service;\n return service != null && !CollectionValues.isNullOrEmpty(service.getInstances());\n }",
"class_method_signature": "ServiceContext.isAvailable()",
"constructor": false,
"full_signature": "public synchroni... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_2 | {
"fields": [
{
"declarator": "_serviceId = Services.newServiceId()",
"modifier": "private final",
"original_string": "private final String _serviceId = Services.newServiceId();",
"type": "String",
"var_name": "_serviceId"
},
{
"declarator": "_discoveryConfig = new Disc... | {
"body": "@Test\n public void testAddInstance() {\n ServiceContext context = new ServiceContext(_discoveryConfig);\n Instance instance1 = Instances.newInstance(_serviceId);\n Assert.assertTrue(context.addInstance(instance1));\n Assert.assertEquals(1, context.newService().getInstances()... | {
"fields": [
{
"declarator": "discoveryConfig",
"modifier": "private final",
"original_string": "private final DiscoveryConfig discoveryConfig;",
"type": "DiscoveryConfig",
"var_name": "discoveryConfig"
},
{
"declarator": "serviceId",
"modifier": "private final",... | {
"body": "public synchronized boolean addInstance(Instance instance) {\n if (instance == null) {\n return false;\n }\n String instanceServiceId = instance.getServiceId();\n if (instanceServiceId == null || !serviceId.equals(instanceServiceId.toLowerCase())) {\n retur... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_30 | {
"fields": [
{
"declarator": "registrySessionConnected = new CountDownLatch(1)",
"modifier": "private final",
"original_string": "private final CountDownLatch registrySessionConnected = new CountDownLatch(1);",
"type": "CountDownLatch",
"var_name": "registrySessionConnected"
},
... | {
"body": "@Test\n public void testGet() {\n Assert.assertNotNull(registrySessionContext.get());\n }",
"class_method_signature": "WebSocketSessionContextTest.testGet()",
"constructor": false,
"full_signature": "@Test public void testGet()",
"identifier": "testGet",
"invocations": [
"assertN... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(WebSocketSessionContext.class)",
"modifier": "private static final",
"original_string": "private static final Logger _logger = LoggerFactory.getLogger(WebSocketSessionContext.class);",
"type": "Logger",
"var_name": "_lo... | {
"body": "public WebSocketSession get() {\n return _session.get();\n }",
"class_method_signature": "WebSocketSessionContext.get()",
"constructor": false,
"full_signature": "public WebSocketSession get()",
"identifier": "get",
"invocations": [
"get"
],
"modifiers": "public",
"parameters"... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
107536049_67 | {
"fields": [
{
"declarator": "routeRuleGroupDao = RouteRuleGroupDao.INSTANCE",
"modifier": "private final",
"original_string": "private final RouteRuleGroupDao routeRuleGroupDao = RouteRuleGroupDao.INSTANCE;",
"type": "RouteRuleGroupDao",
"var_name": "routeRuleGroupDao"
},
{... | {
"body": "@Test\n public void testSelect() {\n for (RouteRuleGroupModel routeRuleGroup : newRouteRuleGroups()) {\n routeRuleGroupDao.insertOrUpdate(routeRuleGroup);\n RouteRuleGroupModel filter = new RouteRuleGroupModel();\n filter.setGroupId(routeRuleGroup.getGroupId());\n... | {
"fields": [
{
"declarator": "INSTANCE = new RouteRuleGroupDao()",
"modifier": "public static final",
"original_string": "public static final RouteRuleGroupDao INSTANCE = new RouteRuleGroupDao();",
"type": "RouteRuleGroupDao",
"var_name": "INSTANCE"
}
],
"file": "artemis-man... | {
"body": "public List<RouteRuleGroupModel> select(RouteRuleGroupModel filter) {\n ValueCheckers.notNull(filter, \"filter\");\n Map<String, Long> conditions = Maps.newHashMap();\n conditions.put(\"id=?\", filter.getId());\n conditions.put(\"route_rule_id=?\", filter.getRouteRuleId());\n ... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107536049,
"size": 244,
"stargazer_count": 31,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/artemis"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.