id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
29748259_44
{ "fields": [ { "declarator": "metricDataService = Mockito.mock(TsdrMetricDataService.class)", "modifier": "private final", "original_string": "private final TsdrMetricDataService metricDataService = Mockito.mock(TsdrMetricDataService.class);", "type": "TsdrMetricDataService", "var_n...
{ "body": "@Test\n public void testInsertTSDRMetricRecord() throws InterruptedException, ExecutionException, TimeoutException {\n doReturn(RpcResultBuilder.success(new StoreTSDRMetricRecordOutputBuilder().build()).buildFuture())\n .when(metricDataService).storeTSDRMetricRecord(any());\n\n ...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(CollectorSPIImpl.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(CollectorSPIImpl.class);", "type": "Logger", "var_name": "LOG" }, { "...
{ "body": "@Override\n public ListenableFuture<RpcResult<InsertTSDRMetricRecordOutput>> insertTSDRMetricRecord(\n InsertTSDRMetricRecordInput input) {\n List<TSDRMetricRecord> records = input.getTSDRMetricRecord().stream().map(inputRec ->\n new TSDRMetricRecordBuilder().setMetricName(i...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 29748259, "size": 20662, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/opendaylight/tsdr" }
29748259_33
{ "fields": [], "file": "collectors/netflow-statistics-collector/src/test/java/org/opendaylight/tsdr/netflow/parser/v9/NetflowV9PacketParserTest.java", "identifier": "NetflowV9PacketParserTest", "interfaces": "", "superclass": "extends NetflowPacketParserTestBase" }
{ "body": "@Test\n public void testOptions() throws IOException {\n // First packet - 2 options templates, 1 options data record\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n DataOutputStream out = new DataOutputStream(bos);\n\n // Header\n out.writeShort(9); ...
{ "fields": [ { "declarator": "FLOW_SET_LOG_TEXT = \"Data FlowSet\"", "modifier": "static final", "original_string": "static final String FLOW_SET_LOG_TEXT = \"Data FlowSet\";", "type": "String", "var_name": "FLOW_SET_LOG_TEXT" }, { "declarator": "LOG = LoggerFactory.ge...
{ "body": "@Override\n public void parseRecords() {\n while (recordCounter < totalRecordCount && !endOfData()) {\n final OptionalInt possibleCount = parseNextRecords();\n if (!possibleCount.isPresent()) {\n return;\n }\n\n recordCounter += possibleC...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 29748259, "size": 20662, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/opendaylight/tsdr" }
29748259_64
{ "fields": [ { "declarator": "cluster = Mockito.mock(Cluster.class)", "modifier": "private final", "original_string": "private final Cluster cluster = Mockito.mock(Cluster.class);", "type": "Cluster", "var_name": "cluster" }, { "declarator": "session = Mockito.mock(Ses...
{ "body": "@Test\n public void testGetTSDRLogRecords() {\n impl.getTSDRLogRecords(\"Test\", 0L, 0L);\n Mockito.verify(store, Mockito.atLeastOnce()).getTSDRLogRecords(\"Test\", 0L, 0L, 1000);\n }", "class_method_signature": "TSDRCassandraPersistenceServiceImplTest.testGetTSDRLogRecords()", "con...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(TSDRCassandraPersistenceServiceImpl.class);", "type": "Logger", ...
{ "body": "@Override\n public List<TSDRLogRecord> getTSDRLogRecords(String tsdrMetricKey, long startTime, long endTime) {\n return store.getTSDRLogRecords(tsdrMetricKey, startTime, endTime,\n TSDRConstants.MAX_RESULTS_FROM_LIST_METRICS_COMMAND);\n }", "class_method_signature": "TSDRCassa...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 29748259, "size": 20662, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/opendaylight/tsdr" }
29748259_72
{ "fields": [ { "declarator": "store = Mockito.mock(ElasticSearchStore.class)", "modifier": "private final", "original_string": "private final ElasticSearchStore store = Mockito.mock(ElasticSearchStore.class);", "type": "ElasticSearchStore", "var_name": "store" }, { "de...
{ "body": "@Test\n public void getTSDRBinaryRecords() throws Exception {\n long start = 0L;\n long end = 0L;\n int size = 1000;\n String key = DataCategory.EXTERNAL.name();\n ElasticSearchStore.RecordType type = ElasticSearchStore.RecordType.BINARY;\n service.getTSDRBinary...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass())", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());", "type": "Logger", "var...
{ "body": "@Override\n public List<TSDRBinaryRecord> getTSDRBinaryRecords(String key, long start, long end) {\n return getTSDRRecords(RecordType.BINARY, key, start, end);\n }", "class_method_signature": "TsdrElasticSearchPersistenceServiceImpl.getTSDRBinaryRecords(String key, long start, long end)", ...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 29748259, "size": 20662, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/opendaylight/tsdr" }
29748259_25
{ "fields": [ { "declarator": "contextService = new HBaseDataStoreContext()", "modifier": "private final", "original_string": "private final HBaseDataStoreContext contextService = new HBaseDataStoreContext();", "type": "HBaseDataStoreContext", "var_name": "contextService" } ], ...
{ "body": "@Test\n public void testGetPoolSize() {\n assertTrue(contextService.getPoolSize() == 20);\n }", "class_method_signature": "HBaseDataStoreContextTest.testGetPoolSize()", "constructor": false, "full_signature": "@Test public void testGetPoolSize()", "identifier": "testGetPoolSize", "in...
{ "fields": [ { "declarator": "ZOO_KEEPER_QUORUM_PROP = \"zoo.keeper.quorum\"", "modifier": "static final", "original_string": "static final String ZOO_KEEPER_QUORUM_PROP = \"zoo.keeper.quorum\";", "type": "String", "var_name": "ZOO_KEEPER_QUORUM_PROP" }, { "declarator"...
{ "body": "public int getPoolSize() {\n return poolSize;\n }", "class_method_signature": "HBaseDataStoreContext.getPoolSize()", "constructor": false, "full_signature": "public int getPoolSize()", "identifier": "getPoolSize", "invocations": [], "modifiers": "public", "parameters": "()", "retu...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 29748259, "size": 20662, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/opendaylight/tsdr" }
29748259_48
{ "fields": [ { "declarator": "NOTIFICATION_SCHEMA_PATH =\n SchemaPath.create(true, OutOfPixieDustNotification.QNAME)", "modifier": "private static final", "original_string": "private static final SchemaPath NOTIFICATION_SCHEMA_PATH =\n SchemaPath.create(true, OutOfPixieDus...
{ "body": "@Test\n public void testOnNotification() throws InterruptedException {\n List<TSDRLogRecord> storedRecords = Collections.synchronizedList(new ArrayList<>());\n doAnswer(invocation -> {\n storedRecords.addAll(((InsertTSDRLogRecordInput) invocation.getArguments()[0]).getTSDRLogRec...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(YangNotificationCollectorLogger.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(YangNotificationCollectorLogger.class);", "type": "Logger", "var_nam...
{ "body": "@Override\n public void onNotification(DOMNotification notification) {\n final String jsonNotification = writeNotificationBodyToJson(notification);\n LOG.debug(\"onNotification - dom: {} converted to JSON: {}\", notification, jsonNotification);\n super.insertLog(notification.getType...
{ "created": null, "fork": null, "fork_count": 6, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 29748259, "size": 20662, "stargazer_count": 11, "stars": null, "updates": null, "url": "https://github.com/opendaylight/tsdr" }
100035986_1
{ "fields": [], "file": "codalab/scorer/src/test/java/de/tudarmstadt/ukp/argumentation/semeval2018/ScorerTest.java", "identifier": "ScorerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void readLabelsFromFile2()\n throws Exception\n {\n Scorer.readLabelsFromFile(getFileFromResources(\"test-gold2.txt\"));\n }", "class_method_signature": "ScorerTest.readLabelsFromFile2()", "constructor": false, "full_signature": "@Test public void readLabelsF...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"utf-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"utf-8\");", "type": "Charset", "var_name": "UTF8" } ], "file": "codalab/scorer/src/main/java/de/tud...
{ "body": "public static Map<String, Integer> readLabelsFromFile(File file)\n throws IOException\n {\n FileInputStream inputStream = new FileInputStream(file);\n List<String> lines = IOUtils.readLines(inputStream, UTF8);\n IOUtils.closeQuietly(inputStream);\n\n Map<String, In...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 100035986, "size": 449, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/habernal/semeval2018-task12" }
100035986_0
{ "fields": [], "file": "codalab/scorer/src/test/java/de/tudarmstadt/ukp/argumentation/semeval2018/ScorerTest.java", "identifier": "ScorerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void readLabelsFromFile1()\n throws Exception\n {\n Scorer.readLabelsFromFile(getFileFromResources(\"test-gold1.txt\"));\n }", "class_method_signature": "ScorerTest.readLabelsFromFile1()", "constructor": false, "full_signature": "@Test public void readLabelsF...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"utf-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"utf-8\");", "type": "Charset", "var_name": "UTF8" } ], "file": "codalab/scorer/src/main/java/de/tud...
{ "body": "public static Map<String, Integer> readLabelsFromFile(File file)\n throws IOException\n {\n FileInputStream inputStream = new FileInputStream(file);\n List<String> lines = IOUtils.readLines(inputStream, UTF8);\n IOUtils.closeQuietly(inputStream);\n\n Map<String, In...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 100035986, "size": 449, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/habernal/semeval2018-task12" }
100035986_3
{ "fields": [], "file": "codalab/scorer/src/test/java/de/tudarmstadt/ukp/argumentation/semeval2018/ScorerTest.java", "identifier": "ScorerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void readLabelsFromFileWrong2()\n throws Exception\n {\n Scorer.readLabelsFromFile(getFileFromResources(\"test-wrong2.txt\"));\n }", "class_method_signature": "ScorerTest.readLabelsFromFileWrong2()", "constructor": fal...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"utf-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"utf-8\");", "type": "Charset", "var_name": "UTF8" } ], "file": "codalab/scorer/src/main/java/de/tud...
{ "body": "public static Map<String, Integer> readLabelsFromFile(File file)\n throws IOException\n {\n FileInputStream inputStream = new FileInputStream(file);\n List<String> lines = IOUtils.readLines(inputStream, UTF8);\n IOUtils.closeQuietly(inputStream);\n\n Map<String, In...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 100035986, "size": 449, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/habernal/semeval2018-task12" }
100035986_2
{ "fields": [], "file": "codalab/scorer/src/test/java/de/tudarmstadt/ukp/argumentation/semeval2018/ScorerTest.java", "identifier": "ScorerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void readLabelsFromFileWrong1()\n throws Exception\n {\n Scorer.readLabelsFromFile(getFileFromResources(\"test-wrong1.txt\"));\n }", "class_method_signature": "ScorerTest.readLabelsFromFileWrong1()", "constructor": fal...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"utf-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"utf-8\");", "type": "Charset", "var_name": "UTF8" } ], "file": "codalab/scorer/src/main/java/de/tud...
{ "body": "public static Map<String, Integer> readLabelsFromFile(File file)\n throws IOException\n {\n FileInputStream inputStream = new FileInputStream(file);\n List<String> lines = IOUtils.readLines(inputStream, UTF8);\n IOUtils.closeQuietly(inputStream);\n\n Map<String, In...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 100035986, "size": 449, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/habernal/semeval2018-task12" }
100035986_5
{ "fields": [], "file": "codalab/scorer/src/test/java/de/tudarmstadt/ukp/argumentation/semeval2018/ScorerTest.java", "identifier": "ScorerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void computeAccuracy()\n throws Exception\n {\n Map<String, Integer> gold = Scorer\n .readLabelsFromFile(getFileFromResources(\"test-gold1.txt\"));\n\n // 60% accuracy\n Map<String, Integer> predictions1 = Scorer\n .readLabe...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"utf-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"utf-8\");", "type": "Charset", "var_name": "UTF8" } ], "file": "codalab/scorer/src/main/java/de/tud...
{ "body": "public static double computeAccuracy(Map<String, Integer> gold,\n Map<String, Integer> predictions)\n throws IllegalArgumentException\n {\n if (gold == null) {\n throw new IllegalArgumentException(\"Parameter 'gold' is null\");\n }\n\n if (prediction...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 100035986, "size": 449, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/habernal/semeval2018-task12" }
100035986_4
{ "fields": [], "file": "codalab/scorer/src/test/java/de/tudarmstadt/ukp/argumentation/semeval2018/ScorerTest.java", "identifier": "ScorerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void readLabelsFromFileWrong3()\n throws Exception\n {\n Scorer.readLabelsFromFile(getFileFromResources(\"test-wrong3.txt\"));\n }", "class_method_signature": "ScorerTest.readLabelsFromFileWrong3()", "constructor": fal...
{ "fields": [ { "declarator": "UTF8 = Charset.forName(\"utf-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF8 = Charset.forName(\"utf-8\");", "type": "Charset", "var_name": "UTF8" } ], "file": "codalab/scorer/src/main/java/de/tud...
{ "body": "public static Map<String, Integer> readLabelsFromFile(File file)\n throws IOException\n {\n FileInputStream inputStream = new FileInputStream(file);\n List<String> lines = IOUtils.readLines(inputStream, UTF8);\n IOUtils.closeQuietly(inputStream);\n\n Map<String, In...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 100035986, "size": 449, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/habernal/semeval2018-task12" }
60020187_0
{ "fields": [ { "declarator": "NO_ANNOTATIONS = new Annotation[0]", "modifier": "private static final", "original_string": "private static final Annotation[] NO_ANNOTATIONS = new Annotation[0];", "type": "Annotation[]", "var_name": "NO_ANNOTATIONS" }, { "declarator": "f...
{ "body": "@Test public void nonAgeraTypeReturnsNull() {\n CallAdapter<?, ?> adapter = factory.get(String.class, NO_ANNOTATIONS, retrofit);\n assertThat(adapter, nullValue());\n }", "class_method_signature": "AgeraCallAdapterFactoryTest.nonAgeraTypeReturnsNull()", "constructor": false, "full_si...
{ "fields": [], "file": "agera-call-adapter/src/main/java/me/drakeet/retrofit2/adapter/agera/AgeraCallAdapterFactory.java", "identifier": "AgeraCallAdapterFactory", "interfaces": "", "methods": [ { "class_method_signature": "AgeraCallAdapterFactory.create()", "constructor": false, "full_...
{ "body": "@Override\n public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {\n if (getRawType(returnType) != Supplier.class) {\n return null;\n }\n if (!(returnType instanceof ParameterizedType)) {\n throw new IllegalStateException(\...
{ "created": null, "fork": null, "fork_count": 13, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 60020187, "size": 150, "stargazer_count": 112, "stars": null, "updates": null, "url": "https://github.com/drakeet/retrofit-agera-call-adapter" }
60020187_1
{ "fields": [ { "declarator": "NO_ANNOTATIONS = new Annotation[0]", "modifier": "private static final", "original_string": "private static final Annotation[] NO_ANNOTATIONS = new Annotation[0];", "type": "Annotation[]", "var_name": "NO_ANNOTATIONS" }, { "declarator": "f...
{ "body": "@Test public void responseTypes() {\n Type oBodyClass = new TypeToken<Supplier<Result<String>>>() {}.getType();\n assertThat(factory.get(oBodyClass, NO_ANNOTATIONS, retrofit).responseType(),\n equalTo(new TypeToken<String>() {}.getType()));\n\n Type oBodyWildcard = new TypeT...
{ "fields": [], "file": "agera-call-adapter/src/main/java/me/drakeet/retrofit2/adapter/agera/AgeraCallAdapterFactory.java", "identifier": "AgeraCallAdapterFactory", "interfaces": "", "methods": [ { "class_method_signature": "AgeraCallAdapterFactory.create()", "constructor": false, "full_...
{ "body": "@Override\n public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {\n if (getRawType(returnType) != Supplier.class) {\n return null;\n }\n if (!(returnType instanceof ParameterizedType)) {\n throw new IllegalStateException(\...
{ "created": null, "fork": null, "fork_count": 13, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 60020187, "size": 150, "stargazer_count": 112, "stars": null, "updates": null, "url": "https://github.com/drakeet/retrofit-agera-call-adapter" }
60020187_4
{ "fields": [ { "declarator": "NO_ANNOTATIONS = new Annotation[0]", "modifier": "private static final", "original_string": "private static final Annotation[] NO_ANNOTATIONS = new Annotation[0];", "type": "Annotation[]", "var_name": "NO_ANNOTATIONS" }, { "declarator": "f...
{ "body": "@Test public void rawResponseTypeThrows() {\n Type reservoirType = new TypeToken<Supplier<Result<Response>>>() {}.getType();\n try {\n factory.get(reservoirType, NO_ANNOTATIONS, retrofit);\n fail();\n } catch (IllegalStateException e) {\n assertThat(e, ...
{ "fields": [], "file": "agera-call-adapter/src/main/java/me/drakeet/retrofit2/adapter/agera/AgeraCallAdapterFactory.java", "identifier": "AgeraCallAdapterFactory", "interfaces": "", "methods": [ { "class_method_signature": "AgeraCallAdapterFactory.create()", "constructor": false, "full_...
{ "body": "@Override\n public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {\n if (getRawType(returnType) != Supplier.class) {\n return null;\n }\n if (!(returnType instanceof ParameterizedType)) {\n throw new IllegalStateException(\...
{ "created": null, "fork": null, "fork_count": 13, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 60020187, "size": 150, "stargazer_count": 112, "stars": null, "updates": null, "url": "https://github.com/drakeet/retrofit-agera-call-adapter" }
60020187_2
{ "fields": [ { "declarator": "NO_ANNOTATIONS = new Annotation[0]", "modifier": "private static final", "original_string": "private static final Annotation[] NO_ANNOTATIONS = new Annotation[0];", "type": "Annotation[]", "var_name": "NO_ANNOTATIONS" }, { "declarator": "f...
{ "body": "@Test public void rawBodyTypeThrows() {\n Type reservoirType = new TypeToken<Supplier>() {}.getType();\n try {\n factory.get(reservoirType, NO_ANNOTATIONS, retrofit);\n fail();\n } catch (IllegalStateException e) {\n assertThat(e, hasMessage(containsStr...
{ "fields": [], "file": "agera-call-adapter/src/main/java/me/drakeet/retrofit2/adapter/agera/AgeraCallAdapterFactory.java", "identifier": "AgeraCallAdapterFactory", "interfaces": "", "methods": [ { "class_method_signature": "AgeraCallAdapterFactory.create()", "constructor": false, "full_...
{ "body": "@Override\n public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {\n if (getRawType(returnType) != Supplier.class) {\n return null;\n }\n if (!(returnType instanceof ParameterizedType)) {\n throw new IllegalStateException(\...
{ "created": null, "fork": null, "fork_count": 13, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 60020187, "size": 150, "stargazer_count": 112, "stars": null, "updates": null, "url": "https://github.com/drakeet/retrofit-agera-call-adapter" }
60020187_3
{ "fields": [ { "declarator": "NO_ANNOTATIONS = new Annotation[0]", "modifier": "private static final", "original_string": "private static final Annotation[] NO_ANNOTATIONS = new Annotation[0];", "type": "Annotation[]", "var_name": "NO_ANNOTATIONS" }, { "declarator": "f...
{ "body": "@Test public void noUseResultAsFirstInnerTypeThrows() {\n Type reservoirType = new TypeToken<Supplier<String>>() {}.getType();\n try {\n factory.get(reservoirType, NO_ANNOTATIONS, retrofit);\n fail();\n } catch (IllegalStateException e) {\n assertThat(e...
{ "fields": [], "file": "agera-call-adapter/src/main/java/me/drakeet/retrofit2/adapter/agera/AgeraCallAdapterFactory.java", "identifier": "AgeraCallAdapterFactory", "interfaces": "", "methods": [ { "class_method_signature": "AgeraCallAdapterFactory.create()", "constructor": false, "full_...
{ "body": "@Override\n public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {\n if (getRawType(returnType) != Supplier.class) {\n return null;\n }\n if (!(returnType instanceof ParameterizedType)) {\n throw new IllegalStateException(\...
{ "created": null, "fork": null, "fork_count": 13, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 60020187, "size": 150, "stargazer_count": 112, "stars": null, "updates": null, "url": "https://github.com/drakeet/retrofit-agera-call-adapter" }
13870893_121
{ "fields": [ { "declarator": "base64key = Base64.encodeBase64String(\"ambrykey\".getBytes())", "modifier": "private final", "original_string": "private final String base64key = Base64.encodeBase64String(\"ambrykey\".getBytes());", "type": "String", "var_name": "base64key" }, ...
{ "body": "@Test\n public void testDownload() throws Exception {\n mockBlobExistence(true);\n downloadBlob(blobId);\n assertEquals(1, azureMetrics.blobDownloadRequestCount.getCount());\n assertEquals(1, azureMetrics.blobDownloadSuccessCount.getCount());\n assertEquals(0, azureMetrics.blobDownloadError...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(AzureCloudDestination.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(AzureCloudDestination.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "@Override\n public void downloadBlob(BlobId blobId, OutputStream outputStream) throws CloudStorageException {\n try {\n azureBlobDataAccessor.downloadBlob(blobId, outputStream);\n } catch (Exception e) {\n throw toCloudStorageException(\"Error downloading blob \" + blobId, e);\n }\n }"...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_208
{ "fields": [], "file": "ambry-commons/src/test/java/com/github/ambry/commons/ResponseHandlerTest.java", "identifier": "ResponseHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void basicTest() {\n DummyMap mockClusterMap = new DummyMap();\n ResponseHandler handler = new ResponseHandler(mockClusterMap);\n\n Map<Object, ReplicaEventType[]> expectedEventTypes = new HashMap<>();\n\n expectedEventTypes.put(new SocketException(), new ReplicaEventType[]{Repl...
{ "fields": [ { "declarator": "clusterMap", "modifier": "private final", "original_string": "private final ClusterMap clusterMap;", "type": "ClusterMap", "var_name": "clusterMap" } ], "file": "ambry-commons/src/main/java/com/github/ambry/commons/ResponseHandler.java", "iden...
{ "body": "public void onEvent(ReplicaId replicaId, Object event) {\n if (event instanceof ServerErrorCode) {\n onServerEvent(replicaId, (ServerErrorCode) event);\n } else if (event instanceof Exception) {\n onException(replicaId, (Exception) event);\n } else if (event instanceof NetworkClientError...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_42
{ "fields": [ { "declarator": "TEST_TIME_INTERVAL_IN_MS = DELAY_BETWEEN_LAST_MODIFIED_TIMES_MS / 2", "modifier": "private static final", "original_string": "private static final long TEST_TIME_INTERVAL_IN_MS = DELAY_BETWEEN_LAST_MODIFIED_TIMES_MS / 2;", "type": "long", "var_name": "T...
{ "body": "@Test\n public void testValidDataSizeAfterUndeletes() throws Exception {\n assumeTrue(!bucketingEnabled);\n BlobStoreStats blobStoreStats = setupBlobStoreStats(0, 0);\n\n // Undelete two deleted blob, it will bring two PUT blob back to life.\n List<IndexEntry> puts = state.addPutEntries(2, PUT...
{ "fields": [ { "declarator": "IO_SCHEDULER_JOB_TYPE = \"BlobStoreStats\"", "modifier": "static final", "original_string": "static final String IO_SCHEDULER_JOB_TYPE = \"BlobStoreStats\";", "type": "String", "var_name": "IO_SCHEDULER_JOB_TYPE" }, { "declarator": "IO_SCH...
{ "body": "@Override\n public void close() {\n if (enabled.compareAndSet(true, false)) {\n if (indexScanner != null) {\n indexScanner.cancel();\n }\n if (queueProcessor != null) {\n queueProcessor.cancel();\n }\n }\n }", "class_method_signature": "BlobStoreStats.close()", ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_199
{ "fields": [ { "declarator": "EXECUTOR_SERVICE = Executors.newSingleThreadExecutor()", "modifier": "private static final", "original_string": "private static final ExecutorService EXECUTOR_SERVICE = Executors.newSingleThreadExecutor();", "type": "ExecutorService", "var_name": "EXECU...
{ "body": "@Test\n public void badInputStreamTest() throws Exception {\n final String errMsg = \"@@ExpectedExceptionMessage@@\";\n InputStream stream = new InputStream() {\n @Override\n public int read() throws IOException {\n // this represents any exception - bad behavior or closure before b...
{ "fields": [ { "declarator": "BUFFER_SIZE = 8192", "modifier": "static final", "original_string": "static final int BUFFER_SIZE = 8192;", "type": "int", "var_name": "BUFFER_SIZE" }, { "declarator": "channelOpen = new AtomicBoolean(true)", "modifier": "private fin...
{ "body": "@Override\n public Future<Long> readInto(AsyncWritableChannel asyncWritableChannel, Callback<Long> callback) {\n Future<Long> future;\n if (!channelOpen.get()) {\n ClosedChannelException closedChannelException = new ClosedChannelException();\n FutureResult<Long> futureResult = new FutureRe...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_176
{ "fields": [ { "declarator": "REPLICA_COUNT = 6", "modifier": "private static final", "original_string": "private static final int REPLICA_COUNT = 6;", "type": "int", "var_name": "REPLICA_COUNT" }, { "declarator": "PORT = 6666", "modifier": "private static final"...
{ "body": "@Test\n public void diskLevelAdaptiveTrackerTest() throws Exception {\n MockPartitionId mockPartition1 = new MockPartitionId(1L, MockClusterMap.DEFAULT_PARTITION_CLASS);\n MockPartitionId mockPartition2 = new MockPartitionId(2L, MockClusterMap.DEFAULT_PARTITION_CLASS);\n // create a new list mock...
{ "fields": [ { "declarator": "routerConfig", "modifier": "private final", "original_string": "private final RouterConfig routerConfig;", "type": "RouterConfig", "var_name": "routerConfig" }, { "declarator": "routerMetrics", "modifier": "private final", "ori...
{ "body": "@Override\n public void onResponse(ReplicaId replicaId, TrackedRequestFinalState trackedRequestFinalState) {\n super.onResponse(replicaId, trackedRequestFinalState);\n long elapsedTime;\n if (unexpiredRequestSendTimes.containsKey(replicaId)) {\n elapsedTime = time.milliseconds() - unexpiredR...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_15
{ "fields": [ { "declarator": "ZK_CLIENT_CONNECTION_TIMEOUT_MS = 20000", "modifier": "private static final", "original_string": "private static final int ZK_CLIENT_CONNECTION_TIMEOUT_MS = 20000;", "type": "int", "var_name": "ZK_CLIENT_CONNECTION_TIMEOUT_MS" }, { "declar...
{ "body": "@Test\n public void testUpdateIdConflictingAccounts() throws Exception {\n accountService = mockHelixAccountServiceFactory.getAccountService();\n List<Account> conflictAccounts = new ArrayList<>();\n conflictAccounts.add(new AccountBuilder((short) 1, \"a\", AccountStatus.INACTIVE).build());\n ...
{ "fields": [ { "declarator": "ACCOUNT_METADATA_CHANGE_TOPIC = \"account_metadata_change_topic\"", "modifier": "static final", "original_string": "static final String ACCOUNT_METADATA_CHANGE_TOPIC = \"account_metadata_change_topic\";", "type": "String", "var_name": "ACCOUNT_METADATA_...
{ "body": "@Override\n public boolean updateAccounts(Collection<Account> accounts) {\n return updateAccountsWithAccountMetadataStore(accounts, accountMetadataStore);\n }", "class_method_signature": "HelixAccountService.updateAccounts(Collection<Account> accounts)", "constructor": false, "full_signature": "...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_160
{ "fields": [ { "declarator": "DEFAULT_THREAD_COUNT = 2", "modifier": "static final", "original_string": "static final int DEFAULT_THREAD_COUNT = 2;", "type": "int", "var_name": "DEFAULT_THREAD_COUNT" }, { "declarator": "DEFAULT_KEY_SIZE = 64", "modifier": "static...
{ "body": "@Test\n public void testDecryptionFailure() throws InterruptedException, GeneralSecurityException {\n cryptoJobHandler.close();\n MockCryptoService mockCryptoService = new MockCryptoService(new CryptoServiceConfig(verifiableProperties));\n mockCryptoService.exceptionOnDecryption.set(\n new...
{ "fields": [ { "declarator": "enabled = new AtomicBoolean(false)", "modifier": "private final", "original_string": "private final AtomicBoolean enabled = new AtomicBoolean(false);", "type": "AtomicBoolean", "var_name": "enabled" }, { "declarator": "CLOSED_EXCEPTION =\n...
{ "body": "public void close() {\n if (enabled.compareAndSet(true, false)) {\n List<Runnable> pendingTasks = scheduler.shutdownNow();\n for (Runnable task : pendingTasks) {\n if (task instanceof CryptoJob) {\n ((CryptoJob) task).closeJob(CLOSED_EXCEPTION);\n } else {\n log...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_249
{ "fields": [], "file": "ambry-api/src/test/java/com/github/ambry/rest/RestRequestMetricsTrackerTest.java", "identifier": "RestRequestMetricsTrackerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void injectMetricsBadInputTest() {\n RestRequestMetricsTracker requestMetrics = new RestRequestMetricsTracker();\n try {\n requestMetrics.injectMetrics(null);\n fail(\"There was no exception even though a null RestRequestMetrics was provided as input for injectMetrics()\");\...
{ "fields": [ { "declarator": "DEFAULT_REQUEST_TYPE = \"Unknown\"", "modifier": "protected static final", "original_string": "protected static final String DEFAULT_REQUEST_TYPE = \"Unknown\";", "type": "String", "var_name": "DEFAULT_REQUEST_TYPE" }, { "declarator": "def...
{ "body": "public void injectMetrics(RestRequestMetrics restRequestMetrics) {\n if (restRequestMetrics != null) {\n metrics = restRequestMetrics;\n } else {\n throw new IllegalArgumentException(\"RestRequestMetrics provided cannot be null\");\n }\n }", "class_method_signature": "RestRequestMetri...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_8
{ "fields": [ { "declarator": "accountServiceMetrics = new AccountServiceMetrics(new MetricRegistry())", "modifier": "private final", "original_string": "private final AccountServiceMetrics accountServiceMetrics = new AccountServiceMetrics(new MetricRegistry());", "type": "AccountServiceMe...
{ "body": "@Test\n public void testCleanup_NotEnoughBackupFilesWithVersion() throws IOException {\n final int startVersion = 1;\n final int endVersion = startVersion + maxBackupFile / 2;\n final long baseModifiedTime = System.currentTimeMillis() / 1000 - 100;\n final long interval = 2;\n final int bac...
{ "fields": [ { "declarator": "OLD_STATE_SUFFIX = \"old\"", "modifier": "static final", "original_string": "static final String OLD_STATE_SUFFIX = \"old\";", "type": "String", "var_name": "OLD_STATE_SUFFIX" }, { "declarator": "NEW_STATE_SUFFIX = \"new\"", "modifie...
{ "body": "int size() {\n return backupFileInfos.size();\n }", "class_method_signature": "BackupFileManager.size()", "constructor": false, "full_signature": " int size()", "identifier": "size", "invocations": [ "size" ], "modifiers": "", "parameters": "()", "return": "int", "signature": "i...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_137
{ "fields": [ { "declarator": "cosmosAccessor", "modifier": "private", "original_string": "private CosmosDataAccessor cosmosAccessor;", "type": "CosmosDataAccessor", "var_name": "cosmosAccessor" }, { "declarator": "mockumentClient", "modifier": "private", "o...
{ "body": "@Test\n public void testUpdateConflict() throws Exception {\n Observable<ResourceResponse<Document>> mockResponse = getMockedObservableForSingleResource(blobMetadata);\n when(mockumentClient.readDocument(anyString(), any(RequestOptions.class))).thenReturn(mockResponse);\n when(mockumentClient.rep...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(CosmosDataAccessor.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(CosmosDataAccessor.class);", "type": "Logger", "var_name": "logger" }, ...
{ "body": "ResourceResponse<Document> updateMetadata(BlobId blobId, Map<String, String> updateFields)\n throws DocumentClientException {\n\n // Read the existing record\n String docLink = getDocumentLink(blobId.getID());\n RequestOptions options = getRequestOptions(blobId.getPartition().toPathString());...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_54
{ "fields": [ { "declarator": "RANDOM = new Random()", "modifier": "private static final", "original_string": "private static final Random RANDOM = new Random();", "type": "Random", "var_name": "RANDOM" }, { "declarator": "CLUSTER_NAME = \"AmbryTestCluster\"", "mo...
{ "body": "@Test\n public void updateInstanceConfigSuccessTest() throws Exception {\n generateConfigs(true, true);\n MockDataNodeId localNode = clusterMap.getDataNodes().get(0);\n List<ReplicaId> localReplicas = clusterMap.getReplicaIds(localNode);\n MockClusterParticipant mockHelixParticipant = new Mock...
{ "fields": [ { "declarator": "partitionToDiskManager = new ConcurrentHashMap<>()", "modifier": "protected final", "original_string": "protected final ConcurrentHashMap<PartitionId, DiskManager> partitionToDiskManager = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<PartitionId, D...
{ "body": "public void start() throws InterruptedException {\n long startTimeMs = time.milliseconds();\n try {\n logger.info(\"Starting storage manager\");\n List<Thread> startupThreads = new ArrayList<>();\n for (final DiskManager diskManager : diskToDiskManager.values()) {\n Thread threa...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_320
{ "fields": [ { "declarator": "NEW_PARTITION_NAME = \"12\"", "modifier": "private static final", "original_string": "private static final String NEW_PARTITION_NAME = \"12\";", "type": "String", "var_name": "NEW_PARTITION_NAME" }, { "declarator": "CLOUD_DC_NAME = \"Cloud...
{ "body": "@Test\n public void testGetCloudDataNode() throws NoSuchFieldException, ReplicationException {\n CloudToStoreReplicationManager mockCloudToStoreReplicationManager = mock(CloudToStoreReplicationManager.class);\n List<DataNodeId> dataNodeIds = new ArrayList<>();\n Port port = new Port(1000, PortTyp...
{ "fields": [ { "declarator": "clusterMapConfig", "modifier": "private final", "original_string": "private final ClusterMapConfig clusterMapConfig;", "type": "ClusterMapConfig", "var_name": "clusterMapConfig" }, { "declarator": "storeConfig", "modifier": "private ...
{ "body": "DataNodeId getCloudDataNode() throws ReplicationException {\n List<CloudDataNode> nodes = vcrNodes.get();\n if (nodes.isEmpty()) {\n throw new ReplicationException(\"No VCR node found to replicate partition from cloud.\");\n }\n return nodes.get(Utils.getRandomShort(random) % nodes.size())...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_265
{ "fields": [], "file": "ambry-api/src/test/java/com/github/ambry/router/GetBlobOptionsTest.java", "identifier": "GetBlobOptionsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testResolveRangeOnEmptyBlobOption() {\n GetBlobOptions options = new GetBlobOptionsBuilder().build();\n assertFalse(\"Default value of resolveRangeOnEmptyBlob should be false\", options.resolveRangeOnEmptyBlob());\n options = new GetBlobOptionsBuilder().resolveRangeOnEmptyBlob...
{ "fields": [ { "declarator": "operationType", "modifier": "private final", "original_string": "private final OperationType operationType;", "type": "OperationType", "var_name": "operationType" }, { "declarator": "getOption", "modifier": "private final", "or...
{ "body": "public boolean resolveRangeOnEmptyBlob() {\n return resolveRangeOnEmptyBlob;\n }", "class_method_signature": "GetBlobOptions.resolveRangeOnEmptyBlob()", "constructor": false, "full_signature": "public boolean resolveRangeOnEmptyBlob()", "identifier": "resolveRangeOnEmptyBlob", "invocations": ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_78
{ "fields": [], "file": "ambry-store/src/test/java/com/github/ambry/store/LogSegmentNameHelperTest.java", "identifier": "LogSegmentNameHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void comparatorTest() {\n Comparator<String> comparator = LogSegmentNameHelper.COMPARATOR;\n // compare empty name with empty name\n assertEquals(\"Empty names should be equal\", 0, comparator.compare(\"\", \"\"));\n // create sample names\n String[] names =\n {LogSegm...
{ "fields": [ { "declarator": "SUFFIX = BlobStore.SEPARATOR + \"log\"", "modifier": "static final", "original_string": "static final String SUFFIX = BlobStore.SEPARATOR + \"log\";", "type": "String", "var_name": "SUFFIX" }, { "declarator": "COMPARATOR = new Comparator<S...
{ "body": "static String getName(long pos, long gen) {\n return pos + BlobStore.SEPARATOR + gen;\n }", "class_method_signature": "LogSegmentNameHelper.getName(long pos, long gen)", "constructor": false, "full_signature": "static String getName(long pos, long gen)", "identifier": "getName", "invocations"...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_377
{ "fields": [ { "declarator": "clientSSLFactory", "modifier": "private static", "original_string": "private static SSLFactory clientSSLFactory;", "type": "SSLFactory", "var_name": "clientSSLFactory" }, { "declarator": "clientSSLSocketFactory", "modifier": "private...
{ "body": "@Test\n public void simpleSSLRequest() throws IOException, InterruptedException {\n simpleRequest(new Port(server.getSSLPort(), PortType.SSL));\n }", "class_method_signature": "SocketServerTest.simpleSSLRequest()", "constructor": false, "full_signature": "@Test public void simpleSSLRequest()", ...
{ "fields": [ { "declarator": "networkConfig", "modifier": "private final", "original_string": "private final NetworkConfig networkConfig;", "type": "NetworkConfig", "var_name": "networkConfig" }, { "declarator": "host", "modifier": "private final", "origina...
{ "body": "public int getSSLPort() {\n Port sslPort = ports.get(PortType.SSL);\n if (sslPort != null) {\n return sslPort.getPort();\n }\n throw new IllegalStateException(\"No SSL Port Exists for Server \" + host + \":\" + port);\n }", "class_method_signature": "SocketServer.getSSLPort()", "const...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_398
{ "fields": [ { "declarator": "diskMocks = new Mocks()", "modifier": "private final", "original_string": "private final Mocks diskMocks = new Mocks();", "type": "Mocks", "var_name": "diskMocks" }, { "declarator": "cloudMocks = new Mocks()", "modifier": "private fi...
{ "body": "@Test\n public void testRequestInfoNullInResponse() throws Exception {\n NetworkClient compositeClient = factory.getNetworkClient();\n when(diskMocks.client.sendAndPoll(any(), any(), anyInt())).thenReturn(\n Collections.singletonList(new ResponseInfo(null, NetworkClientErrorCode.NetworkError,...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(CompositeNetworkClient.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(CompositeNetworkClient.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public List<ResponseInfo> sendAndPoll(List<RequestInfo> allRequestsToSend, Set<Integer> allRequestsToDrop,\n int pollTimeoutMs) {\n // prepare lists of requests to send and drop\n EnumMap<ReplicaType, List<RequestInfo>> requestsToSendByType = new EnumMap<>(ReplicaType.class);\n E...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_232
{ "fields": [ { "declarator": "putFormat", "modifier": "private final", "original_string": "private final String putFormat;", "type": "String", "var_name": "putFormat" }, { "declarator": "messageFormatHeaderVersionSaved", "modifier": "private static", "origi...
{ "body": "@Test\n public void messageReadSetIndexInputStreamTest() throws Exception {\n ArrayList<ByteBuffer> listbuf = new ArrayList<ByteBuffer>();\n byte[] buf1 = new byte[1024];\n byte[] buf2 = new byte[2048];\n byte[] buf3 = new byte[4096];\n new Random().nextBytes(buf1);\n new Random().nextBy...
{ "fields": [ { "declarator": "messageReadSet", "modifier": "private final", "original_string": "private final MessageReadSet messageReadSet;", "type": "MessageReadSet", "var_name": "messageReadSet" }, { "declarator": "indexToRead", "modifier": "private final", ...
{ "body": "public MessageReadSetIndexInputStream(MessageReadSet messageReadSet, int indexToRead, int startingOffset) {\n this.messageReadSet = messageReadSet;\n if (indexToRead >= messageReadSet.count()) {\n throw new IllegalArgumentException(\n \"The index provided \" + indexToRead + \" \" + \"is...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_97
{ "fields": [ { "declarator": "PUT_RECORD_SIZE = 53", "modifier": "static final", "original_string": "static final int PUT_RECORD_SIZE = 53;", "type": "int", "var_name": "PUT_RECORD_SIZE" }, { "declarator": "MOCK_ID_STRING_LENGTH = 10", "modifier": "static final",...
{ "body": "@Test\n public void isKeyDeletedTest() throws StoreException {\n for (MockId id : allKeys.keySet()) {\n assertEquals(\"Returned state is not as expected\", deletedKeys.contains(id), store.isKeyDeleted(id));\n }\n for (MockId id : deletedAndShouldBeCompactedKeys) {\n assertTrue(\"Returne...
{ "fields": [ { "declarator": "SEPARATOR = \"_\"", "modifier": "static final", "original_string": "static final String SEPARATOR = \"_\";", "type": "String", "var_name": "SEPARATOR" }, { "declarator": "BOOTSTRAP_FILE_NAME = \"bootstrap_in_progress\"", "modifier": ...
{ "body": "@Override\n public boolean isKeyDeleted(StoreKey key) throws StoreException {\n checkStarted();\n final Timer.Context context = metrics.isKeyDeletedResponse.time();\n try {\n IndexValue value = index.findKey(key);\n if (value == null) {\n throw new StoreException(\"Key \" + key +...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_361
{ "fields": [ { "declarator": "diskCount = 10", "modifier": "private static final", "original_string": "private static final int diskCount = 10;", "type": "int", "var_name": "diskCount" }, { "declarator": "diskCapacityInBytes = 1000 * 1024 * 1024 * 1024L", "modifi...
{ "body": "@Test\n public void validation() throws JSONException {\n JSONObject jsonObject;\n ClusterMapConfig clusterMapConfig = new ClusterMapConfig(new VerifiableProperties(props));\n\n try {\n // Null DataNode\n jsonObject =\n TestUtils.getJsonDataNode(TestUtils.getLocalHost(), 6666, ...
{ "fields": [ { "declarator": "datacenter", "modifier": "private final", "original_string": "private final Datacenter datacenter;", "type": "Datacenter", "var_name": "datacenter" }, { "declarator": "hostname", "modifier": "private final", "original_string": ...
{ "body": "List<Disk> getDisks() {\n return disks;\n }", "class_method_signature": "DataNode.getDisks()", "constructor": false, "full_signature": " List<Disk> getDisks()", "identifier": "getDisks", "invocations": [], "modifiers": "", "parameters": "()", "return": "List<Disk>", "signature": "List...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_81
{ "fields": [], "file": "ambry-store/src/test/java/com/github/ambry/store/LogSegmentNameHelperTest.java", "identifier": "LogSegmentNameHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void generateFirstSegmentNameTest() {\n assertEquals(\"Did not get expected name\", \"\", LogSegmentNameHelper.generateFirstSegmentName(false));\n String firstSegmentName = LogSegmentNameHelper.getName(0, 0);\n assertEquals(\"Did not get expected name\", firstSegmentName, LogSegmen...
{ "fields": [ { "declarator": "SUFFIX = BlobStore.SEPARATOR + \"log\"", "modifier": "static final", "original_string": "static final String SUFFIX = BlobStore.SEPARATOR + \"log\";", "type": "String", "var_name": "SUFFIX" }, { "declarator": "COMPARATOR = new Comparator<S...
{ "body": "static String generateFirstSegmentName(boolean isLogSegmented) {\n return isLogSegmented ? getName(0, 0) : \"\";\n }", "class_method_signature": "LogSegmentNameHelper.generateFirstSegmentName(boolean isLogSegmented)", "constructor": false, "full_signature": "static String generateFirstSegmentName...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_224
{ "fields": [ { "declarator": "FRONTEND_CONFIG = new FrontendConfig(new VerifiableProperties(new Properties()))", "modifier": "private static final", "original_string": "private static final FrontendConfig FRONTEND_CONFIG = new FrontendConfig(new VerifiableProperties(new Properties()));", ...
{ "body": "@Test\n public void processResponseTest() throws Exception {\n RestRequest restRequest = createRestRequest(RestMethod.GET, \"/\", null);\n //rest request being null\n TestUtils.assertException(IllegalArgumentException.class,\n () -> securityService.processResponse(null, new MockRestRespons...
{ "fields": [ { "declarator": "OPERATIONS = Collections.unmodifiableSet(\n Utils.getStaticFieldValuesAsStrings(Operations.class)\n .collect(Collectors.toCollection(() -> new TreeSet<>(String.CASE_INSENSITIVE_ORDER))))", "modifier": "static final", "original_string": "static final S...
{ "body": "@Override\n public void processResponse(RestRequest restRequest, RestResponseChannel responseChannel, BlobInfo blobInfo,\n Callback<Void> callback) {\n Exception exception = null;\n frontendMetrics.securityServiceProcessResponseRate.mark();\n long startTimeMs = System.currentTimeMillis();\n ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_39
{ "fields": [ { "declarator": "TEST_TIME_INTERVAL_IN_MS = DELAY_BETWEEN_LAST_MODIFIED_TIMES_MS / 2", "modifier": "private static final", "original_string": "private static final long TEST_TIME_INTERVAL_IN_MS = DELAY_BETWEEN_LAST_MODIFIED_TIMES_MS / 2;", "type": "long", "var_name": "T...
{ "body": "@Test\n public void testValidDataSizeAfterPuts() throws StoreException, IOException {\n assumeTrue(!bucketingEnabled);\n BlobStoreStats blobStoreStats = setupBlobStoreStats(0, 0);\n // advance time to the next second for deletes/expiration to take effect\n advanceTimeToNextSecond();\n long ...
{ "fields": [ { "declarator": "IO_SCHEDULER_JOB_TYPE = \"BlobStoreStats\"", "modifier": "static final", "original_string": "static final String IO_SCHEDULER_JOB_TYPE = \"BlobStoreStats\";", "type": "String", "var_name": "IO_SCHEDULER_JOB_TYPE" }, { "declarator": "IO_SCH...
{ "body": "@Override\n public void close() {\n if (enabled.compareAndSet(true, false)) {\n if (indexScanner != null) {\n indexScanner.cancel();\n }\n if (queueProcessor != null) {\n queueProcessor.cancel();\n }\n }\n }", "class_method_signature": "BlobStoreStats.close()", ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_336
{ "fields": [ { "declarator": "metrics = new DataNodeConfigSourceMetrics(new MetricRegistry())", "modifier": "", "original_string": "DataNodeConfigSourceMetrics metrics = new DataNodeConfigSourceMetrics(new MetricRegistry());", "type": "DataNodeConfigSourceMetrics", "var_name": "metr...
{ "body": "@Test\n public void testSetBothSuccess() {\n when(primarySource.set(any())).thenReturn(true);\n when(secondarySource.set(any())).thenReturn(true);\n DataNodeConfig config = createConfig(1, 1);\n assertTrue(\"Expected success response\", compositeSource.set(config));\n verify(primarySource)....
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(CompositeDataNodeConfigSource.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CompositeDataNodeConfigSource.class);", "type": "Logger", "var_n...
{ "body": "@Override\n public boolean set(DataNodeConfig config) {\n boolean primaryResult = primarySource.set(config);\n try {\n boolean secondaryResult = secondarySource.set(config);\n if (primaryResult != secondaryResult) {\n metrics.setSwallowedErrorCount.inc();\n LOGGER.error(\"Res...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_273
{ "fields": [], "file": "ambry-utils/src/test/java/com/github/ambry/utils/SimpleByteBufferPoolTest.java", "identifier": "SimpleByteBufferPoolTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotEnoughMemory() throws Exception {\n final int size = 1024;\n final long capacity = 1024;\n final long maxBlockTimeInMs = 10;\n SimpleByteBufferPool pool = new SimpleByteBufferPool(capacity);\n pool.allocate(size, maxBlockTimeInMs);\n try {\n pool.allocate(...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(SimpleByteBufferPool.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(SimpleByteBufferPool.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "@Override\n public ByteBuffer allocate(int size, final long timeToBlockInMs) throws TimeoutException, InterruptedException {\n if (size > capacity) {\n throw new IllegalArgumentException(\"Requested size cannot exceed pool capacity.\");\n } else if (timeToBlockInMs < 0) {\n throw new Illeg...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_204
{ "fields": [ { "declarator": "ZK_CLIENT_CONNECT_TIMEOUT_MS = 20 * 1000", "modifier": "private static final", "original_string": "private static final int ZK_CLIENT_CONNECT_TIMEOUT_MS = 20 * 1000;", "type": "int", "var_name": "ZK_CLIENT_CONNECT_TIMEOUT_MS" }, { "declara...
{ "body": "@Test\n public void testUnsubscribeNonExistentListeners() {\n // unsubscribe a non-existent listener should be silent\n helixNotifier.unsubscribe(refTopics.get(0), listeners.get(0));\n }", "class_method_signature": "HelixNotifierTest.testUnsubscribeNonExistentListeners()", "constructor": false,...
{ "fields": [ { "declarator": "TOPIC_PATH = \"/topics\"", "modifier": "private static final", "original_string": "private static final String TOPIC_PATH = \"/topics\";", "type": "String", "var_name": "TOPIC_PATH" }, { "declarator": "MESSAGE_KEY = \"message\"", "mo...
{ "body": "@Override\n public void unsubscribe(String topic, TopicListener<String> topicListener) {\n if (topic == null) {\n throw new IllegalArgumentException(\"topic cannot be null\");\n }\n if (topicListener == null) {\n throw new IllegalArgumentException(\"topicListener cannot be null\");\n ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_341
{ "fields": [ { "declarator": "metrics = new DataNodeConfigSourceMetrics(new MetricRegistry())", "modifier": "", "original_string": "DataNodeConfigSourceMetrics metrics = new DataNodeConfigSourceMetrics(new MetricRegistry());", "type": "DataNodeConfigSourceMetrics", "var_name": "metr...
{ "body": "@Test\n public void testGetException() throws Exception {\n // exception in primary should be thrown\n when(primarySource.get(any())).thenThrow(new RuntimeException());\n DataNodeConfig config = createConfig(1, 1);\n TestUtils.assertException(RuntimeException.class, () -> compositeSource.get(c...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(CompositeDataNodeConfigSource.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CompositeDataNodeConfigSource.class);", "type": "Logger", "var_n...
{ "body": "@Override\n public DataNodeConfig get(String instanceName) {\n DataNodeConfig primaryResult = primarySource.get(instanceName);\n try {\n DataNodeConfig secondaryResult = secondarySource.get(instanceName);\n if (!Objects.equals(primaryResult, secondaryResult)) {\n metrics.getSwallowe...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_253
{ "fields": [ { "declarator": "RANDOM = new Random()", "modifier": "private static final", "original_string": "private static final Random RANDOM = new Random();", "type": "Random", "var_name": "RANDOM" }, { "declarator": "ALPHABET = \"abcdefghijklmnopqrstuvwxyz\"", ...
{ "body": "@Test\n public void getUserMetadataGoodInputTest() throws Exception {\n JSONObject headers = new JSONObject();\n setAmbryHeadersForPut(headers, Long.toString(RANDOM.nextInt(10000)), generateRandomString(10),\n Container.DEFAULT_PUBLIC_CONTAINER, \"image/gif\", generateRandomString(10));\n ...
{ "fields": [ { "declarator": "HTTP_DATE_FORMAT = \"EEE, dd MMM yyyy HH:mm:ss zzz\"", "modifier": "public static final", "original_string": "public static final String HTTP_DATE_FORMAT = \"EEE, dd MMM yyyy HH:mm:ss zzz\";", "type": "String", "var_name": "HTTP_DATE_FORMAT" }, ...
{ "body": "public static boolean setUserMetadataHeaders(byte[] userMetadata, RestResponseChannel restResponseChannel)\n throws RestServiceException {\n Map<String, String> userMetadataMap = buildUserMetadata(userMetadata);\n boolean setHeaders = userMetadataMap != null;\n if (setHeaders) {\n for (M...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_19
{ "fields": [ { "declarator": "ZK_CLIENT_CONNECTION_TIMEOUT_MS = 20000", "modifier": "private static final", "original_string": "private static final int ZK_CLIENT_CONNECTION_TIMEOUT_MS = 20000;", "type": "int", "var_name": "ZK_CLIENT_CONNECTION_TIMEOUT_MS" }, { "declar...
{ "body": "@Test\n public void testConflictingSnapshotVersionUpdate() throws Exception {\n accountService = mockHelixAccountServiceFactory.getAccountService();\n // write two accounts (1, \"a\") and (2, \"b\")\n writeAccountsForConflictTest();\n Account expectedAccount = accountService.getAccountById((sh...
{ "fields": [ { "declarator": "ACCOUNT_METADATA_CHANGE_TOPIC = \"account_metadata_change_topic\"", "modifier": "static final", "original_string": "static final String ACCOUNT_METADATA_CHANGE_TOPIC = \"account_metadata_change_topic\";", "type": "String", "var_name": "ACCOUNT_METADATA_...
{ "body": "@Override\n public boolean updateAccounts(Collection<Account> accounts) {\n return updateAccountsWithAccountMetadataStore(accounts, accountMetadataStore);\n }", "class_method_signature": "HelixAccountService.updateAccounts(Collection<Account> accounts)", "constructor": false, "full_signature": "...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_316
{ "fields": [ { "declarator": "clusterMap = new MockReadingClusterMap()", "modifier": "private final", "original_string": "private final ClusterMap clusterMap = new MockReadingClusterMap();", "type": "ClusterMap", "var_name": "clusterMap" }, { "declarator": "blobIdFacto...
{ "body": "@Test\n public void testNullTransformInput() throws Exception {\n assertException(transformer.transform(null), NullPointerException.class);\n }", "class_method_signature": "BlobIdTransformerTest.testNullTransformInput()", "constructor": false, "full_signature": "@Test public void testNullTransfo...
{ "fields": [ { "declarator": "storeKeyConverter", "modifier": "private final", "original_string": "private final StoreKeyConverter storeKeyConverter;", "type": "StoreKeyConverter", "var_name": "storeKeyConverter" }, { "declarator": "storeKeyFactory", "modifier": ...
{ "body": "@Override\n public TransformationOutput transform(Message message) {\n Message transformedMsg = null;\n try {\n Objects.requireNonNull(message, \"message must not be null\");\n Objects.requireNonNull(message.getMessageInfo(), \"message's messageInfo must not be null\");\n Objects.requ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_195
{ "fields": [ { "declarator": "DEFAULT_PARALLELISM = 3", "modifier": "private static final", "original_string": "private static final int DEFAULT_PARALLELISM = 3;", "type": "int", "var_name": "DEFAULT_PARALLELISM" }, { "declarator": "DEFAULT_SUCCESS_TARGET = 2", "...
{ "body": "@Test\n public void duplicateBlobIdsTest() throws RouterException {\n blobIds.add(blobIds.get(0));\n try {\n ttlUpdateManager.submitTtlUpdateOperation(blobIds, UPDATE_SERVICE_ID, Utils.Infinite_Time, new FutureResult<>(),\n new TestCallback<>());\n fail(\"Should have failed to sub...
{ "fields": [ { "declarator": "clusterMap", "modifier": "private final", "original_string": "private final ClusterMap clusterMap;", "type": "ClusterMap", "var_name": "clusterMap" }, { "declarator": "notificationSystem", "modifier": "private final", "original...
{ "body": "void submitTtlUpdateOperation(Collection<String> blobIdStrs, String serviceId, long expiresAtMs,\n FutureResult<Void> futureResult, Callback<Void> callback) throws RouterException {\n List<BlobId> blobIds = new ArrayList<>();\n for (String blobIdStr : blobIdStrs) {\n BlobId blobId = RouterU...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_245
{ "fields": [ { "declarator": "CLUSTER_NAME = \"Ambry-TesT\"", "modifier": "private static final", "original_string": "private static final String CLUSTER_NAME = \"Ambry-TesT\";", "type": "String", "var_name": "CLUSTER_NAME" } ], "file": "ambry-api/src/test/java/com/github/am...
{ "body": "@Test\n public void testRequestPathParsing() {\n String baseId = \"expectedOpOrId\";\n String queryString = \"?queryParam1=queryValue1&queryParam2=queryParam2=queryValue2\";\n String securePath = \"secure-path\";\n List<String> prefixesToRemove = Arrays.asList(\"media\", \"toRemove/multipart\"...
{ "fields": [ { "declarator": "prefix", "modifier": "private final", "original_string": "private final String prefix;", "type": "String", "var_name": "prefix" }, { "declarator": "clusterName", "modifier": "private final", "original_string": "private final St...
{ "body": "@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (o == null || getClass() != o.getClass()) {\n return false;\n }\n RequestPath that = (RequestPath) o;\n return prefix.equals(that.prefix) && clusterName.equals(that.clusterName) && operatio...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_300
{ "fields": [ { "declarator": "STATIC_FIELD_TEST_STRING = \"field1\"", "modifier": "static final", "original_string": "static final String STATIC_FIELD_TEST_STRING = \"field1\";", "type": "String", "var_name": "STATIC_FIELD_TEST_STRING" } ], "file": "ambry-utils/src/test/java...
{ "body": "@Test\n public void getTtlInSecsFromExpiryMsTest() {\n long creationTimeMs = SystemTime.getInstance().milliseconds();\n for (long ttlInSecs : new long[]{1, 20, 1000, Integer.MAX_VALUE, Utils.Infinite_Time, -100,\n -(TimeUnit.MILLISECONDS.toSeconds(creationTimeMs) + 1)}) {\n long expected...
{ "fields": [ { "declarator": "Infinite_Time = -1", "modifier": "public static final", "original_string": "public static final long Infinite_Time = -1;", "type": "long", "var_name": "Infinite_Time" }, { "declarator": "MIN_PORT_NUM = 1", "modifier": "public static ...
{ "body": "public static long getTtlInSecsFromExpiryMs(long expiresAtMs, long creationTimeMs) {\n return expiresAtMs == Utils.Infinite_Time ? Utils.Infinite_Time\n : Math.max(0, TimeUnit.MILLISECONDS.toSeconds(expiresAtMs - creationTimeMs));\n }", "class_method_signature": "Utils.getTtlInSecsFromExpiryMs...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_183
{ "fields": [ { "declarator": "CHUNK_SIZE = new Random().nextInt(1024 * 1024) + 8191", "modifier": "private static final", "original_string": "private static final int CHUNK_SIZE = new Random().nextInt(1024 * 1024) + 8191;", "type": "int", "var_name": "CHUNK_SIZE" }, { ...
{ "body": "@Test\n public void testCompositeBlobGetSuccessStitchDifferentSizedBlobs() throws Exception {\n if (metadataContentVersion > MessageFormatRecord.Metadata_Content_Version_V2) {\n testGetSuccessStitch(LARGE_BLOB_SIZE, new GetBlobOptionsBuilder().build());\n } else {\n router = getNonBlocking...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(GetManager.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(GetManager.class);", "type": "Logger", "var_name": "logger" }, { "dec...
{ "body": "void close() {\n for (GetOperation op : getOperations) {\n removeAndAbort(op,\n new RouterException(\"Aborted operation because Router is closed\", RouterErrorCode.RouterClosed));\n }\n }", "class_method_signature": "GetManager.close()", "constructor": false, "full_signature": " ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_212
{ "fields": [ { "declarator": "nettyByteBufLeakHelper = new NettyByteBufLeakHelper()", "modifier": "private final", "original_string": "private final NettyByteBufLeakHelper nettyByteBufLeakHelper = new NettyByteBufLeakHelper();", "type": "NettyByteBufLeakHelper", "var_name": "nettyBy...
{ "body": "@Test\n public void basicsTestWithNettyByteBuf() throws Exception {\n for (boolean useCompositeByteBuf : Arrays.asList(false, true)) {\n List<byte[]> inputBuffers = getBuffers(1000, 20, 201, 0, 79, 1005);\n RetainingAsyncWritableChannel channel = new RetainingAsyncWritableChannel();\n fo...
{ "fields": [ { "declarator": "sizeLimitInBytes", "modifier": "private final", "original_string": "private final long sizeLimitInBytes;", "type": "long", "var_name": "sizeLimitInBytes" }, { "declarator": "open = true", "modifier": "private volatile", "origin...
{ "body": "@Override\n public void close() {\n open = false;\n synchronized (bufferLock) {\n if (compositeBuffer != null) {\n compositeBuffer.release();\n compositeBuffer = null;\n }\n }\n }", "class_method_signature": "RetainingAsyncWritableChannel.close()", "constructor": fals...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_58
{ "fields": [ { "declarator": "RANDOM = new Random()", "modifier": "private static final", "original_string": "private static final Random RANDOM = new Random();", "type": "Random", "var_name": "RANDOM" }, { "declarator": "CLUSTER_NAME = \"AmbryTestCluster\"", "mo...
{ "body": "@Test\n public void removeBlobStoreTest() throws Exception {\n MockDataNodeId dataNode = clusterMap.getDataNodes().get(0);\n List<ReplicaId> replicas = clusterMap.getReplicaIds(dataNode);\n List<MockDataNodeId> dataNodes = new ArrayList<>();\n dataNodes.add(dataNode);\n MockPartitionId inva...
{ "fields": [ { "declarator": "partitionToDiskManager = new ConcurrentHashMap<>()", "modifier": "protected final", "original_string": "protected final ConcurrentHashMap<PartitionId, DiskManager> partitionToDiskManager = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<PartitionId, D...
{ "body": "@Override\n public boolean removeBlobStore(PartitionId id) {\n DiskManager diskManager = partitionToDiskManager.get(id);\n if (diskManager == null) {\n logger.info(\"Store {} is not found in storage manager\", id);\n return false;\n }\n if (!diskManager.removeBlobStore(id)) {\n ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_357
{ "fields": [ { "declarator": "clusterMapConfig", "modifier": "private final", "original_string": "private final ClusterMapConfig clusterMapConfig;", "type": "ClusterMapConfig", "var_name": "clusterMapConfig" }, { "declarator": "folder = new TemporaryFolder()", "m...
{ "body": "@Test\n public void persistAndReadBack() throws Exception {\n String tmpDir = folder.getRoot().getPath();\n Properties props = new Properties();\n props.setProperty(\"clustermap.cluster.name\", \"test\");\n props.setProperty(\"clustermap.datacenter.name\", \"dc1\");\n props.setProperty(\"cl...
{ "fields": [ { "declarator": "hardwareLayout", "modifier": "protected final", "original_string": "protected final HardwareLayout hardwareLayout;", "type": "HardwareLayout", "var_name": "hardwareLayout" }, { "declarator": "partitionLayout", "modifier": "protected ...
{ "body": "void persist(String hardwareLayoutPath, String partitionLayoutPath) throws IOException, JSONException {\n logger.trace(\"persist {}, {}\", hardwareLayoutPath, partitionLayoutPath);\n writeJsonObjectToFile(hardwareLayout.toJSONObject(), hardwareLayoutPath);\n writeJsonObjectToFile(partitionLayout.t...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_4
{ "fields": [ { "declarator": "mySqlAccountService", "modifier": "", "original_string": "AccountService mySqlAccountService;", "type": "AccountService", "var_name": "mySqlAccountService" }, { "declarator": "mySqlConfigProps = new Properties()", "modifier": "", ...
{ "body": "@Test\n public void testUpdateNameConflictingAccounts() throws IOException {\n AccountServiceMetrics accountServiceMetrics = new AccountServiceMetrics(new MetricRegistry());\n mySqlAccountService = new MySqlAccountService(accountServiceMetrics,\n new MySqlAccountServiceConfig(new VerifiablePr...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MySqlAccountService.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(MySqlAccountService.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public boolean updateAccounts(Collection<Account> accounts) {\n Objects.requireNonNull(accounts, \"accounts cannot be null\");\n if (accounts.isEmpty()) {\n logger.debug(\"Empty account collection to update.\");\n return false;\n }\n\n if (mySqlAccountStore == null) {\n ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_286
{ "fields": [ { "declarator": "STATIC_FIELD_TEST_STRING = \"field1\"", "modifier": "static final", "original_string": "static final String STATIC_FIELD_TEST_STRING = \"field1\";", "type": "String", "var_name": "STATIC_FIELD_TEST_STRING" } ], "file": "ambry-utils/src/test/java...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testGetRandomLongException() {\n Utils.getRandomLong(new Random(), 0);\n }", "class_method_signature": "UtilsTest.testGetRandomLongException()", "constructor": false, "full_signature": "@Test(expected = IllegalArgumentException.class...
{ "fields": [ { "declarator": "Infinite_Time = -1", "modifier": "public static final", "original_string": "public static final long Infinite_Time = -1;", "type": "long", "var_name": "Infinite_Time" }, { "declarator": "MIN_PORT_NUM = 1", "modifier": "public static ...
{ "body": "public static long getRandomLong(Random random, long n) {\n if (n <= 0) {\n throw new IllegalArgumentException(\"Cannot generate random long in range [0,n) for n<=0.\");\n }\n\n final int BITS_PER_LONG = 63;\n long bits, val;\n do {\n bits = random.nextLong() & (~(1L << BITS_PER_LO...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_23
{ "fields": [ { "declarator": "accountConfig", "modifier": "private final", "original_string": "private final JsonAccountConfig accountConfig;", "type": "JsonAccountConfig", "var_name": "accountConfig" }, { "declarator": "accountService", "modifier": "private", ...
{ "body": "@Test\n public void testNonExistingAccountsAfterMultipleChanges() throws Exception {\n for (short x = 0; x < 10; x++) {\n Collection<Account> generatedAccounts = generateAccountJsonFile((short) 100, (short) (x + 5), DEFAULT_SEED_1);\n accountService.processAccountJsonFile();\n\n verifyNo...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(JsonAccountService.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(JsonAccountService.class);", "type": "Logger", "var_name": "logger" }, ...
{ "body": "public void processAccountJsonFile() {\n processAccountJsonLock.lock();\n\n try {\n accountJsonProcessingStartTimeMs = System.currentTimeMillis();\n\n logger.trace(\"Checking if JSON account file has changed.\");\n\n if (!Files.exists(accountFile)) {\n logger.warn(\"Unable to op...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_269
{ "fields": [ { "declarator": "ROUND_TRIP_TIME_THRESHOLD = 500", "modifier": "private static final", "original_string": "private static final long ROUND_TRIP_TIME_THRESHOLD = 500;", "type": "long", "var_name": "ROUND_TRIP_TIME_THRESHOLD" }, { "declarator": "TIME_TO_FIRS...
{ "body": "@Test\n public void checkThresholdsTest() {\n Map<PerformanceIndex, Long> dataToCheck = new HashMap<>();\n // test the exception due to no data to check\n try {\n thresholds.checkThresholds(dataToCheck);\n fail(\"should fail due to empty input\");\n } catch (Exception e) {\n ass...
{ "fields": [ { "declarator": "perfIndicesAndCriteria", "modifier": "private final", "original_string": "private final Map<PerformanceIndex, Criteria> perfIndicesAndCriteria;", "type": "Map<PerformanceIndex, Criteria>", "var_name": "perfIndicesAndCriteria" } ], "file": "ambry...
{ "body": "public boolean checkThresholds(Map<PerformanceIndex, Long> dataToCheck) {\n for (Map.Entry<PerformanceIndex, Criteria> indicesAndCriteria : perfIndicesAndCriteria.entrySet()) {\n PerformanceIndex perfIndex = indicesAndCriteria.getKey();\n Criteria criteria = indicesAndCriteria.getValue();\n ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_140
{ "fields": [], "file": "ambry-cloud/src/test/java/com/github/ambry/cloud/azure/CosmosChangeFeedFindTokenFactoryTest.java", "identifier": "CosmosChangeFeedFindTokenFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getNewFindTokenTest() {\n CosmosChangeFeedFindToken cosmosChangeFeedFindToken1 =\n (CosmosChangeFeedFindToken) new CosmosChangeFeedFindTokenFactory().getNewFindToken();\n CosmosChangeFeedFindToken cosmosChangeFeedFindToken2 = new CosmosChangeFeedFindToken();\n assertEqu...
{ "fields": [], "file": "ambry-cloud/src/main/java/com/github/ambry/cloud/azure/CosmosChangeFeedFindTokenFactory.java", "identifier": "CosmosChangeFeedFindTokenFactory", "interfaces": "implements FindTokenFactory", "methods": [ { "class_method_signature": "CosmosChangeFeedFindTokenFactory.getFindTok...
{ "body": "@Override\n public FindToken getNewFindToken() {\n return new CosmosChangeFeedFindToken();\n }", "class_method_signature": "CosmosChangeFeedFindTokenFactory.getNewFindToken()", "constructor": false, "full_signature": "@Override public FindToken getNewFindToken()", "identifier": "getNewFindToke...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_74
{ "fields": [ { "declarator": "STANDARD_SEGMENT_SIZE = 1024", "modifier": "private static final", "original_string": "private static final int STANDARD_SEGMENT_SIZE = 1024;", "type": "int", "var_name": "STANDARD_SEGMENT_SIZE" }, { "declarator": "BIG_SEGMENT_SIZE = 3 * L...
{ "body": "@Test\n public void writeFromTest() throws IOException, StoreException {\n String currSegmentName = \"log_current\";\n LogSegment segment = getSegment(currSegmentName, STANDARD_SEGMENT_SIZE, true);\n try {\n long writeStartOffset = segment.getStartOffset();\n byte[] bufOne = TestUtils.g...
{ "fields": [ { "declarator": "VERSION = 0", "modifier": "private static final", "original_string": "private static final short VERSION = 0;", "type": "short", "var_name": "VERSION" }, { "declarator": "VERSION_HEADER_SIZE = 2", "modifier": "private static final", ...
{ "body": "void writeFrom(ReadableByteChannel channel, long offset, long size) throws IOException {\n if (offset < startOffset || offset >= capacityInBytes) {\n throw new IndexOutOfBoundsException(\n \"Provided offset [\" + offset + \"] is out of bounds for the segment [\" + file.getAbsolutePath()\n ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_394
{ "fields": [ { "declarator": "diskMocks = new Mocks()", "modifier": "private final", "original_string": "private final Mocks diskMocks = new Mocks();", "type": "Mocks", "var_name": "diskMocks" }, { "declarator": "cloudMocks = new Mocks()", "modifier": "private fi...
{ "body": "@Test\n public void testSendAndPoll() throws IOException {\n NetworkClient compositeClient = factory.getNetworkClient();\n\n // a couple for the first client and one request for the second client\n List<RequestInfo> requestsToSendOne =\n Arrays.asList(getRequestInfo(ReplicaType.DISK_BACKED...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(CompositeNetworkClient.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(CompositeNetworkClient.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public List<ResponseInfo> sendAndPoll(List<RequestInfo> allRequestsToSend, Set<Integer> allRequestsToDrop,\n int pollTimeoutMs) {\n // prepare lists of requests to send and drop\n EnumMap<ReplicaType, List<RequestInfo>> requestsToSendByType = new EnumMap<>(ReplicaType.class);\n E...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_117
{ "fields": [ { "declarator": "base64key = Base64.encodeBase64String(\"ambrykey\".getBytes())", "modifier": "private final", "original_string": "private final String base64key = Base64.encodeBase64String(\"ambrykey\".getBytes());", "type": "String", "var_name": "base64key" }, ...
{ "body": "@Test\n public void testGetDeadBlobs() throws Exception {\n Observable<FeedResponse<Document>> mockResponse = getMockedObservableForQueryWithNoResults();\n when(mockumentClient.queryDocuments(anyString(), any(SqlQuerySpec.class), any(FeedOptions.class))).thenReturn(\n mockResponse);\n long...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(AzureStorageCompactor.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(AzureStorageCompactor.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "List<CloudBlobMetadata> getDeadBlobs(String partitionPath, String fieldName, long startTime, long endTime,\n int maxEntries) throws CloudStorageException {\n try {\n return cosmosDataAccessor.getDeadBlobs(partitionPath, fieldName, startTime, endTime, maxEntries);\n } catch (DocumentClientEx...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_402
{ "fields": [ { "declarator": "server1 = null", "modifier": "private", "original_string": "private SocketServer server1 = null;", "type": "SocketServer", "var_name": "server1" }, { "declarator": "server2 = null", "modifier": "private", "original_string": "pr...
{ "body": "@Test\n public void testBlockingChannelConnectionPool() throws Exception {\n Properties props = new Properties();\n props.put(\"connectionpool.max.connections.per.port.plain.text\", \"5\");\n props.put(\"connectionpool.max.connections.per.port.ssl\", \"5\");\n props.put(\"clustermap.cluster.na...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(BlockingChannelConnectionPool.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(BlockingChannelConnectionPool.class);", "type": "Logger", "var_n...
{ "body": "public BlockingChannelConnectionPool(ConnectionPoolConfig config, SSLConfig sslConfig,\n ClusterMapConfig clusterMapConfig, MetricRegistry registry) throws Exception {\n connections = new ConcurrentHashMap<String, BlockingChannelInfo>();\n this.config = config;\n this.registry = registry;\n ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_62
{ "fields": [ { "declarator": "RANDOM = new Random()", "modifier": "private static final", "original_string": "private static final Random RANDOM = new Random();", "type": "Random", "var_name": "RANDOM" }, { "declarator": "CLUSTER_NAME = \"AmbryTestCluster\"", "mo...
{ "body": "@Test\n public void residualDirDeletionTest() throws Exception {\n MockDataNodeId localNode = clusterMap.getDataNodes().get(0);\n List<ReplicaId> replicas = clusterMap.getReplicaIds(localNode);\n MockClusterParticipant mockHelixParticipant = new MockClusterParticipant();\n // create an extra s...
{ "fields": [ { "declarator": "partitionToDiskManager = new ConcurrentHashMap<>()", "modifier": "protected final", "original_string": "protected final ConcurrentHashMap<PartitionId, DiskManager> partitionToDiskManager = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<PartitionId, D...
{ "body": "public void start() throws InterruptedException {\n long startTimeMs = time.milliseconds();\n try {\n logger.info(\"Starting storage manager\");\n List<Thread> startupThreads = new ArrayList<>();\n for (final DiskManager diskManager : diskToDiskManager.values()) {\n Thread threa...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_382
{ "fields": [ { "declarator": "CHECKOUT_TIMEOUT_MS = 1000", "modifier": "private static final", "original_string": "private static final int CHECKOUT_TIMEOUT_MS = 1000;", "type": "int", "var_name": "CHECKOUT_TIMEOUT_MS" }, { "declarator": "MAX_PORTS_PLAIN_TEXT = 3", ...
{ "body": "@Test\n public void testNetworkError() {\n List<RequestInfo> requestInfoList = new ArrayList<>();\n List<ResponseInfo> responseInfoList;\n requestInfoList.add(new RequestInfo(sslHost, sslPort, new MockSend(5), replicaOnSslNode));\n requestInfoList.add(new RequestInfo(sslHost, sslPort, new Mock...
{ "fields": [ { "declarator": "selector", "modifier": "private final", "original_string": "private final Selector selector;", "type": "Selector", "var_name": "selector" }, { "declarator": "connectionTracker", "modifier": "private final", "original_string": "...
{ "body": "@Override\n public List<ResponseInfo> sendAndPoll(List<RequestInfo> requestsToSend, Set<Integer> requestsToDrop,\n int pollTimeoutMs) {\n if (closed || !selector.isOpen()) {\n throw new IllegalStateException(\"The SocketNetworkClient is closed.\");\n }\n long startTime = time.millisecon...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_228
{ "fields": [], "file": "ambry-frontend/src/test/java/com/github/ambry/frontend/FrontendUtilsTest.java", "identifier": "FrontendUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetBlobIdFromString() throws IOException, RestServiceException {\n // good path\n byte[] bytes = new byte[2];\n ClusterMap referenceClusterMap = new MockClusterMap();\n TestUtils.RANDOM.nextBytes(bytes);\n BlobId.BlobIdType referenceType =\n TestUtils.RANDOM.n...
{ "fields": [], "file": "ambry-frontend/src/main/java/com/github/ambry/frontend/FrontendUtils.java", "identifier": "FrontendUtils", "interfaces": "", "methods": [ { "class_method_signature": "FrontendUtils.getBlobIdFromString(String blobIdStr, ClusterMap clusterMap)", "constructor": false, ...
{ "body": "static BlobId getBlobIdFromString(String blobIdStr, ClusterMap clusterMap) throws RestServiceException {\n try {\n return new BlobId(blobIdStr, clusterMap);\n } catch (Exception e) {\n throw new RestServiceException(\"Invalid blob id=\" + blobIdStr, RestServiceErrorCode.BadRequest);\n }\...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_101
{ "fields": [ { "declarator": "MOUNT_PATH = \"/tmp/\"", "modifier": "private static final", "original_string": "private static final String MOUNT_PATH = \"/tmp/\";", "type": "String", "var_name": "MOUNT_PATH" }, { "declarator": "ALL_COMPACTION_TRIGGERS = \"Periodic,Admi...
{ "body": "@Test\n public void testDifferentTriggers() {\n blobStore.details = generateRandomCompactionDetails(2);\n Runnable adminDisabledChecker =\n () -> assertFalse(\"Compaction should not be scheduled\", compactionManager.scheduleNextForCompaction(blobStore));\n\n // 1. all enabled is already te...
{ "fields": [ { "declarator": "THREAD_NAME_PREFIX = \"StoreCompactionThread-\"", "modifier": "static final", "original_string": "static final String THREAD_NAME_PREFIX = \"StoreCompactionThread-\";", "type": "String", "var_name": "THREAD_NAME_PREFIX" }, { "declarator": ...
{ "body": "boolean scheduleNextForCompaction(BlobStore store) {\n return compactionExecutor != null && compactionExecutor.scheduleNextForCompaction(store);\n }", "class_method_signature": "CompactionManager.scheduleNextForCompaction(BlobStore store)", "constructor": false, "full_signature": " boolean schedu...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_35
{ "fields": [ { "declarator": "SEGMENT_CAPACITY = 512", "modifier": "private static final", "original_string": "private static final long SEGMENT_CAPACITY = 512;", "type": "long", "var_name": "SEGMENT_CAPACITY" }, { "declarator": "LOG_CAPACITY = 12 * SEGMENT_CAPACITY", ...
{ "body": "@Test\n public void constructionFailureTest() throws IOException, StoreException {\n List<Pair<Long, Long>> logAndSegmentSizes = new ArrayList<>();\n // <=0 values for capacities\n logAndSegmentSizes.add(new Pair<>(-1L, SEGMENT_CAPACITY));\n logAndSegmentSizes.add(new Pair<>(LOG_CAPACITY, -1L)...
{ "fields": [ { "declarator": "dataDir", "modifier": "private final", "original_string": "private final String dataDir;", "type": "String", "var_name": "dataDir" }, { "declarator": "capacityInBytes", "modifier": "private final", "original_string": "private f...
{ "body": "File allocate(String filename, long size, boolean requestSwapSegment) throws StoreException {\n File segmentFile = new File(dataDir, filename);\n if (!segmentFile.exists()) {\n try {\n diskSpaceAllocator.allocate(segmentFile, size, storeId, requestSwapSegment);\n } catch (IOException...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_290
{ "fields": [ { "declarator": "STATIC_FIELD_TEST_STRING = \"field1\"", "modifier": "static final", "original_string": "static final String STATIC_FIELD_TEST_STRING = \"field1\";", "type": "String", "var_name": "STATIC_FIELD_TEST_STRING" } ], "file": "ambry-utils/src/test/java...
{ "body": "@Test\n public void testGetIntStringLength() {\n for (int i = 0; i < 10; i++) {\n String value = TestUtils.getRandomString(1000 + TestUtils.RANDOM.nextInt(10000));\n assertEquals(\"Size mismatch \", Integer.BYTES + value.length(), Utils.getIntStringLength(value));\n }\n assertEquals(\"S...
{ "fields": [ { "declarator": "Infinite_Time = -1", "modifier": "public static final", "original_string": "public static final long Infinite_Time = -1;", "type": "long", "var_name": "Infinite_Time" }, { "declarator": "MIN_PORT_NUM = 1", "modifier": "public static ...
{ "body": "public static int getIntStringLength(String value) {\n return value == null ? Integer.BYTES : Integer.BYTES + value.length();\n }", "class_method_signature": "Utils.getIntStringLength(String value)", "constructor": false, "full_signature": "public static int getIntStringLength(String value)", "...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_156
{ "fields": [ { "declarator": "SMALL_BLOB_SIZE = 100", "modifier": "private static final", "original_string": "private static final int SMALL_BLOB_SIZE = 100;", "type": "int", "var_name": "SMALL_BLOB_SIZE" }, { "declarator": "isVcr", "modifier": "private final", ...
{ "body": "@Test\n public void testFindEntriesSince() throws Exception {\n setupCloudStore(false, true, defaultCacheLimit, true);\n long maxTotalSize = 1000000;\n // 1) start with empty token, call find, return some data\n long blobSize = 200000;\n int numBlobsFound = 5;\n CosmosChangeFeedFindToken...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(CloudBlobStore.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(CloudBlobStore.class);", "type": "Logger", "var_name": "logger" }, { ...
{ "body": "@Override\n public FindInfo findEntriesSince(FindToken token, long maxTotalSizeOfEntries) throws StoreException {\n try {\n FindResult findResult = requestAgent.doWithRetries(\n () -> cloudDestination.findEntriesSince(partitionId.toPathString(), token, maxTotalSizeOfEntries),\n \...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_157
{ "fields": [ { "declarator": "mockClusterAgentsFactory", "modifier": "private static", "original_string": "private static MockClusterAgentsFactory mockClusterAgentsFactory;", "type": "MockClusterAgentsFactory", "var_name": "mockClusterAgentsFactory" }, { "declarator": ...
{ "body": "@Test\n public void helixVcrClusterTest() throws Exception {\n StrictMatchExternalViewVerifier helixBalanceVerifier =\n new StrictMatchExternalViewVerifier(ZK_CONNECT_STRING, VCR_CLUSTER_NAME,\n Collections.singleton(VcrTestUtil.helixResource), null);\n // Create helixInstance1 and...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(HelixVcrCluster.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(HelixVcrCluster.class);", "type": "Logger", "var_name": "logger" }, { ...
{ "body": "public HelixVcrCluster(CloudConfig cloudConfig, ClusterMapConfig clusterMapConfig, ClusterMap clusterMap) {\n if (Utils.isNullOrEmpty(cloudConfig.vcrClusterZkConnectString)) {\n throw new IllegalArgumentException(\"Missing value for \" + CloudConfig.VCR_CLUSTER_ZK_CONNECT_STRING);\n } else if (U...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_34
{ "fields": [], "file": "ambry-store/src/test/java/com/github/ambry/store/DiskIOSchedulerTest.java", "identifier": "DiskIOSchedulerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void nullThrottlersTest() throws Exception {\n DiskIOScheduler scheduler = new DiskIOScheduler(null);\n assertEquals(\"Unexpected i/o slice availability returned\", Long.MAX_VALUE, scheduler.getSlice(\"jobType\", \"job\", 0));\n }", "class_method_signature": "DiskIOSchedulerTest.nu...
{ "fields": [ { "declarator": "throttlers", "modifier": "private final", "original_string": "private final Map<String, Throttler> throttlers;", "type": "Map<String, Throttler>", "var_name": "throttlers" } ], "file": "ambry-store/src/main/java/com/github/ambry/store/DiskIOSche...
{ "body": "long getSlice(String jobType, String jobId, long usedSinceLastCall) {\n Throttler throttler = throttlers.get(jobType);\n if (throttler != null) {\n try {\n throttler.maybeThrottle(usedSinceLastCall);\n } catch (InterruptedException e) {\n throw new IllegalStateException(\"Thro...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_291
{ "fields": [ { "declarator": "STATIC_FIELD_TEST_STRING = \"field1\"", "modifier": "static final", "original_string": "static final String STATIC_FIELD_TEST_STRING = \"field1\";", "type": "String", "var_name": "STATIC_FIELD_TEST_STRING" } ], "file": "ambry-utils/src/test/java...
{ "body": "@Test\n public void testSerializeNullableString() {\n String randomString = TestUtils.getRandomString(10);\n ByteBuffer outputBuffer = ByteBuffer.allocate(4 + randomString.getBytes().length);\n Utils.serializeNullableString(outputBuffer, randomString);\n outputBuffer.flip();\n int length = ...
{ "fields": [ { "declarator": "Infinite_Time = -1", "modifier": "public static final", "original_string": "public static final long Infinite_Time = -1;", "type": "long", "var_name": "Infinite_Time" }, { "declarator": "MIN_PORT_NUM = 1", "modifier": "public static ...
{ "body": "public static void serializeNullableString(ByteBuffer outputBuffer, String value) {\n if (value == null) {\n outputBuffer.putInt(0);\n } else {\n serializeString(outputBuffer, value, Charset.defaultCharset());\n }\n }", "class_method_signature": "Utils.serializeNullableString(ByteBuff...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_100
{ "fields": [ { "declarator": "PUT_RECORD_SIZE = 53", "modifier": "static final", "original_string": "static final int PUT_RECORD_SIZE = 53;", "type": "int", "var_name": "PUT_RECORD_SIZE" }, { "declarator": "MOCK_ID_STRING_LENGTH = 10", "modifier": "static final",...
{ "body": "@Test\n public void resolveStoreInitialStateTest() throws Exception {\n store.shutdown();\n properties.setProperty(StoreConfig.storeReplicaStatusDelegateEnableName, \"true\");\n File storeDir = StoreTestUtils.createTempDirectory(\"store-\" + storeId);\n File reserveDir = StoreTestUtils.createT...
{ "fields": [ { "declarator": "SEPARATOR = \"_\"", "modifier": "static final", "original_string": "static final String SEPARATOR = \"_\";", "type": "String", "var_name": "SEPARATOR" }, { "declarator": "BOOTSTRAP_FILE_NAME = \"bootstrap_in_progress\"", "modifier": ...
{ "body": "private void resolveStoreInitialState() {\n // Determine if HelixParticipant is adopted.\n if (replicaStatusDelegates != null && !replicaStatusDelegates.isEmpty() && replicaStatusDelegates.get(0)\n .supportsStateChanges()) {\n // If store is managed by Helix, Helix controller will update ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_63
{ "fields": [], "file": "ambry-store/src/test/java/com/github/ambry/store/CostBenefitInfoTest.java", "identifier": "CostBenefitInfoTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCostBenefitInfo() {\n for (int i = 0; i < 5; i++) {\n List<String> randomSegments = CompactionPolicyTest.generateRandomLogSegmentName(3);\n long cost = getRandomCost();\n int benefit = 1 + TestUtils.RANDOM.nextInt(Integer.MAX_VALUE);\n CostBenefitInfo actual ...
{ "fields": [ { "declarator": "cost", "modifier": "private final", "original_string": "private final long cost;", "type": "long", "var_name": "cost" }, { "declarator": "benefit", "modifier": "private final", "original_string": "private final int benefit;", ...
{ "body": "CostBenefitInfo(List<String> segmentsToCompact, long cost, int benefit) {\n this.segmentsToCompact = segmentsToCompact;\n this.cost = cost;\n this.benefit = benefit;\n costBenefitRatio = benefit == 0 ? Double.MAX_VALUE : cost * (1.0 / benefit);\n }", "class_method_signature": "CostBenefitInf...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_383
{ "fields": [ { "declarator": "CHECKOUT_TIMEOUT_MS = 1000", "modifier": "private static final", "original_string": "private static final int CHECKOUT_TIMEOUT_MS = 1000;", "type": "int", "var_name": "CHECKOUT_TIMEOUT_MS" }, { "declarator": "MAX_PORTS_PLAIN_TEXT = 3", ...
{ "body": "@Test\n public void testExceptionOnConnect() {\n List<RequestInfo> requestInfoList = new ArrayList<>();\n // test that IllegalStateException would be thrown if replica is not specified in RequestInfo\n requestInfoList.add(new RequestInfo(sslHost, sslPort, new MockSend(-1), null));\n networkCli...
{ "fields": [ { "declarator": "selector", "modifier": "private final", "original_string": "private final Selector selector;", "type": "Selector", "var_name": "selector" }, { "declarator": "connectionTracker", "modifier": "private final", "original_string": "...
{ "body": "@Override\n public List<ResponseInfo> sendAndPoll(List<RequestInfo> requestsToSend, Set<Integer> requestsToDrop,\n int pollTimeoutMs) {\n if (closed || !selector.isOpen()) {\n throw new IllegalStateException(\"The SocketNetworkClient is closed.\");\n }\n long startTime = time.millisecon...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_229
{ "fields": [], "file": "ambry-frontend/src/test/java/com/github/ambry/frontend/FrontendRestRequestServiceFactoryTest.java", "identifier": "FrontendRestRequestServiceFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getFrontendRestRequestServiceTest() throws Exception {\n // dud properties. server should pick up defaults\n JSONObject jsonObject =\n new JSONObject().put(\"POST\", \"http://uploadUrl:15158\").put(\"GET\", \"http://downloadUrl:15158\");\n Properties properties = new Pr...
{ "fields": [ { "declarator": "frontendConfig", "modifier": "private final", "original_string": "private final FrontendConfig frontendConfig;", "type": "FrontendConfig", "var_name": "frontendConfig" }, { "declarator": "frontendMetrics", "modifier": "private final"...
{ "body": "@Override\n public RestRequestService getRestRequestService() {\n try {\n IdSigningService idSigningService =\n Utils.<IdSigningServiceFactory>getObj(frontendConfig.idSigningServiceFactory, verifiableProperties,\n clusterMap.getMetricRegistry()).getIdSigningService();\n ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_116
{ "fields": [ { "declarator": "base64key = Base64.encodeBase64String(\"ambrykey\".getBytes())", "modifier": "private final", "original_string": "private final String base64key = Base64.encodeBase64String(\"ambrykey\".getBytes());", "type": "String", "var_name": "base64key" }, ...
{ "body": "@Test\n public void testCompactionStopsAfterPurgeLimit() throws Exception {\n int purgeLimit = numBlobsPerQuery * 2;\n configProps.setProperty(CloudConfig.CLOUD_COMPACTION_PURGE_LIMIT, String.valueOf(purgeLimit));\n buildCompactor(configProps);\n // Times 2 since it applies separately to delet...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(AzureStorageCompactor.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(AzureStorageCompactor.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "public int compactPartition(String partitionPath) throws CloudStorageException {\n if (isShuttingDown()) {\n logger.info(\"Skipping compaction of {} due to shut down.\", partitionPath);\n return 0;\n }\n\n Map<String, Long> checkpoints = getCompactionProgress(partitionPath);\n\n long ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_403
{ "fields": [ { "declarator": "BUFFER_SIZE = 4 * 1024", "modifier": "private static final", "original_string": "private static final int BUFFER_SIZE = 4 * 1024;", "type": "int", "var_name": "BUFFER_SIZE" }, { "declarator": "server", "modifier": "private", "o...
{ "body": "@Test(expected = IllegalStateException.class)\n public void testCantSendWithInProgress() throws Exception {\n String connectionId = blockingConnect();\n selector.poll(1000L, asList(createSend(connectionId, \"test1\"), createSend(connectionId, \"test2\")));\n }", "class_method_signature": "Selecto...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(Selector.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(Selector.class);", "type": "Logger", "var_name": "logger" }, { "declara...
{ "body": "@Override\n public void poll(long timeoutMs) throws IOException {\n poll(timeoutMs, null);\n }", "class_method_signature": "Selector.poll(long timeoutMs)", "constructor": false, "full_signature": "@Override public void poll(long timeoutMs)", "identifier": "poll", "invocations": [ "poll" ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_75
{ "fields": [ { "declarator": "STANDARD_SEGMENT_SIZE = 1024", "modifier": "private static final", "original_string": "private static final int STANDARD_SEGMENT_SIZE = 1024;", "type": "int", "var_name": "STANDARD_SEGMENT_SIZE" }, { "declarator": "BIG_SEGMENT_SIZE = 3 * L...
{ "body": "@Test\n public void constructorTest() throws IOException, StoreException {\n LogSegment segment = getSegment(\"log_current\", STANDARD_SEGMENT_SIZE, false);\n assertEquals(\"Start offset should be 0 when no headers are written\", 0, segment.getStartOffset());\n }", "class_method_signature": "LogS...
{ "fields": [ { "declarator": "VERSION = 0", "modifier": "private static final", "original_string": "private static final short VERSION = 0;", "type": "short", "var_name": "VERSION" }, { "declarator": "VERSION_HEADER_SIZE = 2", "modifier": "private static final", ...
{ "body": "long getStartOffset() {\n return startOffset;\n }", "class_method_signature": "LogSegment.getStartOffset()", "constructor": false, "full_signature": " long getStartOffset()", "identifier": "getStartOffset", "invocations": [], "modifiers": "", "parameters": "()", "return": "long", "sig...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_395
{ "fields": [ { "declarator": "diskMocks = new Mocks()", "modifier": "private final", "original_string": "private final Mocks diskMocks = new Mocks();", "type": "Mocks", "var_name": "diskMocks" }, { "declarator": "cloudMocks = new Mocks()", "modifier": "private fi...
{ "body": "@Test\n public void testWakeup() throws IOException {\n NetworkClient compositeClient = factory.getNetworkClient();\n compositeClient.wakeup();\n verify(diskMocks.client).wakeup();\n verify(cloudMocks.client).wakeup();\n }", "class_method_signature": "CompositeNetworkClientTest.testWakeup()...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(CompositeNetworkClient.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(CompositeNetworkClient.class);", "type": "Logger", "var_name": "logger"...
{ "body": "@Override\n public void wakeup() {\n childNetworkClients.values().forEach(NetworkClient::wakeup);\n }", "class_method_signature": "CompositeNetworkClient.wakeup()", "constructor": false, "full_signature": "@Override public void wakeup()", "identifier": "wakeup", "invocations": [ "forEach...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_141
{ "fields": [ { "declarator": "clusterMap", "modifier": "private final", "original_string": "private final ClusterMap clusterMap;", "type": "ClusterMap", "var_name": "clusterMap" } ], "file": "ambry-cloud/src/test/java/com/github/ambry/cloud/CloudStorageManagerTest.java", "...
{ "body": "@Test\n public void shutdownBlobStoreTest() throws IOException {\n CloudStorageManager cloudStorageManager = createNewCloudStorageManager();\n ReplicaId mockReplicaId = clusterMap.getReplicaIds(clusterMap.getDataNodeIds().get(0)).get(0);\n PartitionId partitionId = mockReplicaId.getPartitionId();...
{ "fields": [ { "declarator": "lock", "modifier": "private final", "original_string": "private final ReadWriteLock lock;", "type": "ReadWriteLock", "var_name": "lock" }, { "declarator": "partitionToStore", "modifier": "private final", "original_string": "pri...
{ "body": "@Override\n public boolean shutdownBlobStore(PartitionId id) {\n try {\n lock.writeLock().lock();\n if (partitionToStore.get(id) != null) {\n partitionToStore.get(id).shutdown();\n return true;\n }\n } finally {\n lock.writeLock().unlock();\n }\n return false;...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_287
{ "fields": [ { "declarator": "STATIC_FIELD_TEST_STRING = \"field1\"", "modifier": "static final", "original_string": "static final String STATIC_FIELD_TEST_STRING = \"field1\";", "type": "String", "var_name": "STATIC_FIELD_TEST_STRING" } ], "file": "ambry-utils/src/test/java...
{ "body": "@Test\n public void testGetByteBufferInputStreamFromCrcStreamShareMemoryWithNettyByteBuf() throws Exception {\n int blobSize = 1000;\n // The first 8 bytes are the size of blob, the next 1000 bytes are the blob content, the next 8 bytes are the crc\n // value, and we do this twice.\n int buffe...
{ "fields": [ { "declarator": "Infinite_Time = -1", "modifier": "public static final", "original_string": "public static final long Infinite_Time = -1;", "type": "long", "var_name": "Infinite_Time" }, { "declarator": "MIN_PORT_NUM = 1", "modifier": "public static ...
{ "body": "public static ByteBufferInputStream getByteBufferInputStreamFromCrcInputStream(CrcInputStream crcStream, int dataSize)\n throws IOException {\n ByteBuffer buffer = readByteBufferFromCrcInputStream(crcStream, dataSize);\n return new ByteBufferInputStream(buffer);\n }", "class_method_signature"...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_22
{ "fields": [ { "declarator": "accountConfig", "modifier": "private final", "original_string": "private final JsonAccountConfig accountConfig;", "type": "JsonAccountConfig", "var_name": "accountConfig" }, { "declarator": "accountService", "modifier": "private", ...
{ "body": "@Test\n public void testNonExistingAccounts() throws Exception {\n Collection<Account> generatedAccounts = generateAccountJsonFile((short) 100, (short) 0, DEFAULT_SEED_1);\n accountService.processAccountJsonFile();\n\n verifyNonExistingAccounts(generatedAccounts);\n }", "class_method_signature...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(JsonAccountService.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(JsonAccountService.class);", "type": "Logger", "var_name": "logger" }, ...
{ "body": "public void processAccountJsonFile() {\n processAccountJsonLock.lock();\n\n try {\n accountJsonProcessingStartTimeMs = System.currentTimeMillis();\n\n logger.trace(\"Checking if JSON account file has changed.\");\n\n if (!Files.exists(accountFile)) {\n logger.warn(\"Unable to op...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_268
{ "fields": [], "file": "ambry-api/src/test/java/com/github/ambry/router/GetBlobOptionsTest.java", "identifier": "GetBlobOptionsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRawModeOption() {\n for (Boolean boolVal : TestUtils.BOOLEAN_VALUES) {\n GetBlobOptions options =\n new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.All).rawMode(boolVal).build();\n assertEquals(\"RawMode from options not as expected.\", ...
{ "fields": [ { "declarator": "operationType", "modifier": "private final", "original_string": "private final OperationType operationType;", "type": "OperationType", "var_name": "operationType" }, { "declarator": "getOption", "modifier": "private final", "or...
{ "body": "public boolean isRawMode() {\n return rawMode;\n }", "class_method_signature": "GetBlobOptions.isRawMode()", "constructor": false, "full_signature": "public boolean isRawMode()", "identifier": "isRawMode", "invocations": [], "modifiers": "public", "parameters": "()", "return": "boolean"...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_5
{ "fields": [ { "declarator": "mySqlAccountService", "modifier": "", "original_string": "AccountService mySqlAccountService;", "type": "AccountService", "var_name": "mySqlAccountService" }, { "declarator": "mySqlConfigProps = new Properties()", "modifier": "", ...
{ "body": "@Test\n public void testUpdateIdConflictingAccounts() throws IOException {\n AccountServiceMetrics accountServiceMetrics = new AccountServiceMetrics(new MetricRegistry());\n mySqlAccountService = new MySqlAccountService(accountServiceMetrics,\n new MySqlAccountServiceConfig(new VerifiableProp...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MySqlAccountService.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(MySqlAccountService.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public boolean updateAccounts(Collection<Account> accounts) {\n Objects.requireNonNull(accounts, \"accounts cannot be null\");\n if (accounts.isEmpty()) {\n logger.debug(\"Empty account collection to update.\");\n return false;\n }\n\n if (mySqlAccountStore == null) {\n ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_213
{ "fields": [ { "declarator": "storeKeyConverter", "modifier": "private final", "original_string": "private final StoreKeyConverter storeKeyConverter;", "type": "StoreKeyConverter", "var_name": "storeKeyConverter" } ], "file": "ambry-commons/src/test/java/com/github/ambry/sto...
{ "body": "@Test\n public void testEmptyInput() throws Exception {\n Map<StoreKey, StoreKey> storeKeyMap = storeKeyConverter.convert(new ArrayList<>());\n assertEquals(\"storeKeyMap should not have inputs\", storeKeyMap.size(), 0);\n }", "class_method_signature": "StoreKeyConverterImplNoOpTest.testEmptyInpu...
{ "fields": [], "file": "ambry-commons/src/main/java/com/github/ambry/store/StoreKeyConverterImplNoOp.java", "identifier": "StoreKeyConverterImplNoOp", "interfaces": "implements StoreKeyConverter", "methods": [ { "class_method_signature": "StoreKeyConverterImplNoOp.convert(Collection<? extends Store...
{ "body": "@Override\n public Map<StoreKey, StoreKey> convert(Collection<? extends StoreKey> input) throws Exception {\n Map<StoreKey, StoreKey> output = new HashMap<>();\n if (input != null) {\n input.forEach((storeKey) -> output.put(storeKey, storeKey));\n }\n return output;\n }", "class_method...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_59
{ "fields": [ { "declarator": "RANDOM = new Random()", "modifier": "private static final", "original_string": "private static final Random RANDOM = new Random();", "type": "Random", "var_name": "RANDOM" }, { "declarator": "CLUSTER_NAME = \"AmbryTestCluster\"", "mo...
{ "body": "@Test\n public void isDiskAvailableTest() throws Exception {\n MockDataNodeId dataNode = clusterMap.getDataNodes().get(0);\n List<ReplicaId> replicas = clusterMap.getReplicaIds(dataNode);\n Map<DiskId, List<ReplicaId>> diskToReplicas = new HashMap<>();\n StorageManager storageManager = createS...
{ "fields": [ { "declarator": "partitionToDiskManager = new ConcurrentHashMap<>()", "modifier": "protected final", "original_string": "protected final ConcurrentHashMap<PartitionId, DiskManager> partitionToDiskManager = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<PartitionId, D...
{ "body": "boolean isDiskAvailable(DiskId disk) {\n DiskManager diskManager = diskToDiskManager.get(disk);\n return diskManager != null && !diskManager.areAllStoresDown();\n }", "class_method_signature": "StorageManager.isDiskAvailable(DiskId disk)", "constructor": false, "full_signature": " boolean isDi...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_356
{ "fields": [ { "declarator": "clusterMapConfig", "modifier": "private final", "original_string": "private final ClusterMapConfig clusterMapConfig;", "type": "ClusterMapConfig", "var_name": "clusterMapConfig" }, { "declarator": "folder = new TemporaryFolder()", "m...
{ "body": "@Test\n public void rackAwareOverAllocationTest() {\n int replicaCountPerDataCenter = 4;\n long replicaCapacityInBytes = 100 * 1024 * 1024 * 1024L;\n\n TestHardwareLayout testHardwareLayout = new TestHardwareLayout(\"Alpha\", true);\n PartitionLayout partitionLayout = new PartitionLayout(testH...
{ "fields": [ { "declarator": "hardwareLayout", "modifier": "protected final", "original_string": "protected final HardwareLayout hardwareLayout;", "type": "HardwareLayout", "var_name": "hardwareLayout" }, { "declarator": "partitionLayout", "modifier": "protected ...
{ "body": "List<PartitionId> allocatePartitions(int numPartitions, String partitionClass, int replicaCountPerDatacenter,\n long replicaCapacityInBytes, boolean attemptNonRackAwareOnFailure) {\n ArrayList<PartitionId> partitions = new ArrayList<PartitionId>(numPartitions);\n int partitionsAllocated = 0;\n ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_182
{ "fields": [ { "declarator": "AWAIT_TIMEOUT_SECONDS = 10", "modifier": "private static final", "original_string": "private static final int AWAIT_TIMEOUT_SECONDS = 10;", "type": "int", "var_name": "AWAIT_TIMEOUT_SECONDS" }, { "declarator": "mockTime", "modifier":...
{ "body": "@Test\n public void testRouterClosedDuringOperation() throws Exception {\n setServerResponse(false);\n testWithErrorCodes(Collections.singletonMap(ServerErrorCode.No_Error, 9), serverLayout,\n RouterErrorCode.RouterClosed, new ErrorCodeChecker() {\n @Override\n public void t...
{ "fields": [ { "declarator": "deleteOperations", "modifier": "private final", "original_string": "private final Set<DeleteOperation> deleteOperations;", "type": "Set<DeleteOperation>", "var_name": "deleteOperations" }, { "declarator": "correlationIdToDeleteOperation", ...
{ "body": "void close() {\n for (DeleteOperation op : deleteOperations) {\n // There is a rare scenario where the operation gets removed from this set and gets completed concurrently by\n // the RequestResponseHandler thread when it is in poll() or handleResponse(). In order to avoid the completion\n ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_244
{ "fields": [ { "declarator": "messageFormatHeaderVersionSaved", "modifier": "private static", "original_string": "private static short messageFormatHeaderVersionSaved;", "type": "short", "var_name": "messageFormatHeaderVersionSaved" }, { "declarator": "nettyByteBufLeak...
{ "body": "@Test\n public void messageFormatUndeleteUpdateRecordTest() throws Exception {\n MessageFormatRecord.headerVersionToUse = MessageFormatRecord.Message_Header_Version_V3;\n StoreKey key = new MockId(\"id1\");\n short accountId = Utils.getRandomShort(TestUtils.RANDOM);\n short containerId = Utils...
{ "fields": [ { "declarator": "buffer = null", "modifier": "protected", "original_string": "protected ByteBuffer buffer = null;", "type": "ByteBuffer", "var_name": "buffer" }, { "declarator": "stream = null", "modifier": "protected", "original_string": "prot...
{ "body": "public long getSize() {\n return messageLength;\n }", "class_method_signature": "MessageFormatInputStream.getSize()", "constructor": false, "full_signature": "public long getSize()", "identifier": "getSize", "invocations": [], "modifiers": "public", "parameters": "()", "return": "long",...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_301
{ "fields": [ { "declarator": "STATIC_FIELD_TEST_STRING = \"field1\"", "modifier": "static final", "original_string": "static final String STATIC_FIELD_TEST_STRING = \"field1\";", "type": "String", "var_name": "STATIC_FIELD_TEST_STRING" } ], "file": "ambry-utils/src/test/java...
{ "body": "@Test\n public void isNullOrEmptyTest() {\n assertTrue(\"String should be declared null\", Utils.isNullOrEmpty(null));\n assertTrue(\"String should be declared empty\", Utils.isNullOrEmpty(\"\"));\n assertFalse(\"String should not be declared empty\", Utils.isNullOrEmpty(\" \"));\n assertFalse...
{ "fields": [ { "declarator": "Infinite_Time = -1", "modifier": "public static final", "original_string": "public static final long Infinite_Time = -1;", "type": "long", "var_name": "Infinite_Time" }, { "declarator": "MIN_PORT_NUM = 1", "modifier": "public static ...
{ "body": "public static boolean isNullOrEmpty(String str) {\n return str == null || str.isEmpty();\n }", "class_method_signature": "Utils.isNullOrEmpty(String str)", "constructor": false, "full_signature": "public static boolean isNullOrEmpty(String str)", "identifier": "isNullOrEmpty", "invocations": ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_194
{ "fields": [ { "declarator": "GSE = new GeneralSecurityException(\"Exception to throw for tests\")", "modifier": "static final", "original_string": "static final GeneralSecurityException GSE = new GeneralSecurityException(\"Exception to throw for tests\");", "type": "GeneralSecurityExcept...
{ "body": "@Test\n public void testFailureOnCryptoService() throws Exception {\n if (testEncryption) {\n setupEncryptionCast(new VerifiableProperties(new Properties()));\n instantiateEncryptionCast = false;\n cryptoService.exceptionOnEncryption.set(GSE);\n // simple blob\n requestAndResul...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(PutManager.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(PutManager.class);", "type": "Logger", "var_name": "logger" }, { "dec...
{ "body": "boolean isOpen() {\n return isOpen.get();\n }", "class_method_signature": "PutManager.isOpen()", "constructor": false, "full_signature": " boolean isOpen()", "identifier": "isOpen", "invocations": [ "get" ], "modifiers": "", "parameters": "()", "return": "boolean", "signature": ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_252
{ "fields": [ { "declarator": "RANDOM = new Random()", "modifier": "private static final", "original_string": "private static final Random RANDOM = new Random();", "type": "Random", "var_name": "RANDOM" }, { "declarator": "ALPHABET = \"abcdefghijklmnopqrstuvwxyz\"", ...
{ "body": "@Test\n public void getUserMetadataTest() throws Exception {\n byte[] usermetadata = RestUtils.buildUserMetadata(new HashMap<>());\n assertArrayEquals(\"Unexpected user metadata\", new byte[0], usermetadata);\n }", "class_method_signature": "RestUtilsTest.getUserMetadataTest()", "constructor": ...
{ "fields": [ { "declarator": "HTTP_DATE_FORMAT = \"EEE, dd MMM yyyy HH:mm:ss zzz\"", "modifier": "public static final", "original_string": "public static final String HTTP_DATE_FORMAT = \"EEE, dd MMM yyyy HH:mm:ss zzz\";", "type": "String", "var_name": "HTTP_DATE_FORMAT" }, ...
{ "body": "public static byte[] buildUserMetadata(Map<String, Object> args) throws RestServiceException {\n ByteBuffer userMetadata;\n if (args.containsKey(MultipartPost.USER_METADATA_PART)) {\n userMetadata = (ByteBuffer) args.get(MultipartPost.USER_METADATA_PART);\n } else {\n Map<String, String>...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_18
{ "fields": [ { "declarator": "ZK_CLIENT_CONNECTION_TIMEOUT_MS = 20000", "modifier": "private static final", "original_string": "private static final int ZK_CLIENT_CONNECTION_TIMEOUT_MS = 20000;", "type": "int", "var_name": "ZK_CLIENT_CONNECTION_TIMEOUT_MS" }, { "declar...
{ "body": "@Test\n public void testConflictingUpdateCaseE() throws Exception {\n accountService = mockHelixAccountServiceFactory.getAccountService();\n // write two accounts (1, \"a\") and (2, \"b\")\n writeAccountsForConflictTest();\n Collection<Account> conflictAccounts =\n Collections.singleton...
{ "fields": [ { "declarator": "ACCOUNT_METADATA_CHANGE_TOPIC = \"account_metadata_change_topic\"", "modifier": "static final", "original_string": "static final String ACCOUNT_METADATA_CHANGE_TOPIC = \"account_metadata_change_topic\";", "type": "String", "var_name": "ACCOUNT_METADATA_...
{ "body": "@Override\n public boolean updateAccounts(Collection<Account> accounts) {\n return updateAccountsWithAccountMetadataStore(accounts, accountMetadataStore);\n }", "class_method_signature": "HelixAccountService.updateAccounts(Collection<Account> accounts)", "constructor": false, "full_signature": "...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_317
{ "fields": [ { "declarator": "clusterMap = new MockReadingClusterMap()", "modifier": "private final", "original_string": "private final ClusterMap clusterMap = new MockReadingClusterMap();", "type": "ClusterMap", "var_name": "clusterMap" }, { "declarator": "blobIdFacto...
{ "body": "@Test\n public void testNullComponentsTransformInput() throws Exception {\n MessageInfo messageInfo = new MessageInfo(createBlobId(VERSION_1_UNCONVERTED), 123, (short) 123, (short) 123, 0L);\n //null msgBytes\n Message message = new Message(messageInfo, null);\n assertException(transformer.tra...
{ "fields": [ { "declarator": "storeKeyConverter", "modifier": "private final", "original_string": "private final StoreKeyConverter storeKeyConverter;", "type": "StoreKeyConverter", "var_name": "storeKeyConverter" }, { "declarator": "storeKeyFactory", "modifier": ...
{ "body": "@Override\n public TransformationOutput transform(Message message) {\n Message transformedMsg = null;\n try {\n Objects.requireNonNull(message, \"message must not be null\");\n Objects.requireNonNull(message.getMessageInfo(), \"message's messageInfo must not be null\");\n Objects.requ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_205
{ "fields": [ { "declarator": "ZK_CLIENT_CONNECT_TIMEOUT_MS = 20 * 1000", "modifier": "private static final", "original_string": "private static final int ZK_CLIENT_CONNECT_TIMEOUT_MS = 20 * 1000;", "type": "int", "var_name": "ZK_CLIENT_CONNECT_TIMEOUT_MS" }, { "declara...
{ "body": "@Test\n public void publishMessageToTopicWithNoListeners() throws Exception {\n latch0.set(new CountDownLatch(1));\n helixNotifier.publish(refTopics.get(0), refMessages.get(0));\n try {\n awaitLatchOrTimeout(latch0.get(), 1);\n fail(\"should have thrown\");\n } catch (TimeoutExceptio...
{ "fields": [ { "declarator": "TOPIC_PATH = \"/topics\"", "modifier": "private static final", "original_string": "private static final String TOPIC_PATH = \"/topics\";", "type": "String", "var_name": "TOPIC_PATH" }, { "declarator": "MESSAGE_KEY = \"message\"", "mo...
{ "body": "@Override\n public boolean publish(String topic, String message) {\n if (topic == null) {\n throw new IllegalArgumentException(\"topic cannot be null\");\n }\n if (message == null) {\n throw new IllegalArgumentException(\"message cannot be null\");\n }\n String topicPath = getTopi...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_340
{ "fields": [ { "declarator": "metrics = new DataNodeConfigSourceMetrics(new MetricRegistry())", "modifier": "", "original_string": "DataNodeConfigSourceMetrics metrics = new DataNodeConfigSourceMetrics(new MetricRegistry());", "type": "DataNodeConfigSourceMetrics", "var_name": "metr...
{ "body": "@Test\n public void testGetResultsDifferent() {\n DataNodeConfig config = createConfig(1, 1);\n when(primarySource.get(any())).thenReturn(config);\n when(secondarySource.get(any())).thenReturn(createConfig(1, 1));\n assertEquals(\"Expected response from primary\", config, compositeSource.get(c...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(CompositeDataNodeConfigSource.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CompositeDataNodeConfigSource.class);", "type": "Logger", "var_n...
{ "body": "@Override\n public DataNodeConfig get(String instanceName) {\n DataNodeConfig primaryResult = primarySource.get(instanceName);\n try {\n DataNodeConfig secondaryResult = secondarySource.get(instanceName);\n if (!Objects.equals(primaryResult, secondaryResult)) {\n metrics.getSwallowe...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_38
{ "fields": [ { "declarator": "TEST_TIME_INTERVAL_IN_MS = DELAY_BETWEEN_LAST_MODIFIED_TIMES_MS / 2", "modifier": "private static final", "original_string": "private static final long TEST_TIME_INTERVAL_IN_MS = DELAY_BETWEEN_LAST_MODIFIED_TIMES_MS / 2;", "type": "long", "var_name": "T...
{ "body": "@Test\n public void testLogSegmentValidDataSize() throws StoreException {\n assumeTrue(!bucketingEnabled);\n BlobStoreStats blobStoreStats = setupBlobStoreStats(0, 0);\n long currentTimeInMs = state.time.milliseconds();\n for (long i = 0; i <= currentTimeInMs + TEST_TIME_INTERVAL_IN_MS; i += T...
{ "fields": [ { "declarator": "IO_SCHEDULER_JOB_TYPE = \"BlobStoreStats\"", "modifier": "static final", "original_string": "static final String IO_SCHEDULER_JOB_TYPE = \"BlobStoreStats\";", "type": "String", "var_name": "IO_SCHEDULER_JOB_TYPE" }, { "declarator": "IO_SCH...
{ "body": "@Override\n public void close() {\n if (enabled.compareAndSet(true, false)) {\n if (indexScanner != null) {\n indexScanner.cancel();\n }\n if (queueProcessor != null) {\n queueProcessor.cancel();\n }\n }\n }", "class_method_signature": "BlobStoreStats.close()", ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_337
{ "fields": [ { "declarator": "metrics = new DataNodeConfigSourceMetrics(new MetricRegistry())", "modifier": "", "original_string": "DataNodeConfigSourceMetrics metrics = new DataNodeConfigSourceMetrics(new MetricRegistry());", "type": "DataNodeConfigSourceMetrics", "var_name": "metr...
{ "body": "@Test\n public void testSetResultsDifferent() {\n when(primarySource.set(any())).thenReturn(true);\n when(secondarySource.set(any())).thenReturn(false);\n DataNodeConfig config = createConfig(1, 1);\n assertTrue(\"Expected response from primary\", compositeSource.set(config));\n verify(prim...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(CompositeDataNodeConfigSource.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CompositeDataNodeConfigSource.class);", "type": "Logger", "var_n...
{ "body": "@Override\n public boolean set(DataNodeConfig config) {\n boolean primaryResult = primarySource.set(config);\n try {\n boolean secondaryResult = secondarySource.set(config);\n if (primaryResult != secondaryResult) {\n metrics.setSwallowedErrorCount.inc();\n LOGGER.error(\"Res...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_272
{ "fields": [], "file": "ambry-utils/src/test/java/com/github/ambry/utils/SimpleByteBufferPoolTest.java", "identifier": "SimpleByteBufferPoolTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRequestExceedPoolCapacity() throws Exception {\n final long capacity = 1024;\n final long maxBlockTimeInMs = 200;\n SimpleByteBufferPool pool = new SimpleByteBufferPool(capacity);\n try {\n pool.allocate((int) capacity + 1, maxBlockTimeInMs);\n fail(\"Should h...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(SimpleByteBufferPool.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(SimpleByteBufferPool.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "@Override\n public ByteBuffer allocate(int size, final long timeToBlockInMs) throws TimeoutException, InterruptedException {\n if (size > capacity) {\n throw new IllegalArgumentException(\"Requested size cannot exceed pool capacity.\");\n } else if (timeToBlockInMs < 0) {\n throw new Illeg...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...