id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
13870893_305 | {
"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 testBasicOperation() throws Exception {\n for (Pair pair : pairList) {\n for (Class clazz : VALID_MESSAGE_FORMAT_INPUT_STREAM_IMPLS) {\n for (boolean divergeInfoFromData : new boolean[]{false, true}) {\n InputAndExpected inputAndExpected = new InputAndExpected(p... | {
"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_240 | {
"fields": [],
"file": "ambry-messageformat/src/test/java/com/github/ambry/messageformat/CompositeBlobInfoTest.java",
"identifier": "CompositeBlobInfoTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testValidGetStoreKeysInByteRange() {\n List<Pair<StoreKey, Long>> keysAndContentSizes = createKeysAndContentSizes(60, 1, 1000000, 100);\n CompositeBlobInfo compositeBlobInfo = new CompositeBlobInfo(keysAndContentSizes);\n long totalSize = compositeBlobInfo.getTotalSize();\n ... | {
"fields": [
{
"declarator": "chunkSize",
"modifier": "private final",
"original_string": "private final int chunkSize;",
"type": "int",
"var_name": "chunkSize"
},
{
"declarator": "totalSize",
"modifier": "private final",
"original_string": "private final l... | {
"body": "public long getTotalSize() {\n return totalSize;\n }",
"class_method_signature": "CompositeBlobInfo.getTotalSize()",
"constructor": false,
"full_signature": "public long getTotalSize()",
"identifier": "getTotalSize",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return"... | {
"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_169 | {
"fields": [
{
"declarator": "MAX_PORTS_PLAIN_TEXT = 3",
"modifier": "protected static final",
"original_string": "protected static final int MAX_PORTS_PLAIN_TEXT = 3;",
"type": "int",
"var_name": "MAX_PORTS_PLAIN_TEXT"
},
{
"declarator": "MAX_PORTS_SSL = 3",
"mo... | {
"body": "@Test\n public void testNonBlockingRouterFactory() throws Exception {\n Properties props = getNonBlockingRouterProperties(\"NotInClusterMap\");\n VerifiableProperties verifiableProperties = new VerifiableProperties((props));\n try {\n router = (NonBlockingRouter) new NonBlockingRouterFactory... | {
"fields": [
{
"declarator": "networkClientFactory",
"modifier": "private final",
"original_string": "private final NetworkClientFactory networkClientFactory;",
"type": "NetworkClientFactory",
"var_name": "networkClientFactory"
},
{
"declarator": "ocList",
"modif... | {
"body": "@Override\n public void close() {\n shutDownOperationControllers();\n // wait for all the threads to actually exit\n waitForResponseHandlerThreadExit();\n // close the KeyManagementService\n if (kms != null) {\n try {\n kms.close();\n } catch (IOException e) {\n logg... | {
"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_186 | {
"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 testRangeRequestStitchDifferentSizedBlobsSegments() throws Exception {\n if (metadataContentVersion > MessageFormatRecord.Metadata_Content_Version_V2) {\n router = getNonBlockingRouter();\n String blobId = createStitchBlob(LARGE_BLOB_SIZE);\n //Test grabbing every seg... | {
"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_352 | {
"fields": [
{
"declarator": "helixManagerFactory",
"modifier": "private final",
"original_string": "private final MockHelixManagerFactory helixManagerFactory;",
"type": "MockHelixManagerFactory",
"var_name": "helixManagerFactory"
},
{
"declarator": "props",
"mod... | {
"body": "@Test\n public void testBadCases() {\n // Invalid state model def\n props.setProperty(\"clustermap.state.model.definition\", \"InvalidStateModelDef\");\n try {\n new ClusterMapConfig(new VerifiableProperties(props));\n fail(\"should fail due to invalid state model definition\");\n } ... | {
"fields": [
{
"declarator": "participantMetrics",
"modifier": "protected final",
"original_string": "protected final HelixParticipantMetrics participantMetrics;",
"type": "HelixParticipantMetrics",
"var_name": "participantMetrics"
},
{
"declarator": "clusterName",
... | {
"body": "@Override\n public void participate(List<AmbryHealthReport> ambryHealthReports, Callback<StatsSnapshot> callback)\n throws IOException {\n logger.info(\"Initiating the participation. The specified state model is {}\",\n clusterMapConfig.clustermapStateModelDefinition);\n StateMachineEngi... | {
"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_217 | {
"fields": [
{
"declarator": "refAccount",
"modifier": "private final",
"original_string": "private final Account refAccount;",
"type": "Account",
"var_name": "refAccount"
},
{
"declarator": "configProps = new Properties()",
"modifier": "private final",
"or... | {
"body": "@Test\n public void useServiceWithoutStartTest() throws Exception {\n frontendRestRequestService = getFrontendRestRequestService();\n frontendRestRequestService.setupResponseHandler(responseHandler);\n // not fine to use without start.\n for (RestMethod method : RestMethod.values()) {\n i... | {
"fields": [
{
"declarator": "TTL_UPDATE_REJECTED_ALLOW_HEADER_VALUE = \"GET,HEAD,DELETE\"",
"modifier": "static final",
"original_string": "static final String TTL_UPDATE_REJECTED_ALLOW_HEADER_VALUE = \"GET,HEAD,DELETE\";",
"type": "String",
"var_name": "TTL_UPDATE_REJECTED_ALLOW_H... | {
"body": "@Override\n public void setupResponseHandler(RestResponseHandler responseHandler) {\n this.responseHandler = responseHandler;\n }",
"class_method_signature": "FrontendRestRequestService.setupResponseHandler(RestResponseHandler responseHandler)",
"constructor": false,
"full_signature": "@Override... | {
"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_1 | {
"fields": [
{
"declarator": "mySqlAccountService",
"modifier": "",
"original_string": "AccountService mySqlAccountService;",
"type": "AccountService",
"var_name": "mySqlAccountService"
},
{
"declarator": "mySqlConfigProps = new Properties()",
"modifier": "",
... | {
"body": "@Test\n public void testInitCacheOnStartUp() throws SQLException, IOException {\n Container testContainer =\n new ContainerBuilder((short) 1, \"testContainer\", Container.ContainerStatus.ACTIVE, \"testContainer\",\n (short) 1).build();\n Account testAccount = new AccountBuilder((sh... | {
"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 Collection<Account> getAllAccounts() {\n infoMapLock.readLock().lock();\n try {\n return accountInfoMapRef.get().getAccounts();\n } finally {\n infoMapLock.readLock().unlock();\n }\n }",
"class_method_signature": "MySqlAccountService.getAllAccounts()",
"constr... | {
"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_26 | {
"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 testAllAccountRetrieving() throws Exception {\n Collection<Account> generatedAccounts = generateAccountJsonFile((short) 100, (short) 0, DEFAULT_SEED_1);\n accountService.processAccountJsonFile();\n\n Collection<Account> retrievedAccounts = new HashSet<>(accountService.getAllAc... | {
"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_283 | {
"fields": [],
"file": "ambry-utils/src/test/java/com/github/ambry/utils/ZeroBytesInputStreamTest.java",
"identifier": "ZeroBytesInputStreamTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testZeroBytesInputStream() throws Exception {\n int size = 16;\n ZeroBytesInputStream zbis = new ZeroBytesInputStream(size);\n TestUtils.validateInputStreamContract(zbis);\n TestUtils.readInputStreamAndValidateSize(zbis, size);\n }",
"class_method_signature": "ZeroBytesI... | {
"fields": [
{
"declarator": "streamSize",
"modifier": "private",
"original_string": "private long streamSize;",
"type": "long",
"var_name": "streamSize"
},
{
"declarator": "position",
"modifier": "private",
"original_string": "private long position;",
... | {
"body": "public ZeroBytesInputStream(long size) throws IOException {\n this.streamSize = size;\n this.position = 0;\n }",
"class_method_signature": "ZeroBytesInputStream.ZeroBytesInputStream(long size)",
"constructor": true,
"full_signature": "public ZeroBytesInputStream(long size)",
"identifier": "... | {
"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_329 | {
"fields": [
{
"declarator": "MAX_ACCOUNT_COUNT = 10",
"modifier": "private static final",
"original_string": "private static final int MAX_ACCOUNT_COUNT = 10;",
"type": "int",
"var_name": "MAX_ACCOUNT_COUNT"
},
{
"declarator": "MIN_ACCOUNT_COUNT = 5",
"modifier"... | {
"body": "@Test\n public void testShutdownBeforeStart() {\n statsManager.shutdown();\n }",
"class_method_signature": "StatsManagerTest.testShutdownBeforeStart()",
"constructor": false,
"full_signature": "@Test public void testShutdownBeforeStart()",
"identifier": "testShutdownBeforeStart",
"invocation... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(StatsManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(StatsManager.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "void shutdown() {\n if (statsAggregator != null) {\n statsAggregator.cancel();\n }\n if (scheduler != null) {\n shutDownExecutorService(scheduler, 30, TimeUnit.SECONDS);\n }\n }",
"class_method_signature": "StatsManager.shutdown()",
"constructor": false,
"full_signature": " voi... | {
"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_145 | {
"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 controlCompactionForBlobStoreTest() throws IOException {\n CloudStorageManager cloudStorageManager = createNewCloudStorageManager();\n try {\n cloudStorageManager.controlCompactionForBlobStore(new MockPartitionId(), true);\n Assert.fail(\"CloudStorageManager controlComp... | {
"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 controlCompactionForBlobStore(PartitionId id, boolean enabled) {\n throw new UnsupportedOperationException(\"Method not supported\");\n }",
"class_method_signature": "CloudStorageManager.controlCompactionForBlobStore(PartitionId id, boolean enabled)",
"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_391 | {
"fields": [
{
"declarator": "connectionTracker",
"modifier": "private",
"original_string": "private ConnectionTracker connectionTracker;",
"type": "ConnectionTracker",
"var_name": "connectionTracker"
},
{
"declarator": "verifiableProperties",
"modifier": "privat... | {
"body": "@Test\n public void testConnectionTracker() throws IOException {\n connectionTracker = new ConnectionTracker(routerConfig.routerScalingUnitMaxConnectionsPerPortPlainText,\n routerConfig.routerScalingUnitMaxConnectionsPerPortSsl);\n // When no connections were ever made to a host:port, connect... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ConnectionTracker.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ConnectionTracker.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "ConnectionTracker(int maxConnectionsPerPortPlainText, int maxConnectionsPerPortSsl) {\n this.maxConnectionsPerPortPlainText = maxConnectionsPerPortPlainText;\n this.maxConnectionsPerPortSsl = maxConnectionsPerPortSsl;\n }",
"class_method_signature": "ConnectionTracker.ConnectionTracker(int maxConn... | {
"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_71 | {
"fields": [
{
"declarator": "METRICS = new StorageManagerMetrics(new MetricRegistry())",
"modifier": "private static final",
"original_string": "private static final StorageManagerMetrics METRICS = new StorageManagerMetrics(new MetricRegistry());",
"type": "StorageManagerMetrics",
... | {
"body": "@Test\n public void allocateAndFreeSwapSegmentTest() throws Exception {\n requiredSwapSegmentsPerSize = 2;\n alloc = constructAllocator();\n alloc.initializePool(Collections.singletonList(new DiskSpaceRequirements(storeId0, 20, 3, 0)));\n verifyPoolState(new ExpectedState().addStoreSeg(storeId... | {
"fields": [
{
"declarator": "STORE_DIR_PREFIX = \"reserve_store_\"",
"modifier": "static final",
"original_string": "static final String STORE_DIR_PREFIX = \"reserve_store_\";",
"type": "String",
"var_name": "STORE_DIR_PREFIX"
},
{
"declarator": "SWAP_DIR_NAME = \"res... | {
"body": "void initializePool(Collection<DiskSpaceRequirements> requirementsList) throws StoreException {\n long startTime = System.currentTimeMillis();\n try {\n if (enablePooling) {\n if (poolState == PoolState.NOT_INVENTORIED) {\n throw inventoryException;\n }\n // The req... | {
"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_112 | {
"fields": [
{
"declarator": "clusterName = \"main\"",
"modifier": "private final",
"original_string": "private final String clusterName = \"main\";",
"type": "String",
"var_name": "clusterName"
},
{
"declarator": "configProps = new Properties()",
"modifier": "pr... | {
"body": "@Test\n public void testFileDelete() throws Exception {\n mockBlobExistence(true);\n assertTrue(\"Expected delete to return true\", dataAccessor.deleteFile(\"containerName\", \"fileName\"));\n mockBlobExistence(false);\n assertFalse(\"Expected delete to return false\", dataAccessor.deleteFile(... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(AzureBlobDataAccessor.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(AzureBlobDataAccessor.class);",
"type": "Logger",
"var_name": "logger"
... | {
"body": "boolean deleteFile(String containerName, String fileName) throws BlobStorageException {\n BlockBlobClient blobClient = getBlockBlobClient(containerName, fileName, false);\n if (blobClient.exists()) {\n blobClient.delete();\n return true;\n }\n return false;\n }",
"class_method_sign... | {
"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_387 | {
"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 testPendingRequestTimeOutWithDisconnection() throws Exception {\n List<RequestInfo> requestInfoList = new ArrayList<>();\n selector.setState(MockSelectorState.IdlePoll);\n requestInfoList.add(new RequestInfo(sslHost, sslPort, new MockSend(4), replicaOnSslNode));\n List<Resp... | {
"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_88 | {
"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 concurrentGetTest() throws Exception {\n int extraBlobCount = 4000 / PUT_RECORD_SIZE + 1;\n put(extraBlobCount, PUT_RECORD_SIZE, Utils.Infinite_Time);\n List<Getter> getters = new ArrayList<>(allKeys.size());\n for (MockId id : allKeys.keySet()) {\n getters.add(new Get... | {
"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 void put(MessageWriteSet messageSetToWrite) throws StoreException {\n checkStarted();\n if (messageSetToWrite.getMessageSetInfo().isEmpty()) {\n throw new IllegalArgumentException(\"Message write set cannot be empty\");\n }\n checkDuplicates(messageSetToWrite.getMessage... | {
"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_67 | {
"fields": [
{
"declarator": "METRICS = new StorageManagerMetrics(new MetricRegistry())",
"modifier": "private static final",
"original_string": "private static final StorageManagerMetrics METRICS = new StorageManagerMetrics(new MetricRegistry());",
"type": "StorageManagerMetrics",
... | {
"body": "@Test\n public void subsequentStartupTest() throws Exception {\n requiredSwapSegmentsPerSize = 1;\n alloc = constructAllocator();\n List<DiskSpaceRequirements> requirementsList = new ArrayList<>();\n\n requirementsList.add(new DiskSpaceRequirements(storeId0, 5, 6, 0));\n requirementsList.ad... | {
"fields": [
{
"declarator": "STORE_DIR_PREFIX = \"reserve_store_\"",
"modifier": "static final",
"original_string": "static final String STORE_DIR_PREFIX = \"reserve_store_\";",
"type": "String",
"var_name": "STORE_DIR_PREFIX"
},
{
"declarator": "SWAP_DIR_NAME = \"res... | {
"body": "void initializePool(Collection<DiskSpaceRequirements> requirementsList) throws StoreException {\n long startTime = System.currentTimeMillis();\n try {\n if (enablePooling) {\n if (poolState == PoolState.NOT_INVENTORIED) {\n throw inventoryException;\n }\n // The req... | {
"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_368 | {
"fields": [
{
"declarator": "router",
"modifier": "private final",
"original_string": "private final InMemoryRouter router;",
"type": "InMemoryRouter",
"var_name": "router"
},
{
"declarator": "restRequestService",
"modifier": "private final",
"original_str... | {
"body": "@Test\n public void requestHandleWithBadInputTest() throws IOException {\n String content = \"@@randomContent@@@\";\n // content without request.\n EmbeddedChannel channel = createChannel();\n channel.writeInbound(new DefaultLastHttpContent(Unpooled.wrappedBuffer(content.getBytes())));\n Ht... | {
"fields": [
{
"declarator": "nettyMetrics",
"modifier": "private final",
"original_string": "private final NettyMetrics nettyMetrics;",
"type": "NettyMetrics",
"var_name": "nettyMetrics"
},
{
"declarator": "nettyConfig",
"modifier": "private final",
"origi... | {
"body": "private boolean isOpen() {\n return channelOpen.get() && ctx.channel().isActive();\n }",
"class_method_signature": "NettyMessageProcessor.isOpen()",
"constructor": false,
"full_signature": "private boolean isOpen()",
"identifier": "isOpen",
"invocations": [
"get",
"isActive",
"cha... | {
"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_104 | {
"fields": [],
"file": "ambry-store/src/test/java/com/github/ambry/store/FileSpanTest.java",
"identifier": "FileSpanTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void inSpanTest() {\n String firstLogSegmentName = LogSegmentNameHelper.generateFirstSegmentName(true);\n String startLogSegmentName = LogSegmentNameHelper.getNextPositionName(firstLogSegmentName);\n String interveningLogSegmentName = LogSegmentNameHelper.getNextPositionName(startL... | {
"fields": [
{
"declarator": "startOffset",
"modifier": "private",
"original_string": "private Offset startOffset;",
"type": "Offset",
"var_name": "startOffset"
},
{
"declarator": "endOffset",
"modifier": "private",
"original_string": "private Offset endOff... | {
"body": "boolean inSpan(Offset offset) {\n return offset.compareTo(startOffset) >= 0 && offset.compareTo(endOffset) < 0;\n }",
"class_method_signature": "FileSpan.inSpan(Offset offset)",
"constructor": false,
"full_signature": " boolean inSpan(Offset offset)",
"identifier": "inSpan",
"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_295 | {
"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 testGetStaticFieldValuesAsStrings() {\n Stream<String> fieldValuesAsStrings = Utils.getStaticFieldValuesAsStrings(MockClassForTesting.class);\n Set<String> staticFields = fieldValuesAsStrings.collect(Collectors.toSet());\n assertTrue(\"Static field is not found in the result.\... | {
"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 Stream<String> getStaticFieldValuesAsStrings(Class type) {\n return Arrays.stream(type.getFields()).filter(field -> Modifier.isStatic(field.getModifiers())).map(field -> {\n try {\n return field.get(null).toString();\n } catch (IllegalAccessException e) {\n throw ne... | {
"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_30 | {
"fields": [
{
"declarator": "accountId = 101",
"modifier": "private final",
"original_string": "private final short accountId = 101;",
"type": "short",
"var_name": "accountId"
},
{
"declarator": "accountName = \"samza\"",
"modifier": "private final",
"orig... | {
"body": "@Test\n public void testGetAccounts() throws Exception {\n List<Account> accountList = accountDao.getNewAccounts(0L);\n assertEquals(1, accountList.size());\n assertEquals(testAccount, accountList.get(0));\n }",
"class_method_signature": "AccountDaoTest.testGetAccounts()",
"constructor": fal... | {
"fields": [
{
"declarator": "ACCOUNT_TABLE = \"Accounts\"",
"modifier": "public static final",
"original_string": "public static final String ACCOUNT_TABLE = \"Accounts\";",
"type": "String",
"var_name": "ACCOUNT_TABLE"
},
{
"declarator": "ACCOUNT_INFO = \"accountInfo... | {
"body": "public List<Account> getNewAccounts(long updatedSince) throws SQLException {\n Timestamp sinceTime = new Timestamp(updatedSince);\n PreparedStatement getSinceStatement = dataAccessor.getPreparedStatement(getSinceSql);\n getSinceStatement.setTimestamp(1, sinceTime);\n try (ResultSet rs = getSinc... | {
"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_153 | {
"fields": [
{
"declarator": "vcrRequests",
"modifier": "private final",
"original_string": "private final VcrRequests vcrRequests;",
"type": "VcrRequests",
"var_name": "vcrRequests"
},
{
"declarator": "request",
"modifier": "private final",
"original_strin... | {
"body": "@Test\n public void validateRequestTest() {\n //test for null partitionid\n Assert.assertEquals(vcrRequests.validateRequest(null, null, false), ServerErrorCode.Bad_Request);\n Assert.assertEquals(vcrRequests.validateRequest(null, null, true), ServerErrorCode.Bad_Request);\n\n //test for unavai... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(VcrRequests.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(VcrRequests.class);",
"type": "Logger",
"var_name": "logger"
}
],
"file": ... | {
"body": "@Override\n protected ServerErrorCode validateRequest(PartitionId partition, RequestOrResponseType requestType,\n boolean skipPartitionAvailableCheck) {\n // 1. Check partition is null\n if (partition == null) {\n metrics.badRequestError.inc();\n return ServerErrorCode.Bad_Request;\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_271 | {
"fields": [],
"file": "ambry-utils/src/test/java/com/github/ambry/utils/RejectThrottlerTest.java",
"identifier": "RejectThrottlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void basicTest() throws Exception {\n // desired rate = -1: allows all request\n RejectThrottler rejectThrottler = new RejectThrottler(-1, null);\n Assert.assertFalse(rejectThrottler.shouldThrottle(-1));\n Assert.assertFalse(rejectThrottler.shouldThrottle(0));\n Assert.assert... | {
"fields": [
{
"declarator": "desiredRatePerSec",
"modifier": "private final",
"original_string": "private final double desiredRatePerSec;",
"type": "double",
"var_name": "desiredRatePerSec"
},
{
"declarator": "meter",
"modifier": "private final",
"original... | {
"body": "public boolean shouldThrottle(long observed) {\n if (desiredRatePerSec < 0) {\n return false;\n }\n if (meter.getOneMinuteRate() >= desiredRatePerSec) {\n return true;\n } else {\n meter.mark(observed);\n return false;\n }\n }",
"class_method_signature": "RejectThrottl... | {
"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_334 | {
"fields": [
{
"declarator": "ZK_CLIENT_CONNECT_ADDRESS = \"localhost:localport\"",
"modifier": "private static final",
"original_string": "private static final String ZK_CLIENT_CONNECT_ADDRESS = \"localhost:localport\";",
"type": "String",
"var_name": "ZK_CLIENT_CONNECT_ADDRESS"
... | {
"body": "@Test\n public void testStartRefresherWithScheduler() throws Exception {\n Map<String, Map<String, Long>> expectedUsage = makeStorageUsageAndWriteToHelix(10, 10);\n storageUsageRefresher = new HelixStorageUsageRefresher(mockHelixStore, scheduler, storageQuotaConfig);\n Map<String, Map<String, Lon... | {
"fields": [
{
"declarator": "AGGREGATED_CONTAINER_STORAGE_USAGE_PATH = \"Aggregated_AccountReport\"",
"modifier": "public static final",
"original_string": "public static final String AGGREGATED_CONTAINER_STORAGE_USAGE_PATH = \"Aggregated_AccountReport\";",
"type": "String",
"var_n... | {
"body": "@Override\n public Map<String, Map<String, Long>> getContainerStorageUsage() {\n return Collections.unmodifiableMap(containerStorageUsageRef.get());\n }",
"class_method_signature": "HelixStorageUsageRefresher.getContainerStorageUsage()",
"constructor": false,
"full_signature": "@Override public ... | {
"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_158 | {
"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 testCryptoJobExecutorServiceDiffThreadCount() throws GeneralSecurityException, InterruptedException {\n int totalDataCount = 10;\n for (int j = 0; j < 5; j++) {\n cryptoJobHandler.close();\n cryptoJobHandler = new CryptoJobHandler(j + 1);\n CountDownLatch encryptCa... | {
"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_83 | {
"fields": [],
"file": "ambry-store/src/test/java/com/github/ambry/store/LogSegmentNameHelperTest.java",
"identifier": "LogSegmentNameHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void nameToFilenameTest() {\n assertEquals(\"Did not get expected file name\", \"log_current\", LogSegmentNameHelper.nameToFilename(\"\"));\n String name = TestUtils.getRandomString(10);\n assertEquals(\"Did not get expected file name\", name + LogSegmentNameHelper.SUFFIX,\n ... | {
"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 nameToFilename(String name) {\n if (name.isEmpty()) {\n return SINGLE_SEGMENT_LOG_FILE_NAME;\n }\n return name + SUFFIX;\n }",
"class_method_signature": "LogSegmentNameHelper.nameToFilename(String name)",
"constructor": false,
"full_signature": "static String nameToFilena... | {
"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_226 | {
"fields": [],
"file": "ambry-frontend/src/test/java/com/github/ambry/frontend/QuotaManagerTest.java",
"identifier": "QuotaManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void quotaTest() throws Exception {\n Properties props = new Properties();\n props.setProperty(FrontendConfig.REST_REQUEST_QUOTA_STRING,\n \"{\\\"PUT\\\": \\\"20\\\",\\\"GET\\\": \\\"20\\\",\\\"POST\\\": \\\"20\\\",\\\"HEAD\\\": \\\"20\\\",\\\"OPTIONS\\\": \\\"20\\\",\\\"DELETE... | {
"fields": [
{
"declarator": "quotaMap",
"modifier": "private final",
"original_string": "private final Map<RestMethod, RejectThrottler> quotaMap;",
"type": "Map<RestMethod, RejectThrottler>",
"var_name": "quotaMap"
}
],
"file": "ambry-frontend/src/main/java/com/github/ambry... | {
"body": "public boolean shouldThrottle(RestRequest restRequest) {\n RejectThrottler throttler = quotaMap.get(restRequest.getRestMethod());\n return throttler != null && throttler.shouldThrottle(1);\n }",
"class_method_signature": "QuotaManager.shouldThrottle(RestRequest restRequest)",
"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_363 | {
"fields": [
{
"declarator": "nettyByteBufLeakHelper = new NettyByteBufLeakHelper()",
"modifier": "private",
"original_string": "private NettyByteBufLeakHelper nettyByteBufLeakHelper = new NettyByteBufLeakHelper();",
"type": "NettyByteBufLeakHelper",
"var_name": "nettyByteBufLeakHel... | {
"body": "@Test\n public void setStatusTest() {\n // ask for every status to be set\n for (ResponseStatus expectedResponseStatus : ResponseStatus.values()) {\n HttpRequest request = createRequestWithHeaders(HttpMethod.GET, TestingUri.SetStatus.toString());\n request.headers().set(MockNettyMessagePro... | {
"fields": [
{
"declarator": "FAILURE_REASON_HEADER = \"x-ambry-failure-reason\"",
"modifier": "static final",
"original_string": "static final String FAILURE_REASON_HEADER = \"x-ambry-failure-reason\";",
"type": "String",
"var_name": "FAILURE_REASON_HEADER"
},
{
"decl... | {
"body": "@Override\n public void setStatus(ResponseStatus status) throws RestServiceException {\n responseMetadata.setStatus(getHttpResponseStatus(status));\n responseStatus = status;\n logger.trace(\"Set status to {} for response on channel {}\", responseMetadata.status(), ctx.channel());\n }",
"class... | {
"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_230 | {
"fields": [
{
"declarator": "CLUSTER_MAP",
"modifier": "private static final",
"original_string": "private static final ClusterMap CLUSTER_MAP;",
"type": "ClusterMap",
"var_name": "CLUSTER_MAP"
},
{
"declarator": "getReplicasHandler",
"modifier": "private static... | {
"body": "@Test\n public void getReplicasTest() throws Exception {\n List<? extends PartitionId> partitionIds = CLUSTER_MAP.getWritablePartitionIds(null);\n for (PartitionId partitionId : partitionIds) {\n String originalReplicaStr = partitionId.getReplicaIds().toString().replace(\", \", \",\");\n B... | {
"fields": [
{
"declarator": "REPLICAS_KEY = \"replicas\"",
"modifier": "static",
"original_string": "static String REPLICAS_KEY = \"replicas\";",
"type": "String",
"var_name": "REPLICAS_KEY"
},
{
"declarator": "metrics",
"modifier": "private final",
"origi... | {
"body": "ReadableStreamChannel getReplicas(String blobId, RestResponseChannel restResponseChannel)\n throws RestServiceException {\n logger.trace(\"Getting replicas of blob ID - {}\", blobId);\n long startTime = System.currentTimeMillis();\n ReadableStreamChannel channel = null;\n try {\n chan... | {
"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_95 | {
"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 findEntriesSinceTest() throws StoreException {\n FindInfo findInfo = store.findEntriesSince(new StoreFindToken(), Long.MAX_VALUE);\n Set<StoreKey> keysPresent = new HashSet<>();\n for (MessageInfo info : findInfo.getMessageEntries()) {\n keysPresent.add(info.getStoreKey()... | {
"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 FindInfo findEntriesSince(FindToken token, long maxTotalSizeOfEntries) throws StoreException {\n checkStarted();\n final Timer.Context context = metrics.findEntriesSinceResponse.time();\n try {\n FindInfo findInfo = index.findEntriesSince(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_375 | {
"fields": [
{
"declarator": "METRIC_REGISTRY = new MetricRegistry()",
"modifier": "private static final",
"original_string": "private static final MetricRegistry METRIC_REGISTRY = new MetricRegistry();",
"type": "MetricRegistry",
"var_name": "METRIC_REGISTRY"
},
{
"de... | {
"body": "@Test\n public void prepareTest() throws Exception {\n // prepare half baked data\n HttpRequest httpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, \"/\");\n HttpPostRequestEncoder encoder = createEncoder(httpRequest, null);\n NettyMultipartRequest request =\n ... | {
"fields": [
{
"declarator": "rawRequestContents = new LinkedBlockingQueue<>()",
"modifier": "private final",
"original_string": "private final Queue<HttpContent> rawRequestContents = new LinkedBlockingQueue<>();",
"type": "Queue<HttpContent>",
"var_name": "rawRequestContents"
}... | {
"body": "@Override\n public void prepare() throws RestServiceException {\n if (!isOpen()) {\n nettyMetrics.multipartRequestAlreadyClosedError.inc();\n throw new RestServiceException(\"Request is closed\", RestServiceErrorCode.RequestChannelClosed);\n } else if (!readyForRead) {\n // make sure ... | {
"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_119 | {
"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 testPurgeWithStorageError() throws Exception {\n // Unsuccessful case\n BlobStorageException ex = mockStorageException(BlobErrorCode.BLOB_ARCHIVED);\n BlobBatch mockBatch = mock(BlobBatch.class);\n Response<Void> mockResponse = mock(Response.class);\n when(mockResponse.g... | {
"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": "int purgeBlobs(List<CloudBlobMetadata> blobMetadataList) throws CloudStorageException {\n if (blobMetadataList.isEmpty()) {\n return 0;\n }\n azureMetrics.blobDeleteRequestCount.inc(blobMetadataList.size());\n long t0 = System.currentTimeMillis();\n try {\n List<CloudBlobMetadata> ... | {
"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_267 | {
"fields": [],
"file": "ambry-api/src/test/java/com/github/ambry/router/GetBlobOptionsTest.java",
"identifier": "GetBlobOptionsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetOptionOption() {\n GetBlobOptions options = new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.BlobInfo)\n .getOption(GetOption.Include_All)\n .build();\n assertEquals(\"GetOption from options not as expected.\", GetOption.Include_All, opt... | {
"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 GetOption getGetOption() {\n return getOption;\n }",
"class_method_signature": "GetBlobOptions.getGetOption()",
"constructor": false,
"full_signature": "public GetOption getGetOption()",
"identifier": "getGetOption",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"... | {
"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_322 | {
"fields": [
{
"declarator": "nettyByteBufLeakHelper = new NettyByteBufLeakHelper()",
"modifier": "private",
"original_string": "private NettyByteBufLeakHelper nettyByteBufLeakHelper = new NettyByteBufLeakHelper();",
"type": "NettyByteBufLeakHelper",
"var_name": "nettyByteBufLeakHel... | {
"body": "@Test\n public void testCompositeSendWithByteBuf() {\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().nextBytes(buf2);\n new Random().nextBytes(buf3);\n ByteArraySend byteArraySend1 = new Byt... | {
"fields": [
{
"declarator": "compositeSendList",
"modifier": "private final",
"original_string": "private final List<Send> compositeSendList;",
"type": "List<Send>",
"var_name": "compositeSendList"
},
{
"declarator": "totalSizeToWrite",
"modifier": "private",
... | {
"body": "@Override\n public ByteBuf content() {\n return compositeSendContent;\n }",
"class_method_signature": "CompositeSend.content()",
"constructor": false,
"full_signature": "@Override public ByteBuf content()",
"identifier": "content",
"invocations": [],
"modifiers": "@Override public",
"par... | {
"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_288 | {
"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 testHashCode() {\n String s = \"test\";\n Integer i = new Integer(245);\n Double d = new Double(2.4);\n Object[] objs = new Object[3];\n objs[0] = s;\n objs[1] = i;\n objs[2] = d;\n int code1 = Utils.hashcode(objs);\n int code2 = Utils.hashcode(objs);\n As... | {
"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 hashcode(Object[] items) {\n if (items == null) {\n return 0;\n }\n int h = 1;\n int i = 0;\n while (i < items.length) {\n if (items[i] != null) {\n h = 31 * h + items[i].hashCode();\n i += 1;\n }\n }\n return h;\n }",
"class_method_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_359 | {
"fields": [],
"file": "ambry-clustermap/src/test/java/com/github/ambry/clustermap/PartitionLayoutTest.java",
"identifier": "PartitionLayoutTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void validation() throws JSONException {\n TestHardwareLayout testHardwareLayout = new TestHardwareLayout(\"Alpha\");\n\n try {\n TestPartitionLayout tpl = new TestPartitionLayoutWithDuplicatePartitions(testHardwareLayout);\n fail(\"Should have failed validation:\" + tpl.get... | {
"fields": [
{
"declarator": "MinPartitionId = 0",
"modifier": "private static final",
"original_string": "private static final long MinPartitionId = 0;",
"type": "long",
"var_name": "MinPartitionId"
},
{
"declarator": "hardwareLayout",
"modifier": "private final... | {
"body": "@Override\n public String toString() {\n try {\n return toJSONObject().toString(2);\n } catch (JSONException e) {\n logger.error(\"JSONException caught in toString: \", e.getCause());\n }\n return null;\n }",
"class_method_signature": "PartitionLayout.toString()",
"constructor":... | {
"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_56 | {
"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 getDiskManagerTest() 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 inval... | {
"fields": [
{
"declarator": "partitionToDiskManager = new ConcurrentHashMap<>()",
"modifier": "protected final",
"original_string": "protected final ConcurrentHashMap<PartitionId, DiskManager> partitionToDiskManager = new ConcurrentHashMap<>();",
"type": "ConcurrentHashMap<PartitionId, D... | {
"body": "DiskManager getDiskManager(PartitionId id) {\n return partitionToDiskManager.get(id);\n }",
"class_method_signature": "StorageManager.getDiskManager(PartitionId id)",
"constructor": false,
"full_signature": " DiskManager getDiskManager(PartitionId id)",
"identifier": "getDiskManager",
"invoca... | {
"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_135 | {
"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 testUpsertNormal() throws Exception {\n Observable<ResourceResponse<Document>> mockResponse = getMockedObservableForSingleResource(blobMetadata);\n when(mockumentClient.upsertDocument(anyString(), any(), any(RequestOptions.class), anyBoolean())).thenReturn(\n mockResponse)... | {
"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> upsertMetadata(CloudBlobMetadata blobMetadata) throws DocumentClientException {\n RequestOptions options = getRequestOptions(blobMetadata.getPartitionId());\n return executeCosmosAction(\n () -> asyncDocumentClient.upsertDocument(cosmosCollectionLink, blobMetadata, o... | {
"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_162 | {
"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 testPendingDecryptJobs() throws InterruptedException, GeneralSecurityException {\n nettyByteBufLeakHelper.setDisabled(true);\n int testDataCount = 10;\n CountDownLatch encryptCallBackCount = new CountDownLatch(testDataCount);\n CountDownLatch decryptCallBackCount = new Coun... | {
"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": "void submitJob(CryptoJob cryptoJob) {\n if (enabled.get()) {\n scheduler.execute(cryptoJob);\n }\n }",
"class_method_signature": "CryptoJobHandler.submitJob(CryptoJob cryptoJob)",
"constructor": false,
"full_signature": " void submitJob(CryptoJob cryptoJob)",
"identifier": "submitJob",
... | {
"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_318 | {
"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 cloudReplicaAdditionTest() throws Exception {\n StorageManager storageManager =\n new StorageManager(storeConfig, new DiskManagerConfig(verifiableProperties), Utils.newScheduler(1, true),\n clusterMap.getMetricRegistry(), null, clusterMap, currentNode, null,\n ... | {
"fields": [
{
"declarator": "clusterMapConfig",
"modifier": "private final",
"original_string": "private final ClusterMapConfig clusterMapConfig;",
"type": "ClusterMapConfig",
"var_name": "clusterMapConfig"
},
{
"declarator": "storeConfig",
"modifier": "private ... | {
"body": "@Override\n public void start() {\n // Add listener for vcr instance config changes\n vcrClusterSpectator.registerInstanceConfigChangeListener(new InstanceConfigChangeListenerImpl());\n vcrClusterSpectator.registerLiveInstanceChangeListener(new LiveInstanceChangeListenerImpl());\n\n // Add lis... | {
"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_17 | {
"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 testConflictingUpdateCaseD() 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_174 | {
"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 partitionLevelAdaptiveTrackerTest() throws Exception {\n MockPartitionId mockPartition1 = new MockPartitionId(0L, MockClusterMap.DEFAULT_PARTITION_CLASS);\n MockPartitionId mockPartition2 = new MockPartitionId(1L, MockClusterMap.DEFAULT_PARTITION_CLASS);\n for (int i = 0; i < ... | {
"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_40 | {
"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 testValidDataSizeAfterExpiration() throws StoreException, IOException {\n assumeTrue(!bucketingEnabled);\n BlobStoreStats blobStoreStats = setupBlobStoreStats(0, 0);\n // advance time to the next second for previous deletes/expiration to take effect\n advanceTimeToNextSecon... | {
"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_123 | {
"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 testUndelete() throws Exception {\n mockBlobExistence(true);\n assertEquals(0, azureDest.undeleteBlob(blobId, (short) 0, dummyCloudUpdateValidator));\n assertEquals(1, azureMetrics.blobUpdatedCount.getCount());\n assertEquals(0, azureMetrics.blobUpdateErrorCount.getCount())... | {
"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 short undeleteBlob(BlobId blobId, short lifeVersion, CloudUpdateValidator cloudUpdateValidator)\n throws CloudStorageException {\n Map<String, Object> updateFields = new HashMap<>();\n updateFields.put(CloudBlobMetadata.FIELD_LIFE_VERSION, lifeVersion);\n updateFields.put(... | {
"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_154 | {
"fields": [
{
"declarator": "vcrRequests",
"modifier": "private final",
"original_string": "private final VcrRequests vcrRequests;",
"type": "VcrRequests",
"var_name": "vcrRequests"
},
{
"declarator": "request",
"modifier": "private final",
"original_strin... | {
"body": "@Test\n public void getRemoteReplicaLagTest() {\n Assert.assertEquals(vcrRequests.getRemoteReplicaLag(null, 0), -1);\n Assert.assertEquals(vcrRequests.getRemoteReplicaLag(null, 100), -1);\n Assert.assertEquals(vcrRequests.getRemoteReplicaLag(store, 0), -1);\n Assert.assertEquals(vcrRequests.ge... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(VcrRequests.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(VcrRequests.class);",
"type": "Logger",
"var_name": "logger"
}
],
"file": ... | {
"body": "@Override\n protected long getRemoteReplicaLag(Store store, long totalBytesRead) {\n return -1;\n }",
"class_method_signature": "VcrRequests.getRemoteReplicaLag(Store store, long totalBytesRead)",
"constructor": false,
"full_signature": "@Override protected long getRemoteReplicaLag(Store store, ... | {
"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_338 | {
"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 testSetException() throws Exception {\n // exception in primary should be thrown\n when(primarySource.set(any())).thenThrow(new RuntimeException());\n DataNodeConfig config = createConfig(1, 1);\n TestUtils.assertException(RuntimeException.class, () -> compositeSource.set(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 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_37 | {
"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 testContainerValidDataSize() throws StoreException {\n assumeTrue(!bucketingEnabled);\n BlobStoreStats blobStoreStats = setupBlobStoreStats(0, 0);\n verifyAndGetContainerValidSize(blobStoreStats, state.time.milliseconds());\n // advance time\n advanceTimeToNextSecond();\... | {
"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_292 | {
"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 testSerializeString() {\n String randomString = TestUtils.getRandomString(10);\n ByteBuffer outputBuffer = ByteBuffer.allocate(4 + randomString.getBytes().length);\n Utils.serializeString(outputBuffer, randomString, StandardCharsets.US_ASCII);\n outputBuffer.flip();\n in... | {
"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 serializeString(ByteBuffer outputBuffer, String value, Charset charset) {\n byte[] valueArray = value.getBytes(charset);\n outputBuffer.putInt(valueArray.length);\n outputBuffer.put(valueArray);\n }",
"class_method_signature": "Utils.serializeString(ByteBuffer outputBuffer, S... | {
"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_103 | {
"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 testAddBlobStore() {\n StoreMetrics storeMetrics = new StoreMetrics(new MetricRegistry());\n BlobStore newAddedStore = new MockBlobStore(config, storeMetrics, time, null);\n // without compaction enabled.\n compactionManager.enable();\n compactionManager.addBlobStore(new... | {
"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": "void addBlobStore(BlobStore store) {\n if (compactionExecutor == null) {\n stores.add(store);\n } else {\n // we first disable compaction on new store and then add it into stores set\n compactionExecutor.controlCompactionForBlobStore(store, false);\n stores.add(store);\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_380 | {
"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 testBasicSendAndPoll() {\n DataNodeId dataNodeId = localPlainTextDataNodes.get(0);\n ReplicaId replicaId = sslDisabledClusterMap.getReplicaIds(dataNodeId).get(0);\n List<RequestInfo> requestInfoList = new ArrayList<>();\n List<ResponseInfo> responseInfoList;\n requestInf... | {
"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_60 | {
"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 diskSpaceAllocatorTest() throws Exception {\n generateConfigs(true, false);\n MockDataNodeId dataNode = clusterMap.getDataNodes().get(0);\n List<ReplicaId> replicas = clusterMap.getReplicaIds(dataNode);\n List<String> mountPaths = dataNode.getMountPaths();\n Map<String, ... | {
"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_400 | {
"fields": [
{
"declarator": "loopGroup",
"modifier": "private",
"original_string": "private EventLoopGroup loopGroup;",
"type": "EventLoopGroup",
"var_name": "loopGroup"
},
{
"declarator": "channel",
"modifier": "private",
"original_string": "private MockC... | {
"body": "@Test\n public void availableStream0ShouldBeFalse() {\n loopGroup.register(channel).awaitUninterruptibly();\n Promise<Channel> channelPromise = new DefaultPromise<>(loopGroup.next());\n channelPromise.setSuccess(channel);\n\n MultiplexedChannelRecord record = new MultiplexedChannelRecord(chann... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(MultiplexedChannelRecord.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(MultiplexedChannelRecord.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "boolean acquireStream(Promise<Channel> promise) {\n if (claimStream()) {\n releaseClaimOnFailure(promise);\n acquireClaimedStream(promise);\n return true;\n }\n log.warn(\"No available streams on this connection: {}\", parentChannel.remoteAddress());\n return false;\n }",
"cla... | {
"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_115 | {
"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 testCompactionFailsOnCheckpointReadError() throws Exception {\n BlobStorageException ex = mockStorageException(BlobErrorCode.INTERNAL_ERROR);\n when(mockBlockBlobClient.downloadWithResponse(any(), any(), any(), any(), anyBoolean(), any(), any())).thenThrow(\n ex);\n try... | {
"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_99 | {
"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 diskSpaceRequirementsTest() throws Exception {\n // expect three log segments to be already allocated (from setup process)\n int segmentsAllocated = 3;\n doDiskSpaceRequirementsTest(segmentsAllocated, 0);\n\n // try adding fake swap segment log segment.\n File tempFile =... | {
"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 void delete(List<MessageInfo> infosToDelete) throws StoreException {\n checkStarted();\n checkDuplicates(infosToDelete);\n final Timer.Context context = metrics.deleteResponse.time();\n try {\n List<IndexValue> indexValuesPriorToDelete = new ArrayList<>();\n List<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_396 | {
"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 testClose() throws IOException {\n NetworkClient compositeClient = factory.getNetworkClient();\n compositeClient.close();\n verify(diskMocks.client).close();\n verify(cloudMocks.client).close();\n }",
"class_method_signature": "CompositeNetworkClientTest.testClose()",
... | {
"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 close() {\n childNetworkClients.values().forEach(NetworkClient::close);\n Utils.shutDownExecutorService(executor, 1, TimeUnit.MINUTES);\n }",
"class_method_signature": "CompositeNetworkClient.close()",
"constructor": false,
"full_signature": "@Override public void clos... | {
"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_379 | {
"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 testWarmUpConnectionsFailedAll() {\n selector.setState(MockSelectorState.FailConnectionInitiationOnPoll);\n List<ResponseInfo> responseInfos = new ArrayList<>();\n Assert.assertEquals(\"Connection count is not expected\", 0,\n networkClient.warmUpConnections(localPlainT... | {
"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 int warmUpConnections(List<DataNodeId> dataNodeIds, int connectionWarmUpPercentagePerDataNode,\n long timeForWarmUp, List<ResponseInfo> responseInfoList) {\n logger.info(\"Connection warm up start.\");\n if (dataNodeIds.size() == 0) {\n return 0;\n }\n dataNodeIds.... | {
"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_76 | {
"fields": [
{
"declarator": "STORE_ID = \"compactor_example_store\"",
"modifier": "private static final",
"original_string": "private static final String STORE_ID = \"compactor_example_store\";",
"type": "String",
"var_name": "STORE_ID"
},
{
"declarator": "DISK_IO_SCH... | {
"body": "@Test\n public void closeWithoutInitTest() throws Exception {\n refreshState(false, true);\n compactor = getCompactor(state.log, DISK_IO_SCHEDULER);\n compactor.close(0);\n }",
"class_method_signature": "BlobStoreCompactorTest.closeWithoutInitTest()",
"constructor": false,
"full_signature"... | {
"fields": [
{
"declarator": "COMPACTION_CLEANUP_JOB_NAME = \"blob_store_compactor_cleanup\"",
"modifier": "static final",
"original_string": "static final String COMPACTION_CLEANUP_JOB_NAME = \"blob_store_compactor_cleanup\";",
"type": "String",
"var_name": "COMPACTION_CLEANUP_JOB_... | {
"body": "void close(long waitTimeSecs) throws InterruptedException {\n isActive = false;\n if (waitTimeSecs > 0 && !runningLatch.await(waitTimeSecs, TimeUnit.SECONDS)) {\n logger.error(\"Compactor did not shutdown within {} seconds for {}\", waitTimeSecs, storeId);\n }\n logger.trace(\"Closed BlobS... | {
"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_142 | {
"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 getStoreTest() throws IOException {\n CloudStorageManager cloudStorageManager = createNewCloudStorageManager();\n ReplicaId mockReplicaId = clusterMap.getReplicaIds(clusterMap.getDataNodeIds().get(0)).get(0);\n PartitionId partitionId = mockReplicaId.getPartitionId();\n\n /... | {
"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 Store getStore(PartitionId id) {\n try {\n lock.readLock().lock();\n if (partitionToStore.containsKey(id)) {\n return partitionToStore.get(id).isStarted() ? partitionToStore.get(id) : null;\n }\n } finally {\n lock.readLock().unlock();\n }\n return... | {
"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_284 | {
"fields": [],
"file": "ambry-utils/src/test/java/com/github/ambry/utils/CrcInputStreamTest.java",
"identifier": "CrcInputStreamTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCrcInputStream() throws IOException {\n byte[] buf = new byte[4000];\n new Random().nextBytes(buf);\n ByteBufferInputStream stream = new ByteBufferInputStream(ByteBuffer.wrap(buf));\n CrcInputStream crcStream = new CrcInputStream(stream);\n byte[] bufOutput = new byt... | {
"fields": [
{
"declarator": "crc",
"modifier": "private",
"original_string": "private Crc32 crc;",
"type": "Crc32",
"var_name": "crc"
},
{
"declarator": "stream",
"modifier": "private",
"original_string": "private InputStream stream;",
"type": "Input... | {
"body": "public CrcInputStream(InputStream in) {\n this(new Crc32(), in);\n }",
"class_method_signature": "CrcInputStream.CrcInputStream(InputStream in)",
"constructor": true,
"full_signature": "public CrcInputStream(InputStream in)",
"identifier": "CrcInputStream",
"invocations": [],
"modifiers": ... | {
"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_21 | {
"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 testUpdateDisabled() {\n helixConfigProps.setProperty(HelixAccountServiceConfig.UPDATE_DISABLED, \"true\");\n vHelixConfigProps = new VerifiableProperties(helixConfigProps);\n storeConfig = new HelixPropertyStoreConfig(vHelixConfigProps);\n String updaterThreadPrefix = UUID... | {
"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_139 | {
"fields": [],
"file": "ambry-cloud/src/test/java/com/github/ambry/cloud/azure/CosmosChangeFeedFindTokenFactoryTest.java",
"identifier": "CosmosChangeFeedFindTokenFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void getFindTokenTest() throws IOException {\n short version = 0;\n Random random = new Random();\n long bytesRead = random.nextLong();\n String startContinuationToken = \"start\";\n String endContinuationToken = \"end\";\n int totalItems = random.nextInt();\n int index... | {
"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 getFindToken(DataInputStream stream) throws IOException {\n return CosmosChangeFeedFindToken.fromBytes(stream);\n }",
"class_method_signature": "CosmosChangeFeedFindTokenFactory.getFindToken(DataInputStream stream)",
"constructor": false,
"full_signature": "@Override... | {
"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_6 | {
"fields": [
{
"declarator": "mySqlAccountService",
"modifier": "",
"original_string": "AccountService mySqlAccountService;",
"type": "AccountService",
"var_name": "mySqlAccountService"
},
{
"declarator": "mySqlConfigProps = new Properties()",
"modifier": "",
... | {
"body": "@Test\n public void testUpdateDuplicateAccounts() throws IOException {\n AccountServiceMetrics accountServiceMetrics = new AccountServiceMetrics(new MetricRegistry());\n mySqlAccountService = new MySqlAccountService(accountServiceMetrics,\n new MySqlAccountServiceConfig(new VerifiableProperti... | {
"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_355 | {
"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 addNewPartition() {\n TestHardwareLayout testHardwareLayout = new TestHardwareLayout(\"Alpha\");\n PartitionLayout partitionLayout = new PartitionLayout(testHardwareLayout.getHardwareLayout(), clusterMapConfig);\n\n StaticClusterManager clusterMapManager =\n (new Static... | {
"fields": [
{
"declarator": "hardwareLayout",
"modifier": "protected final",
"original_string": "protected final HardwareLayout hardwareLayout;",
"type": "HardwareLayout",
"var_name": "hardwareLayout"
},
{
"declarator": "partitionLayout",
"modifier": "protected ... | {
"body": "PartitionId addNewPartition(List<Disk> disks, long replicaCapacityInBytes, String partitionClass) {\n return partitionLayout.addNewPartition(disks, replicaCapacityInBytes, partitionClass);\n }",
"class_method_signature": "StaticClusterManager.addNewPartition(List<Disk> disks, long replicaCapacityInBy... | {
"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_210 | {
"fields": [
{
"declarator": "random = new Random()",
"modifier": "private static final",
"original_string": "private static final Random random = new Random();",
"type": "Random",
"var_name": "random"
},
{
"declarator": "version",
"modifier": "private final",
... | {
"body": "@Test\n public void testIsAccountContainerMatch() {\n BlobId blobId = getRandomBlobId(version);\n if (version == BLOB_ID_V1) {\n assertTrue(\"isAccountContainerMatch() should always return true for V1 blobID.\",\n blobId.isAccountContainerMatch(blobId.getAccountId(), blobId.getContain... | {
"fields": [
{
"declarator": "BLOB_ID_V1 = 1",
"modifier": "public static final",
"original_string": "public static final short BLOB_ID_V1 = 1;",
"type": "short",
"var_name": "BLOB_ID_V1"
},
{
"declarator": "BLOB_ID_V2 = 2",
"modifier": "public static final",
... | {
"body": "@Override\n public boolean isAccountContainerMatch(short accountId, short containerId) {\n if (getVersion() == BLOB_ID_V1) {\n return true;\n }\n return (this.accountId == accountId) && (this.containerId == containerId);\n }",
"class_method_signature": "BlobId.isAccountContainerMatch(shor... | {
"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_181 | {
"fields": [
{
"declarator": "MAX_PORTS_PLAIN_TEXT = 3",
"modifier": "private static final",
"original_string": "private static final int MAX_PORTS_PLAIN_TEXT = 3;",
"type": "int",
"var_name": "MAX_PORTS_PLAIN_TEXT"
},
{
"declarator": "MAX_PORTS_SSL = 3",
"modifi... | {
"body": "@Test\n public void testIOErrorAndBlobNotFoundInOriginDc() throws Exception {\n assumeTrue(operationTrackerType.equals(AdaptiveOperationTracker.class.getSimpleName()));\n correlationIdToGetOperation.clear();\n\n // Pick a remote DC as the new local DC.\n String newLocal = \"DC1\";\n String ... | {
"fields": [
{
"declarator": "operationCallbackInvoked = new AtomicBoolean(false)",
"modifier": "private final",
"original_string": "private final AtomicBoolean operationCallbackInvoked = new AtomicBoolean(false);",
"type": "AtomicBoolean",
"var_name": "operationCallbackInvoked"
... | {
"body": "OperationTracker getOperationTrackerInUse() {\n return operationTracker;\n }",
"class_method_signature": "GetBlobInfoOperation.getOperationTrackerInUse()",
"constructor": false,
"full_signature": " OperationTracker getOperationTrackerInUse()",
"identifier": "getOperationTrackerInUse",
"invoca... | {
"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_302 | {
"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 compareTimesTest() {\n assertEquals(\"Infinite_Time should be equal to Infinite_Time\", 0,\n Utils.compareTimes(Utils.Infinite_Time, Utils.Infinite_Time));\n assertEquals(\"Infinite_Time should be greater than any finite time.\", 1,\n Utils.compareTimes(Utils.Infini... | {
"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 compareTimes(long time1, long time2) {\n if (time1 == time2) {\n return 0;\n } else if (time1 == Utils.Infinite_Time) {\n return 1;\n } else if (time2 == Utils.Infinite_Time) {\n return -1;\n } else {\n return Long.compare(time1, time2);\n }\n }",
"cl... | {
"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_247 | {
"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 testStripLeadingSlash() {\n RequestPath requestPath = new RequestPath(\"\", \"\", \"\", \"/opToMatch/abc\", null, NO_BLOB_SEGMENT_IDX_SPECIFIED);\n assertEquals(\"Should strip leading slash\", \"opToMatch/abc\", requestPath.getOperationOrBlobId(true));\n assertEquals(\"Should ... | {
"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": "public String getOperationOrBlobId(boolean stripLeadingSlash) {\n if (stripLeadingSlash) {\n if (operationOrBlobIdWithoutLeadingSlash == null) {\n operationOrBlobIdWithoutLeadingSlash =\n operationOrBlobId.startsWith(PATH_SEPARATOR_STRING) ? operationOrBlobId.substring(1) : operat... | {
"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_178 | {
"fields": [
{
"declarator": "routerConfig",
"modifier": "private final",
"original_string": "private final RouterConfig routerConfig;",
"type": "RouterConfig",
"var_name": "routerConfig"
},
{
"declarator": "mockClusterMap = new MockClusterMap()",
"modifier": "pr... | {
"body": "@Test\n public void testSetOperationExceptionAndComplete() throws Exception {\n int numChunks = routerConfig.routerMaxInMemPutChunks + 1;\n BlobProperties blobProperties =\n new BlobProperties(-1, \"serviceId\", \"memberId\", \"contentType\", false, Utils.Infinite_Time,\n Utils.get... | {
"fields": [
{
"declarator": "routerConfig",
"modifier": "private final",
"original_string": "private final RouterConfig routerConfig;",
"type": "RouterConfig",
"var_name": "routerConfig"
},
{
"declarator": "routerMetrics",
"modifier": "private final",
"ori... | {
"body": "void setOperationExceptionAndComplete(Exception exception) {\n if (exception instanceof RouterException) {\n RouterUtils.replaceOperationException(operationException, (RouterException) exception, this::getPrecedenceLevel);\n } else {\n operationException.set(exception);\n }\n setOpera... | {
"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_197 | {
"fields": [],
"file": "ambry-commons/src/test/java/com/github/ambry/commons/NettySslHttp2FactoryTest.java",
"identifier": "NettySslHttp2FactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testHttp2SSLFactory() throws Exception {\n //server\n File trustStoreFile = File.createTempFile(\"truststore\", \".jks\");\n SSLConfig serverSslConfig =\n new SSLConfig(TestSSLUtils.createHttp2Props(\"DC1,DC2,DC3\", SSLFactory.Mode.SERVER, trustStoreFile, \"server\"));\... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(NettySslFactory.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(NettySslFactory.class);",
"type": "Logger",
"var_name": "logger"
},
{
... | {
"body": "@Override\n public SSLEngine createSSLEngine(String peerHost, int peerPort, Mode mode) {\n SslContext context = mode == Mode.CLIENT ? nettyClientSslContext : nettyServerSslContext;\n SSLEngine sslEngine = context.newEngine(ByteBufAllocator.DEFAULT, peerHost, peerPort);\n\n if (mode == Mode.CLIENT... | {
"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_314 | {
"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 testBrokenStoreKeyConverter() throws Exception {\n InputAndExpected inputAndExpected =\n new InputAndExpected(pairList.get(0), VALID_MESSAGE_FORMAT_INPUT_STREAM_IMPLS[0], false);\n TransformationOutput output = transformer.transform(inputAndExpected.getInput());\n verif... | {
"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_251 | {
"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 ensureRequiredHeadersOrThrowTest() throws Exception {\n JSONObject headers = new JSONObject();\n Set<String> requiredHeaders = new HashSet<>(Arrays.asList(\"required_a\", \"required_b\", \"required_c\"));\n for (String requiredHeader : requiredHeaders) {\n headers.put(req... | {
"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 void ensureRequiredHeadersOrThrow(RestRequest restRequest, Set<String> requiredHeaders)\n throws RestServiceException {\n Map<String, Object> args = restRequest.getArgs();\n for (String header : requiredHeaders) {\n getHeader(args, header, true);\n }\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_343 | {
"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 HardwareLayout\n jsonObject = TestUtils.getJsonDatacenter(\"XYZ1\", (byte) 1, getDataNodes())... | {
"fields": [
{
"declarator": "hardwareLayout",
"modifier": "private final",
"original_string": "private final HardwareLayout hardwareLayout;",
"type": "HardwareLayout",
"var_name": "hardwareLayout"
},
{
"declarator": "name",
"modifier": "private final",
"or... | {
"body": "List<DataNode> getDataNodes() {\n return dataNodes;\n }",
"class_method_signature": "Datacenter.getDataNodes()",
"constructor": false,
"full_signature": " List<DataNode> getDataNodes()",
"identifier": "getDataNodes",
"invocations": [],
"modifiers": "",
"parameters": "()",
"return": "Lis... | {
"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_206 | {
"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 testFailToPublishMessage() throws Exception {\n helixNotifier = new HelixNotifier(new MockHelixPropertyStore<ZNRecord>(true, false));\n helixNotifier.publish(refTopics.get(0), refMessages.get(0));\n }",
"class_method_signature": "HelixNotifierTest.testFailToPublishMessage()",
... | {
"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_342 | {
"fields": [
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final ClusterMapConfig config;",
"type": "ClusterMapConfig",
"var_name": "config"
},
{
"declarator": "stateModelDef",
"modifier": "private final",
"original_stri... | {
"body": "@Test\n public void testDifferentStateModelDefs() {\n AmbryStateModelFactory factory = new AmbryStateModelFactory(config, new PartitionStateChangeListener() {\n @Override\n public void onPartitionBecomeBootstrapFromOffline(String partitionName) {\n // no op\n }\n\n @Override\... | {
"fields": [
{
"declarator": "clustermapConfig",
"modifier": "private final",
"original_string": "private final ClusterMapConfig clustermapConfig;",
"type": "ClusterMapConfig",
"var_name": "clustermapConfig"
},
{
"declarator": "partitionStateChangeListener",
"mod... | {
"body": "@Override\n public StateModel createNewStateModel(String resourceName, String partitionName) {\n StateModel stateModelToReturn;\n switch (clustermapConfig.clustermapStateModelDefinition) {\n case AmbryStateModelDefinition.AMBRY_LEADER_STANDBY_MODEL:\n stateModelToReturn =\n ne... | {
"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_207 | {
"fields": [],
"file": "ambry-commons/src/test/java/com/github/ambry/commons/CommonUtilsTest.java",
"identifier": "CommonUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void createHelixPropertyStoreTest() throws IOException {\n Properties storeProps = new Properties();\n storeProps.setProperty(\"helix.property.store.root.path\", \"/Ambry-Test/\" + ClusterMapUtils.PROPERTYSTORE_STR);\n HelixPropertyStoreConfig propertyStoreConfig = new HelixPropert... | {
"fields": [],
"file": "ambry-commons/src/main/java/com/github/ambry/commons/CommonUtils.java",
"identifier": "CommonUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "CommonUtils.createHelixPropertyStore(String zkServers,\n HelixPropertyStoreConfig propertyStoreConfig, List<S... | {
"body": "public static HelixPropertyStore<ZNRecord> createHelixPropertyStore(String zkServers,\n HelixPropertyStoreConfig propertyStoreConfig, List<String> subscribedPaths) {\n if (zkServers == null || zkServers.isEmpty() || propertyStoreConfig == null) {\n throw new IllegalArgumentException(\"Invalid ... | {
"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_315 | {
"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 testWarmup() throws Exception {\n InputAndExpected inputAndExpected =\n new InputAndExpected(pairList.get(0), VALID_MESSAGE_FORMAT_INPUT_STREAM_IMPLS[0], true);\n BlobIdTransformer transformer = new BlobIdTransformer(blobIdFactory, factory.getStoreKeyConverter());\n 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 void warmup(List<MessageInfo> messageInfos) throws Exception {\n List<StoreKey> storeKeys = new ArrayList<>();\n for (MessageInfo messageInfo : messageInfos) {\n if (!messageInfo.isExpired() && !messageInfo.isDeleted()) {\n storeKeys.add(messageInfo.getStoreKey());\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_250 | {
"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 isPrivateTest() throws Exception {\n String serviceId = generateRandomString(10);\n String contentType = \"image/gif\";\n JSONObject headers = new JSONObject();\n // using this just to help with setting the other necessary headers - doesn't matter what the container is, the... | {
"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 isPrivate(Map<String, Object> args) throws RestServiceException {\n return getBooleanHeader(args, Headers.PRIVATE, false);\n }",
"class_method_signature": "RestUtils.isPrivate(Map<String, Object> args)",
"constructor": false,
"full_signature": "public static boolean isPrivat... | {
"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_179 | {
"fields": [
{
"declarator": "DEFAULT_KEY_SIZE_CHARS = 64",
"modifier": "static final",
"original_string": "static final int DEFAULT_KEY_SIZE_CHARS = 64;",
"type": "int",
"var_name": "DEFAULT_KEY_SIZE_CHARS"
},
{
"declarator": "DEFAULT_RANDOM_KEY_SIZE_BITS = 256",
... | {
"body": "@Test\n public void testRandomKey() throws Exception {\n int[] keySizes = {128, 192, 256};\n for (int keySize : keySizes) {\n String key = TestUtils.getRandomKey(keySize);\n Properties props = getKMSProperties(key, keySize);\n VerifiableProperties verifiableProperties = new Verifiable... | {
"fields": [
{
"declarator": "secretKeySpec",
"modifier": "private final",
"original_string": "private final SecretKeySpec secretKeySpec;",
"type": "SecretKeySpec",
"var_name": "secretKeySpec"
},
{
"declarator": "enabled = true",
"modifier": "private volatile",
... | {
"body": "@Override\n public SecretKeySpec getRandomKey() throws GeneralSecurityException {\n SecretKey secretKey = keyGen.generateKey();\n byte[] encoded = secretKey.getEncoded();\n return new SecretKeySpec(encoded, keyGenAlgo);\n }",
"class_method_signature": "SingleKeyManagementService.getRandomKey()... | {
"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_196 | {
"fields": [],
"file": "ambry-commons/src/test/java/com/github/ambry/commons/JdkSslFactoryTest.java",
"identifier": "JdkSslFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSSLFactory() throws Exception {\n TestSSLUtils.testSSLFactoryImpl(JdkSslFactory.class.getName());\n\n // test features specific to JDK impls, like the PRNG algorithm config\n File trustStoreFile = File.createTempFile(\"truststore\", \".jks\");\n Properties props = new P... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(JdkSslFactory.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(JdkSslFactory.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n public SSLContext getSSLContext() {\n return sslContext;\n }",
"class_method_signature": "JdkSslFactory.getSSLContext()",
"constructor": false,
"full_signature": "@Override public SSLContext getSSLContext()",
"identifier": "getSSLContext",
"invocations": [],
"modifiers": "@Over... | {
"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_303 | {
"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 splitStringTest() {\n assertEquals(\"Unexpected result\", new ArrayList<>(Arrays.asList(\"a\", \"b\", \"c\")), Utils.splitString(\"a,b,c\", \",\"));\n assertEquals(\"Empty string should return empty list\", new ArrayList<>(), Utils.splitString(\"\", \",\"));\n assertEquals(\"E... | {
"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 ArrayList<String> splitString(String data, String delimiter) {\n return splitString(data, delimiter, ArrayList::new);\n }",
"class_method_signature": "Utils.splitString(String data, String delimiter)",
"constructor": false,
"full_signature": "public static ArrayList<String> splitStr... | {
"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_246 | {
"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 testOperationMatching() {\n String operation = \"opToMatch\";\n Stream.of(new RequestPath(\"\", \"\", \"\", \"/\" + operation + \"/abc/def\", null, NO_BLOB_SEGMENT_IDX_SPECIFIED),\n new RequestPath(\"\", \"\", \"\", \"/\" + operation, null, NO_BLOB_SEGMENT_IDX_SPECIFIED),\... | {
"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": "public boolean matchesOperation(String operation) {\n return matchPathSegments(operationOrBlobId, 0, operation, true) >= 0;\n }",
"class_method_signature": "RequestPath.matchesOperation(String operation)",
"constructor": false,
"full_signature": "public boolean matchesOperation(String operation)"... | {
"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_180 | {
"fields": [
{
"declarator": "DEFAULT_KEY_SIZE_CHARS = 64",
"modifier": "static final",
"original_string": "static final int DEFAULT_KEY_SIZE_CHARS = 64;",
"type": "int",
"var_name": "DEFAULT_KEY_SIZE_CHARS"
},
{
"declarator": "DEFAULT_RANDOM_KEY_SIZE_BITS = 256",
... | {
"body": "@Test\n public void testSingleKMSFactory() throws Exception {\n Properties props = getKMSProperties(\"\", DEFAULT_KEY_SIZE_CHARS);\n VerifiableProperties verifiableProperties = new VerifiableProperties((props));\n try {\n new SingleKeyManagementServiceFactory(verifiableProperties, CLUSTER_NA... | {
"fields": [
{
"declarator": "secretKeySpec",
"modifier": "private final",
"original_string": "private final SecretKeySpec secretKeySpec;",
"type": "SecretKeySpec",
"var_name": "secretKeySpec"
},
{
"declarator": "enabled = true",
"modifier": "private volatile",
... | {
"body": "@Override\n public SecretKeySpec getRandomKey() throws GeneralSecurityException {\n SecretKey secretKey = keyGen.generateKey();\n byte[] encoded = secretKey.getEncoded();\n return new SecretKeySpec(encoded, keyGenAlgo);\n }",
"class_method_signature": "SingleKeyManagementService.getRandomKey()... | {
"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_354 | {
"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 findDatacenter() {\n TestHardwareLayout testHardwareLayout = new TestHardwareLayout(\"Alpha\");\n TestPartitionLayout testPartitionLayout = new TestPartitionLayout(testHardwareLayout, null);\n\n StaticClusterManager clusterMapManager =\n (new StaticClusterAgentsFactory(... | {
"fields": [
{
"declarator": "hardwareLayout",
"modifier": "protected final",
"original_string": "protected final HardwareLayout hardwareLayout;",
"type": "HardwareLayout",
"var_name": "hardwareLayout"
},
{
"declarator": "partitionLayout",
"modifier": "protected ... | {
"body": "@Override\n public boolean hasDatacenter(String datacenterName) {\n return hardwareLayout.findDatacenter(datacenterName) != null;\n }",
"class_method_signature": "StaticClusterManager.hasDatacenter(String datacenterName)",
"constructor": false,
"full_signature": "@Override public boolean hasData... | {
"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_211 | {
"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 basicsTest() throws Exception {\n List<byte[]> inputBuffers = getBuffers(1000, 20, 201, 0, 79, 1005);\n RetainingAsyncWritableChannel channel = new RetainingAsyncWritableChannel();\n for (int i = 0; i < inputBuffers.size(); i++) {\n ByteBuffer buf = ByteBuffer.wrap(inputB... | {
"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_138 | {
"fields": [],
"file": "ambry-cloud/src/test/java/com/github/ambry/cloud/azure/CosmosChangeFeedFindTokenTest.java",
"identifier": "CosmosChangeFeedFindTokenTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void equalityTest() {\n short version = 0;\n Random random = new Random();\n long bytesRead = random.nextLong();\n String startContinuationToken = \"start\";\n String endContinuationToken = \"end\";\n int totalItems = random.nextInt();\n int index = random.nextInt() % t... | {
"fields": [
{
"declarator": "version",
"modifier": "private final",
"original_string": "private final short version;",
"type": "short",
"var_name": "version"
},
{
"declarator": "bytesRead",
"modifier": "private final",
"original_string": "private final lon... | {
"body": "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"version: \").append(getVersion());\n sb.append(\" bytesRead: \").append(getBytesRead());\n sb.append(\" type: \").append(getType().toString());\n sb.append(\" startContinuationToken: \").append(st... | {
"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_7 | {
"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_EnoughBackupFilesWithVersion() 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 // Create backup... | {
"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_285 | {
"fields": [],
"file": "ambry-utils/src/test/java/com/github/ambry/utils/CrcOutputStreamTest.java",
"identifier": "CrcOutputStreamTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCrcOutputStream() throws IOException {\n byte[] buf = new byte[4000];\n ByteBufferOutputStream stream = new ByteBufferOutputStream(ByteBuffer.wrap(buf));\n CrcOutputStream crcStream = new CrcOutputStream(stream);\n byte[] bufOutput = new byte[4000];\n new Random().ne... | {
"fields": [
{
"declarator": "crc",
"modifier": "private",
"original_string": "private Crc32 crc;",
"type": "Crc32",
"var_name": "crc"
},
{
"declarator": "stream",
"modifier": "private",
"original_string": "private OutputStream stream;",
"type": "Outp... | {
"body": "public CrcOutputStream(OutputStream out) {\n this(new Crc32(), out);\n }",
"class_method_signature": "CrcOutputStream.CrcOutputStream(OutputStream out)",
"constructor": true,
"full_signature": "public CrcOutputStream(OutputStream out)",
"identifier": "CrcOutputStream",
"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_20 | {
"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 testReadConflictAccountDataFromHelixPropertyStoreCase3() throws Exception {\n Account account1 = new AccountBuilder((short) 1, \"a\", AccountStatus.INACTIVE).build();\n List<Account> accounts = Collections.singletonList(account1);\n writeAccountsToHelixPropertyStore(accounts, ... | {
"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_143 | {
"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 checkLocalPartitionStatusTest() throws IOException {\n CloudStorageManager cloudStorageManager = createNewCloudStorageManager();\n ReplicaId mockReplicaId = clusterMap.getReplicaIds(clusterMap.getDataNodeIds().get(0)).get(0);\n PartitionId partitionId = mockReplicaId.getPartit... | {
"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 ServerErrorCode checkLocalPartitionStatus(PartitionId partition, ReplicaId localReplica) {\n /*\n * Vcr nodes serve requests for all partitions from cloud blob store. So assuming that cloud is always available,\n * the local partition status for a vcr node should always be av... | {
"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_98 | {
"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 shutdownTest() throws StoreException {\n store.shutdown();\n File cleanShutDownFile = new File(tempDir, PersistentIndex.CLEAN_SHUTDOWN_FILENAME);\n assertTrue(\"Clean shutdown file should exist.\", cleanShutDownFile.exists());\n // no operations should be possible if store ... | {
"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 void shutdown() throws StoreException {\n shutdown(false);\n }",
"class_method_signature": "BlobStore.shutdown()",
"constructor": false,
"full_signature": "@Override public void shutdown()",
"identifier": "shutdown",
"invocations": [
"shutdown"
],
"modifiers": "@Ov... | {
"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_397 | {
"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 testReplicaTypeNotFound() throws Exception {\n NetworkClient compositeClient =\n new CompositeNetworkClient(new EnumMap<>(Collections.singletonMap(ReplicaType.DISK_BACKED, diskMocks.client)));\n TestUtils.assertException(IllegalStateException.class,\n () -> composit... | {
"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_378 | {
"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 testSocketRequestResponseChannelTest() {\n try {\n SocketRequestResponseChannel channel = new SocketRequestResponseChannel(2, 10);\n Integer key = new Integer(5);\n String connectionId = \"test_connectionId\";\n ByteBuf buffer = PooledByteBufAllocator.DEFAULT.hea... | {
"fields": [
{
"declarator": "numProcessors",
"modifier": "private final",
"original_string": "private final int numProcessors;",
"type": "int",
"var_name": "numProcessors"
},
{
"declarator": "queueSize",
"modifier": "private final",
"original_string": "pri... | {
"body": "public SocketRequestResponseChannel(int numProcessors, int queueSize) {\n this.numProcessors = numProcessors;\n this.queueSize = queueSize;\n this.requestQueue = new ArrayBlockingQueue<>(this.queueSize);\n responseQueues = new ArrayList<>(this.numProcessors);\n responseListeners = new ArrayL... | {
"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_77 | {
"fields": [
{
"declarator": "STORE_ID = \"compactor_example_store\"",
"modifier": "private static final",
"original_string": "private static final String STORE_ID = \"compactor_example_store\";",
"type": "String",
"var_name": "STORE_ID"
},
{
"declarator": "DISK_IO_SCH... | {
"body": "@Test\n public void differentDeleteAndExpiryTimesTest() throws Exception {\n Pair<Long, List<String>> expiryTimeAndSegmentsUnderCompaction = setupStateWithExpiredBlobsAtSpecificTime();\n state.advanceTime(expiryTimeAndSegmentsUnderCompaction.getFirst() + Time.MsPerSec - state.time.milliseconds());\n... | {
"fields": [
{
"declarator": "COMPACTION_CLEANUP_JOB_NAME = \"blob_store_compactor_cleanup\"",
"modifier": "static final",
"original_string": "static final String COMPACTION_CLEANUP_JOB_NAME = \"blob_store_compactor_cleanup\";",
"type": "String",
"var_name": "COMPACTION_CLEANUP_JOB_... | {
"body": "void close(long waitTimeSecs) throws InterruptedException {\n isActive = false;\n if (waitTimeSecs > 0 && !runningLatch.await(waitTimeSecs, TimeUnit.SECONDS)) {\n logger.error(\"Compactor did not shutdown within {} seconds for {}\", waitTimeSecs, storeId);\n }\n logger.trace(\"Closed BlobS... | {
"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_401 | {
"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 testConnectionFailureCases() throws InterruptedException, ConnectionPoolTimeoutException, IOException {\n int port = 6680;\n String host = \"127.0.0.1\";\n SocketServer server = startServer(port);\n Properties props = new Properties();\n props.setProperty(\"clustermap.cl... | {
"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": "@Override\n public void shutdown() {\n logger.info(\"Shutting down the BlockingChannelConnectionPool\");\n for (Map.Entry<String, BlockingChannelInfo> channels : connections.entrySet()) {\n channels.getValue().cleanup();\n }\n }",
"class_method_signature": "BlockingChannelConnectionPool.s... | {
"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_114 | {
"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 testCompactionProceedsOnCheckpointNotFound() throws Exception {\n mockCheckpointDownload(false, null);\n int expectedNumQUeries = numQueryBuckets * 2;\n int expectedPurged = numBlobsPerQuery * expectedNumQUeries;\n assertEquals(expectedPurged, azureStorageCompactor.compactP... | {
"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_381 | {
"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 testConnectionUnavailable() {\n List<RequestInfo> requestInfoList = new ArrayList<>();\n List<ResponseInfo> responseInfoList;\n requestInfoList.add(new RequestInfo(sslHost, sslPort, new MockSend(3), replicaOnSslNode));\n requestInfoList.add(new RequestInfo(sslHost, sslPort,... | {
"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_61 | {
"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 unrecognizedDirsOnDiskTest() throws Exception {\n MockDataNodeId dataNode = clusterMap.getDataNodes().get(0);\n List<ReplicaId> replicas = clusterMap.getReplicaIds(dataNode);\n int extraDirsCount = 0;\n Set<String> createdMountPaths = new HashSet<>();\n for (ReplicaId re... | {
"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_102 | {
"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 testControlCompactionForBlobStore() {\n // without compaction enabled.\n compactionManager.enable();\n //Disable compaction on BlobStore when compaction executor is not instantiated\n compactionManager.controlCompactionForBlobStore(blobStore, false);\n compactionManager.... | {
"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": "void controlCompactionForBlobStore(BlobStore store, boolean enable) {\n if (compactionExecutor != null) {\n compactionExecutor.controlCompactionForBlobStore(store, enable);\n }\n }",
"class_method_signature": "CompactionManager.controlCompactionForBlobStore(BlobStore store, boolean enable)",
... | {
"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_339 | {
"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 testGetBothSuccess() {\n DataNodeConfig config = createConfig(1, 1);\n when(primarySource.get(any())).thenReturn(config);\n when(secondarySource.get(any())).thenReturn(config);\n assertEquals(\"Unexpected response\", config, compositeSource.get(config.getInstanceName()));\n... | {
"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_36 | {
"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 testInitializationAndClose() throws InterruptedException {\n int bucketCount = bucketingEnabled ? 1 : 0;\n final CountDownLatch scanStartedLatch = new CountDownLatch(1);\n MockThrottler mockThrottler = new MockThrottler(scanStartedLatch, new CountDownLatch(0));\n throttlers... | {
"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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.