id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
13870893_360
{ "fields": [], "file": "ambry-clustermap/src/test/java/com/github/ambry/clustermap/PartitionLayoutTest.java", "identifier": "PartitionLayoutTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getPartitionsTest() throws JSONException {\n String specialPartitionClass = \"specialPartitionClass\";\n TestHardwareLayout hardwareLayout = new TestHardwareLayout(\"Alpha\");\n String dc = hardwareLayout.getRandomDatacenter().getName();\n TestPartitionLayout testPartitionL...
{ "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": "public List<PartitionId> getPartitions(String partitionClass) {\n return partitionSelectionHelper.getPartitions(partitionClass);\n }", "class_method_signature": "PartitionLayout.getPartitions(String partitionClass)", "constructor": false, "full_signature": "public List<PartitionId> getPartitions(...
{ "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_80
{ "fields": [], "file": "ambry-store/src/test/java/com/github/ambry/store/LogSegmentNameHelperTest.java", "identifier": "LogSegmentNameHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getNameTest() {\n for (int i = 0; i < 10; i++) {\n long pos = Utils.getRandomLong(TestUtils.RANDOM, 1000);\n long gen = Utils.getRandomLong(TestUtils.RANDOM, 1000);\n assertEquals(\"Did not get expected name\", pos + BlobStore.SEPARATOR + gen,\n LogSegmentNam...
{ "fields": [ { "declarator": "SUFFIX = BlobStore.SEPARATOR + \"log\"", "modifier": "static final", "original_string": "static final String SUFFIX = BlobStore.SEPARATOR + \"log\";", "type": "String", "var_name": "SUFFIX" }, { "declarator": "COMPARATOR = new Comparator<S...
{ "body": "static String getName(long pos, long gen) {\n return pos + BlobStore.SEPARATOR + gen;\n }", "class_method_signature": "LogSegmentNameHelper.getName(long pos, long gen)", "constructor": false, "full_signature": "static String getName(long pos, long gen)", "identifier": "getName", "invocations"...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_225
{ "fields": [], "file": "ambry-frontend/src/test/java/com/github/ambry/frontend/AmbrySecurityServiceFactoryTest.java", "identifier": "AmbrySecurityServiceFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getAmbrySecurityServiceFactoryTest() throws Exception {\n SecurityService securityService =\n new AmbrySecurityServiceFactory(new VerifiableProperties(new Properties()), new MockClusterMap(), null, null,\n null, null).getSecurityService();\n Assert.assertNotNull...
{ "fields": [ { "declarator": "frontendConfig", "modifier": "private final", "original_string": "private final FrontendConfig frontendConfig;", "type": "FrontendConfig", "var_name": "frontendConfig" }, { "declarator": "frontendMetrics", "modifier": "private final"...
{ "body": "@Override\n public SecurityService getSecurityService() throws InstantiationException {\n return new AmbrySecurityService(frontendConfig, frontendMetrics, urlSigningService,\n new QuotaManager(frontendConfig));\n }", "class_method_signature": "AmbrySecurityServiceFactory.getSecurityService()"...
{ "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_79
{ "fields": [], "file": "ambry-store/src/test/java/com/github/ambry/store/LogSegmentNameHelperTest.java", "identifier": "LogSegmentNameHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void hashCodeTest() {\n String name = TestUtils.getRandomString(10);\n assertEquals(\"Hashcode is not as expected\", name.hashCode(), LogSegmentNameHelper.hashcode(name));\n }", "class_method_signature": "LogSegmentNameHelperTest.hashCodeTest()", "constructor": false, "full_sig...
{ "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 int hashcode(String name) {\n return name.hashCode();\n }", "class_method_signature": "LogSegmentNameHelper.hashcode(String name)", "constructor": false, "full_signature": "static int hashcode(String name)", "identifier": "hashcode", "invocations": [ "hashCode" ], "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_376
{ "fields": [ { "declarator": "clientSSLFactory", "modifier": "private static", "original_string": "private static SSLFactory clientSSLFactory;", "type": "SSLFactory", "var_name": "clientSSLFactory" }, { "declarator": "clientSSLSocketFactory", "modifier": "private...
{ "body": "@Test\n public void simpleRequest() throws IOException, InterruptedException {\n simpleRequest(new Port(server.getPort(), PortType.PLAINTEXT));\n }", "class_method_signature": "SocketServerTest.simpleRequest()", "constructor": false, "full_signature": "@Test public void simpleRequest()", "iden...
{ "fields": [ { "declarator": "networkConfig", "modifier": "private final", "original_string": "private final NetworkConfig networkConfig;", "type": "NetworkConfig", "var_name": "networkConfig" }, { "declarator": "host", "modifier": "private final", "origina...
{ "body": "public int getPort() {\n return port;\n }", "class_method_signature": "SocketServer.getPort()", "constructor": false, "full_signature": "public int getPort()", "identifier": "getPort", "invocations": [], "modifiers": "public", "parameters": "()", "return": "int", "signature": "int get...
{ "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_399
{ "fields": [ { "declarator": "loopGroup", "modifier": "private static", "original_string": "private static EventLoopGroup loopGroup;", "type": "EventLoopGroup", "var_name": "loopGroup" }, { "declarator": "maxConcurrentStreamsPerConnection = 256", "modifier": "pri...
{ "body": "@Test\n public void failedConnectionAcquireNotifiesPromise() throws InterruptedException {\n IOException exception = new IOException();\n ChannelPool connectionPool = mock(ChannelPool.class);\n when(connectionPool.acquire()).thenReturn(new FailedFuture<>(loopGroup.next(), exception));\n\n Chan...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Http2MultiplexedChannelPool.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(Http2MultiplexedChannelPool.class);", "type": "Logger", "var_name": "log...
{ "body": "@Override\n public Future<Channel> acquire() {\n return acquire(eventLoopGroup.next().newPromise());\n }", "class_method_signature": "Http2MultiplexedChannelPool.acquire()", "constructor": false, "full_signature": "@Override public Future<Channel> acquire()", "identifier": "acquire", "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_233
{ "fields": [ { "declarator": "putFormat", "modifier": "private final", "original_string": "private final String putFormat;", "type": "String", "var_name": "putFormat" }, { "declarator": "messageFormatHeaderVersionSaved", "modifier": "private static", "origi...
{ "body": "@Test\n public void messageReadSetIndexInputStreamTestException() throws Exception {\n ArrayList<ByteBuffer> listBuf = new ArrayList<ByteBuffer>();\n byte[] buf = new byte[1024];\n new Random().nextBytes(buf);\n listBuf.add(ByteBuffer.wrap(buf));\n ArrayList<StoreKey> storeKeys = new ArrayL...
{ "fields": [ { "declarator": "messageReadSet", "modifier": "private final", "original_string": "private final MessageReadSet messageReadSet;", "type": "MessageReadSet", "var_name": "messageReadSet" }, { "declarator": "indexToRead", "modifier": "private final", ...
{ "body": "@Override\n public int read() throws IOException {\n if (currentOffset >= messageReadSet.sizeInBytes(indexToRead)) {\n return -1;\n }\n ByteBuffer buf = ByteBuffer.allocate(1);\n ByteBufferOutputStream bufferStream = new ByteBufferOutputStream(buf);\n long bytesRead = messageReadSet.wr...
{ "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_96
{ "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 findMissingKeysTest() throws StoreException {\n List<StoreKey> idsToProvide = new ArrayList<StoreKey>(allKeys.keySet());\n Set<StoreKey> nonExistentIds = new HashSet<>();\n for (int i = 0; i < 10; i++) {\n nonExistentIds.add(getUniqueId());\n }\n idsToProvide.addAll...
{ "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 Set<StoreKey> findMissingKeys(List<StoreKey> keys) throws StoreException {\n checkStarted();\n final Timer.Context context = metrics.findMissingKeysResponse.time();\n try {\n Set<StoreKey> missingKeys = index.findMissingKeys(keys);\n onSuccess();\n return missing...
{ "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_321
{ "fields": [ { "declarator": "mountPathToPartitionInfoList", "modifier": "private static", "original_string": "private static Map<String, Set<PartitionInfo>> mountPathToPartitionInfoList;", "type": "Map<String, Set<PartitionInfo>>", "var_name": "mountPathToPartitionInfoList" }, ...
{ "body": "@Test\n public void version0AndCurrentVersionRetrieveTest() throws Exception {\n DiskTokenPersistor diskTokenPersistor = new DiskTokenPersistor(REPLICA_TOKEN_FILENAME, mountPathToPartitionInfoList,\n new ReplicationMetrics(new MetricRegistry(), Collections.emptyList()), clusterMap, findTokenHelp...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DiskTokenPersistor.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(DiskTokenPersistor.class);", "type": "Logger", "var_name": "logger" }, ...
{ "body": "@Override\n public List<ReplicaTokenInfo> retrieve(String mountPath) throws ReplicationException {\n File replicaTokenFile = new File(mountPath, replicaTokenFileName);\n if (replicaTokenFile.exists()) {\n try (FileInputStream fileInputStream = new FileInputStream(replicaTokenFile)) {\n r...
{ "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_264
{ "fields": [], "file": "ambry-api/src/test/java/com/github/ambry/router/GetBlobOptionsTest.java", "identifier": "GetBlobOptionsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRangeOption() {\n long startOffset = 1;\n long endOffset = 2;\n ByteRange range = ByteRanges.fromOffsetRange(startOffset, endOffset);\n GetBlobOptions options = new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.All)\n .range(ByteRanges.fromOf...
{ "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 ByteRange getRange() {\n return range;\n }", "class_method_signature": "GetBlobOptions.getRange()", "constructor": false, "full_signature": "public ByteRange getRange()", "identifier": "getRange", "invocations": [], "modifiers": "public", "parameters": "()", "return": "ByteRange"...
{ "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_55
{ "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 startBlobStoreTest() 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": "@Override\n public boolean startBlobStore(PartitionId id) {\n DiskManager diskManager = partitionToDiskManager.get(id);\n return diskManager != null && diskManager.startBlobStore(id);\n }", "class_method_signature": "StorageManager.startBlobStore(PartitionId id)", "constructor": false, "full_...
{ "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_9
{ "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 testCreateAccount() {\n accountService = mockHelixAccountServiceFactory.getAccountService();\n assertEquals(\"The number of account in HelixAccountService is incorrect\", 0,\n accountService.getAllAccounts().size());\n boolean res = accountService.updateAccounts(idToRef...
{ "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_136
{ "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 testUpdateNormal() throws Exception {\n Observable<ResourceResponse<Document>> mockResponse = getMockedObservableForSingleResource(blobMetadata);\n when(mockumentClient.readDocument(anyString(), any(RequestOptions.class))).thenReturn(mockResponse);\n when(mockumentClient.repla...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(CosmosDataAccessor.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(CosmosDataAccessor.class);", "type": "Logger", "var_name": "logger" }, ...
{ "body": "ResourceResponse<Document> updateMetadata(BlobId blobId, Map<String, String> updateFields)\n throws DocumentClientException {\n\n // Read the existing record\n String docLink = getDocumentLink(blobId.getID());\n RequestOptions options = getRequestOptions(blobId.getPartition().toPathString());...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_248
{ "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 testBadSegmentSubResourceNumber() throws UnsupportedEncodingException, URISyntaxException {\n String requestPath = \"/mediaExpectedOpOrId/Segment/notAnInteger\";\n List<String> prefixesToRemove = new ArrayList<>();\n RestRequest restRequest = RestUtilsTest.createRestRequest(Re...
{ "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 static RequestPath parse(RestRequest restRequest, List<String> prefixesToRemove, String clusterName)\n throws RestServiceException {\n String blobIdHeader = RestUtils.getHeader(restRequest.getArgs(), Headers.BLOB_ID, false);\n if (blobIdHeader != null) {\n // If blob id is specified ...
{ "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_161
{ "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 testPendingEncryptJobs() throws InterruptedException, GeneralSecurityException {\n nettyByteBufLeakHelper.setDisabled(true);\n int testDataCount = 10;\n int closeOnCount = 4;\n CountDownLatch encryptCallBackCount = new CountDownLatch(testDataCount);\n List<EncryptJob> en...
{ "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_14
{ "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 testUpdateNameConflictingAccounts() throws Exception {\n accountService = mockHelixAccountServiceFactory.getAccountService();\n List<Account> conflictAccounts = new ArrayList<>();\n conflictAccounts.add(new AccountBuilder((short) 1, \"a\", AccountStatus.INACTIVE).build());\n ...
{ "fields": [ { "declarator": "ACCOUNT_METADATA_CHANGE_TOPIC = \"account_metadata_change_topic\"", "modifier": "static final", "original_string": "static final String ACCOUNT_METADATA_CHANGE_TOPIC = \"account_metadata_change_topic\";", "type": "String", "var_name": "ACCOUNT_METADATA_...
{ "body": "@Override\n public boolean updateAccounts(Collection<Account> accounts) {\n return updateAccountsWithAccountMetadataStore(accounts, accountMetadataStore);\n }", "class_method_signature": "HelixAccountService.updateAccounts(Collection<Account> accounts)", "constructor": false, "full_signature": "...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_198
{ "fields": [ { "declarator": "EXECUTOR_SERVICE = Executors.newSingleThreadExecutor()", "modifier": "private static final", "original_string": "private static final ExecutorService EXECUTOR_SERVICE = Executors.newSingleThreadExecutor();", "type": "ExecutorService", "var_name": "EXECU...
{ "body": "@Test\n public void closeTest() throws IOException {\n final AtomicBoolean streamOpen = new AtomicBoolean(true);\n InputStream stream = new InputStream() {\n @Override\n public int read() throws IOException {\n throw new IllegalStateException(\"Not implemented\");\n }\n\n ...
{ "fields": [ { "declarator": "BUFFER_SIZE = 8192", "modifier": "static final", "original_string": "static final int BUFFER_SIZE = 8192;", "type": "int", "var_name": "BUFFER_SIZE" }, { "declarator": "channelOpen = new AtomicBoolean(true)", "modifier": "private fin...
{ "body": "@Override\n public void close() throws IOException {\n if (channelOpen.compareAndSet(true, false)) {\n inputStream.close();\n }\n }", "class_method_signature": "InputStreamReadableStreamChannel.close()", "constructor": false, "full_signature": "@Override public void close()", "identifi...
{ "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_177
{ "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 noUnexpiredRequestsTest() throws InterruptedException {\n primeTracker(localColoTracker, MIN_DATA_POINTS_REQUIRED, LOCAL_COLO_LATENCY_RANGE);\n primeTracker(crossColoTracker, MIN_DATA_POINTS_REQUIRED, CROSS_COLO_LATENCY_RANGE);\n double localColoCutoff = localColoTracker.getSn...
{ "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_209
{ "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 testBuildBlobId() throws Exception {\n BlobId blobId = new BlobId(version, referenceType, referenceDatacenterId, referenceAccountId, referenceContainerId,\n referencePartitionId, referenceIsEncrypted, referenceDataType);\n assertEquals(\"Wrong blobId version\", version, ge...
{ "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 String getID() {\n return Base64.encodeBase64URLSafeString(toBytes());\n }", "class_method_signature": "BlobId.getID()", "constructor": false, "full_signature": "@Override public String getID()", "identifier": "getID", "invocations": [ "encodeBase64URLSafeString", ...
{ "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_43
{ "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 testBucketingBasic() throws StoreException, InterruptedException, IOException {\n assumeTrue(bucketingEnabled);\n final CountDownLatch scanStartedLatch = new CountDownLatch(1);\n MockThrottler mockThrottler = new MockThrottler(scanStartedLatch, new CountDownLatch(0));\n thr...
{ "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_120
{ "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 testPurgeWithCosmosBulkDeleteError() throws Exception {\n Exception mockException =\n new RuntimeException(new DocumentClientException(HttpConstants.StatusCodes.TOO_MANY_REQUESTS));\n doThrow(mockException).when(mockumentClient).executeStoredProcedure(anyString(), any(Requ...
{ "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_202
{ "fields": [ { "declarator": "CONTENT_SPLIT_PART_COUNT = 5", "modifier": "private static final", "original_string": "private static final int CONTENT_SPLIT_PART_COUNT = 5;", "type": "int", "var_name": "CONTENT_SPLIT_PART_COUNT" }, { "declarator": "READ_PART_COUNT = 4",...
{ "body": "@Test\n public void incompleteReadsTest() throws IOException {\n // Exception during read\n String exceptionMsg = \"@@randomMsg@@\";\n Exception exceptionToThrow = new Exception(exceptionMsg);\n ReadableStreamChannel channel = new IncompleteReadReadableStreamChannel(exceptionToThrow);\n Inp...
{ "fields": [ { "declarator": "asyncWritableChannel = new ByteBufferAsyncWritableChannel()", "modifier": "private final", "original_string": "private final ByteBufferAsyncWritableChannel asyncWritableChannel = new ByteBufferAsyncWritableChannel();", "type": "ByteBufferAsyncWritableChannel"...
{ "body": "@Override\n public int read() throws IOException {\n int data = -1;\n if (loadData()) {\n data = currentChunk.get() & 0xFF;\n reportBytesRead(1);\n }\n return data;\n }", "class_method_signature": "ReadableStreamChannelInputStream.read()", "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_347
{ "fields": [ { "declarator": "CURRENT_XID = 64", "modifier": "static final", "original_string": "static final long CURRENT_XID = 64;", "type": "long", "var_name": "CURRENT_XID" }, { "declarator": "clusterNamePrefixInHelix = \"Ambry-\"", "modifier": "static final"...
{ "body": "@Test\n public void sealedReplicaChangeTest() {\n assumeTrue(!useComposite && !overrideEnabled && listenCrossColo);\n\n // all instances are up initially.\n assertStateEquivalency(helixCluster.getDownInstances(), helixCluster.getUpInstances());\n\n AmbryPartition partition = (AmbryPartition) c...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(HelixClusterManager.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(HelixClusterManager.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@Override\n public List<PartitionId> getWritablePartitionIds(String partitionClass) {\n return partitionSelectionHelper.getWritablePartitions(partitionClass);\n }", "class_method_signature": "HelixClusterManager.getWritablePartitionIds(String partitionClass)", "constructor": false, "full_signatu...
{ "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_48
{ "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 testGetStatsSnapshots() throws StoreException {\n BlobStoreStats blobStoreStats = setupBlobStoreStats(0, 0);\n long deleteAndExpirationRefTimeInMs = state.time.milliseconds();\n Map<String, Map<String, Long>> utilizationMap =\n blobStoreStats.getValidDataSizeByContainer...
{ "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 Map<StatsReportType, StatsSnapshot> getStatsSnapshots(Set<StatsReportType> statsReportTypes,\n long referenceTimeInMs) throws StoreException {\n Map<StatsReportType, StatsSnapshot> statsSnapshotsByType = new HashMap<>();\n Map<String, Map<String, Long>> utilizationMap = getVa...
{ "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_255
{ "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 getUserMetadataFromByteArrayComplexTest() throws Exception {\n\n Map<String, String> userMetadataMap = null;\n // user metadata of size 1 byte\n byte[] userMetadataByteArray = new byte[1];\n userMetadataMap = RestUtils.buildUserMetadata(userMetadataByteArray);\n assertNu...
{ "fields": [ { "declarator": "HTTP_DATE_FORMAT = \"EEE, dd MMM yyyy HH:mm:ss zzz\"", "modifier": "public static final", "original_string": "public static final String HTTP_DATE_FORMAT = \"EEE, dd MMM yyyy HH:mm:ss zzz\";", "type": "String", "var_name": "HTTP_DATE_FORMAT" }, ...
{ "body": "public static byte[] buildUserMetadata(Map<String, Object> args) throws RestServiceException {\n ByteBuffer userMetadata;\n if (args.containsKey(MultipartPost.USER_METADATA_PART)) {\n userMetadata = (ByteBuffer) args.get(MultipartPost.USER_METADATA_PART);\n } else {\n Map<String, String>...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_310
{ "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 testBrokenChangedMetaDataBlobOperation() throws IOException, MessageFormatException {\n InputAndExpected inputAndExpected =\n new InputAndExpected(BLOB_ID_VERSION_1_METADATA_UNCONVERTED, VALID_MESSAGE_FORMAT_INPUT_STREAM_IMPLS[0], false,\n new String[]{BLOB_ID_VERS...
{ "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_193
{ "fields": [ { "declarator": "GSE = new GeneralSecurityException(\"Exception to throw for tests\")", "modifier": "static final", "original_string": "static final GeneralSecurityException GSE = new GeneralSecurityException(\"Exception to throw for tests\");", "type": "GeneralSecurityExcept...
{ "body": "@Test\n public void testFailureOnKMS() throws Exception {\n if (testEncryption) {\n setupEncryptionCast(new VerifiableProperties(new Properties()));\n instantiateEncryptionCast = false;\n kms.exceptionToThrow.set(GSE);\n // simple blob\n requestAndResultsList.clear();\n re...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(PutManager.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(PutManager.class);", "type": "Logger", "var_name": "logger" }, { "dec...
{ "body": "boolean isOpen() {\n return isOpen.get();\n }", "class_method_signature": "PutManager.isOpen()", "constructor": false, "full_signature": " boolean isOpen()", "identifier": "isOpen", "invocations": [ "get" ], "modifiers": "", "parameters": "()", "return": "boolean", "signature": ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_243
{ "fields": [ { "declarator": "messageFormatHeaderVersionSaved", "modifier": "private static", "original_string": "private static short messageFormatHeaderVersionSaved;", "type": "short", "var_name": "messageFormatHeaderVersionSaved" }, { "declarator": "nettyByteBufLeak...
{ "body": "@Test\n public void messageFormatTtlUpdateRecordTest() throws IOException, MessageFormatException {\n StoreKey key = new MockId(\"id1\");\n short accountId = Utils.getRandomShort(TestUtils.RANDOM);\n short containerId = Utils.getRandomShort(TestUtils.RANDOM);\n long ttlUpdateTimeMs = SystemTim...
{ "fields": [ { "declarator": "buffer = null", "modifier": "protected", "original_string": "protected ByteBuffer buffer = null;", "type": "ByteBuffer", "var_name": "buffer" }, { "declarator": "stream = null", "modifier": "protected", "original_string": "prot...
{ "body": "public long getSize() {\n return messageLength;\n }", "class_method_signature": "MessageFormatInputStream.getSize()", "constructor": false, "full_signature": "public long getSize()", "identifier": "getSize", "invocations": [], "modifiers": "public", "parameters": "()", "return": "long",...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_306
{ "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 testMetaDataBlobOperation() throws IOException, MessageFormatException {\n InputAndExpected inputAndExpected =\n new InputAndExpected(BLOB_ID_VERSION_1_METADATA_CONVERTED, VALID_MESSAGE_FORMAT_INPUT_STREAM_IMPLS[0], false,\n new String[]{BLOB_ID_VERSION_1_DATACHUNK...
{ "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_185
{ "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 testRangeRequestStitchDifferentSizedBlobs() throws Exception {\n if (metadataContentVersion > 2) {\n testGetSuccessStitch(LARGE_BLOB_SIZE, new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.Data)\n .range(ByteRanges.fromOffsetRange(CHUNK_SIZE * 2 + ...
{ "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_214
{ "fields": [ { "declarator": "storeKeyConverter", "modifier": "private final", "original_string": "private final StoreKeyConverter storeKeyConverter;", "type": "StoreKeyConverter", "var_name": "storeKeyConverter" } ], "file": "ambry-commons/src/test/java/com/github/ambry/sto...
{ "body": "@Test\n public void testNullInput() throws Exception {\n Map<StoreKey, StoreKey> storeKeyMap = storeKeyConverter.convert(null);\n assertEquals(\"storeKeyMap should not have inputs\", storeKeyMap.size(), 0);\n }", "class_method_signature": "StoreKeyConverterImplNoOpTest.testNullInput()", "constr...
{ "fields": [], "file": "ambry-commons/src/main/java/com/github/ambry/store/StoreKeyConverterImplNoOp.java", "identifier": "StoreKeyConverterImplNoOp", "interfaces": "implements StoreKeyConverter", "methods": [ { "class_method_signature": "StoreKeyConverterImplNoOp.convert(Collection<? extends Store...
{ "body": "@Override\n public Map<StoreKey, StoreKey> convert(Collection<? extends StoreKey> input) throws Exception {\n Map<StoreKey, StoreKey> output = new HashMap<>();\n if (input != null) {\n input.forEach((storeKey) -> output.put(storeKey, storeKey));\n }\n return output;\n }", "class_method...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_351
{ "fields": [ { "declarator": "RELEVANT_PERIOD_IN_MINUTES = 60", "modifier": "private static final", "original_string": "private static final long RELEVANT_PERIOD_IN_MINUTES = 60;", "type": "long", "var_name": "RELEVANT_PERIOD_IN_MINUTES" }, { "declarator": "DEFAULT_TIM...
{ "body": "@Test\n public void testStatsAggregationWithAllEmptyNodes() throws IOException {\n int nodeCount = 3;\n for (StatsReportType type : EnumSet.of(StatsReportType.ACCOUNT_REPORT, StatsReportType.PARTITION_CLASS_REPORT)) {\n StatsWrapper emptyNodeStats = generateNodeStats(Collections.emptyList(), DE...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(HelixClusterAggregator.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(HelixClusterAggregator.class);", "type": "Logger", "var_name": "logger"...
{ "body": "Pair<StatsSnapshot, StatsSnapshot> doWork(Map<String, String> statsWrappersJSON, StatsReportType type) throws IOException {\n StatsSnapshot partitionSnapshot = new StatsSnapshot(0L, new HashMap<>());\n Map<String, Long> partitionTimestampMap = new HashMap<>();\n StatsSnapshot rawPartitionSnapshot ...
{ "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_2
{ "fields": [ { "declarator": "mySqlAccountService", "modifier": "", "original_string": "AccountService mySqlAccountService;", "type": "AccountService", "var_name": "mySqlAccountService" }, { "declarator": "mySqlConfigProps = new Properties()", "modifier": "", ...
{ "body": "@Test\n public void testUpdateAccounts() throws SQLException, IOException {\n\n MySqlAccountStore mockMySqlAccountStore = mock(MySqlAccountStore.class);\n when(mockMySqlAccountStore.getNewAccounts(0)).thenReturn(new ArrayList<>());\n Container testContainer =\n new ContainerBuilder((short)...
{ "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_25
{ "fields": [ { "declarator": "accountConfig", "modifier": "private final", "original_string": "private final JsonAccountConfig accountConfig;", "type": "JsonAccountConfig", "var_name": "accountConfig" }, { "declarator": "accountService", "modifier": "private", ...
{ "body": "@Test(expected = UnsupportedOperationException.class)\n public void testUpdateAccounts() throws Exception {\n accountService.updateAccounts(Collections.emptyList());\n }", "class_method_signature": "JsonAccountServiceTest.testUpdateAccounts()", "constructor": false, "full_signature": "@Test(expe...
{ "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": "@Override\n public boolean updateAccounts(Collection<Account> accounts) {\n throw new UnsupportedOperationException(\n \"Service does not support updating of accountsById via API. Modify account JSON files on all nodes instead.\");\n }", "class_method_signature": "JsonAccountService.updateAcc...
{ "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_280
{ "fields": [ { "declarator": "time = new MockTime()", "modifier": "private final", "original_string": "private final MockTime time = new MockTime();", "type": "MockTime", "var_name": "time" } ], "file": "ambry-utils/src/test/java/com/github/ambry/utils/ThrottlerTest.java", ...
{ "body": "@Test\n public void throttlerTest() throws InterruptedException {\n time.setCurrentMilliseconds(0);\n Throttler throttler = new Throttler(100, 10, true, time);\n throttler.maybeThrottle(0);\n Assert.assertEquals(0, time.milliseconds());\n throttler.maybeThrottle(50);\n Assert.assertEqual...
{ "fields": [ { "declarator": "desiredRatePerSec", "modifier": "private", "original_string": "private double desiredRatePerSec;", "type": "double", "var_name": "desiredRatePerSec" }, { "declarator": "checkIntervalMs", "modifier": "private", "original_string"...
{ "body": "public Throttler(double desiredRatePerSec, long checkIntervalMs, boolean throttleDown, Time time) {\n this.desiredRatePerSec = desiredRatePerSec;\n this.checkIntervalMs = checkIntervalMs;\n this.throttleDown = throttleDown;\n this.time = time;\n this.observedSoFar = 0.0;\n this.periodStar...
{ "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_146
{ "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 setBlobStoreStoppedState() throws IOException {\n CloudStorageManager cloudStorageManager = createNewCloudStorageManager();\n try {\n cloudStorageManager.setBlobStoreStoppedState(Collections.emptyList(), true);\n Assert.fail(\"CloudStorageManager setBlobStoreStoppedStat...
{ "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 List<PartitionId> setBlobStoreStoppedState(List<PartitionId> partitionIds, boolean markStop) {\n throw new UnsupportedOperationException(\"Method not supported\");\n }", "class_method_signature": "CloudStorageManager.setBlobStoreStoppedState(List<PartitionId> partitionIds, boolean...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_72
{ "fields": [ { "declarator": "CUSTOM_ID_SIZE = 10", "modifier": "private static final", "original_string": "private static final int CUSTOM_ID_SIZE = 10;", "type": "int", "var_name": "CUSTOM_ID_SIZE" }, { "declarator": "KEY_SIZE = new MockId(TestUtils.getRandomString(C...
{ "body": "@Test\n public void iteratorTest() throws Exception {\n String logSegmentName = LogSegmentNameHelper.getName(0, 0);\n MockId id1 = new MockId(\"0\" + TestUtils.getRandomString(CUSTOM_ID_SIZE - 1));\n MockId id2 = new MockId(\"1\" + TestUtils.getRandomString(CUSTOM_ID_SIZE - 1));\n MockId id3 =...
{ "fields": [ { "declarator": "INDEX_SEGMENT_FILE_NAME_SUFFIX = \"index\"", "modifier": "static final", "original_string": "static final String INDEX_SEGMENT_FILE_NAME_SUFFIX = \"index\";", "type": "String", "var_name": "INDEX_SEGMENT_FILE_NAME_SUFFIX" }, { "declarator"...
{ "body": "public Iterator<IndexEntry> iterator() {\n if (!sealed.get()) {\n return new UnsealedIndexSegmentEntryIterator();\n }\n return new SealedIndexSegmentEntryIterator();\n }", "class_method_signature": "IndexSegment.iterator()", "constructor": false, "full_signature": "public Iterator<Inde...
{ "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_238
{ "fields": [ { "declarator": "messageFormatHeaderVersionSaved", "modifier": "private static", "original_string": "private static short messageFormatHeaderVersionSaved;", "type": "short", "var_name": "messageFormatHeaderVersionSaved" } ], "file": "ambry-messageformat/src/test...
{ "body": "@Test\n public void recoveryTest() throws MessageFormatException, IOException {\n MessageStoreRecovery recovery = new BlobStoreRecovery();\n // create log and write to it\n ReadImp readrecovery = new ReadImp();\n readrecovery.initialize();\n List<MessageInfo> recoveredMessages =\n re...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(BlobStoreRecovery.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(BlobStoreRecovery.class);", "type": "Logger", "var_name": "logger" } ]...
{ "body": "@Override\n public List<MessageInfo> recover(Read read, long startOffset, long endOffset, StoreKeyFactory factory)\n throws IOException {\n ArrayList<MessageInfo> messageRecovered = new ArrayList<MessageInfo>();\n try {\n while (startOffset < endOffset) {\n // read message header\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_392
{ "fields": [ { "declarator": "connectionTracker", "modifier": "private", "original_string": "private ConnectionTracker connectionTracker;", "type": "ConnectionTracker", "var_name": "connectionTracker" }, { "declarator": "verifiableProperties", "modifier": "privat...
{ "body": "@Test\n public void testReplenishConnections() {\n connectionTracker = new ConnectionTracker(routerConfig.routerScalingUnitMaxConnectionsPerPortPlainText,\n routerConfig.routerScalingUnitMaxConnectionsPerPortSsl);\n // When no connections were ever made to a host:port, connectionTracker shoul...
{ "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": "int replenishConnections(ConnectionFactory connectionFactory, int maxNewConnectionsPerHost) {\n int newConnections = 0;\n Iterator<HostPortPoolManager> iter = poolManagersBelowMinActiveConnections.iterator();\n while (iter.hasNext()) {\n HostPortPoolManager poolManager = iter.next();\n t...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_111
{ "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 testUpdateNotExists() throws Exception {\n BlobStorageException ex = mock(BlobStorageException.class);\n when(ex.getErrorCode()).thenReturn(BlobErrorCode.BLOB_NOT_FOUND);\n when(mockBlockBlobClient.getPropertiesWithResponse(any(), any(), any())).thenThrow(ex);\n expectBlobS...
{ "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": "public AzureCloudDestination.UpdateResponse updateBlobMetadata(BlobId blobId, Map<String, Object> updateFields,\n CloudUpdateValidator cloudUpdateValidator) throws Exception {\n Objects.requireNonNull(blobId, \"BlobId cannot be null\");\n updateFields.keySet()\n .forEach(field -> Objects....
{ "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_404
{ "fields": [ { "declarator": "BUFFER_SIZE = 4 * 1024", "modifier": "private static final", "original_string": "private static final int BUFFER_SIZE = 4 * 1024;", "type": "int", "var_name": "BUFFER_SIZE" }, { "declarator": "server", "modifier": "private", "o...
{ "body": "@Test(expected = IllegalStateException.class)\n public void testCantSendWithoutConnecting() throws Exception {\n selector.poll(1000L, asList(createSend(\"testCantSendWithoutConnecting_test\", \"test\")));\n }", "class_method_signature": "SelectorTest.testCantSendWithoutConnecting()", "constructor"...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(Selector.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(Selector.class);", "type": "Logger", "var_name": "logger" }, { "declara...
{ "body": "@Override\n public void poll(long timeoutMs) throws IOException {\n poll(timeoutMs, null);\n }", "class_method_signature": "Selector.poll(long timeoutMs)", "constructor": false, "full_signature": "@Override public void poll(long timeoutMs)", "identifier": "poll", "invocations": [ "poll" ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_64
{ "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 allocateBeforeInitializeTest() throws Exception {\n // For general testing purpose, following tests assume store may have different segment sizes.\n alloc = constructAllocator();\n File f1 = allocateAndVerify(storeId1, \"file1\", 50, false);\n File f2 = allocateAndVerify(st...
{ "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_384
{ "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 testConnectionInitializationFailures() {\n List<RequestInfo> requestInfoList = new ArrayList<>();\n requestInfoList.add(new RequestInfo(sslHost, sslPort, new MockSend(0), replicaOnSslNode));\n selector.setState(MockSelectorState.IdlePoll);\n Assert.assertEquals(0, selector....
{ "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_107
{ "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 testMarkDelete() throws Exception {\n mockBlobExistence(true);\n AzureCloudDestination.UpdateResponse response =\n dataAccessor.updateBlobMetadata(blobId, Collections.singletonMap(\"deletionTime\", deletionTime),\n dummyCloudUpdateValidator);\n assertTrue(\"E...
{ "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": "public AzureCloudDestination.UpdateResponse updateBlobMetadata(BlobId blobId, Map<String, Object> updateFields,\n CloudUpdateValidator cloudUpdateValidator) throws Exception {\n Objects.requireNonNull(blobId, \"BlobId cannot be null\");\n updateFields.keySet()\n .forEach(field -> Objects....
{ "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_296
{ "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 getRootCauseTest() {\n int nestingLevel = 5;\n String innerExceptionMsg = \"InnerException\";\n String outerExceptionMsgBase = \"OuterException\";\n Exception innerException = new Exception(innerExceptionMsg);\n Exception outerException = null;\n for (int i = 0; i < n...
{ "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 Throwable getRootCause(Throwable t) {\n Throwable throwable = t;\n while (throwable != null && throwable.getCause() != null) {\n throwable = throwable.getCause();\n }\n return throwable;\n }", "class_method_signature": "Utils.getRootCause(Throwable t)", "constructor": fa...
{ "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_33
{ "fields": [ { "declarator": "accountId = 101", "modifier": "private final", "original_string": "private final short accountId = 101;", "type": "short", "var_name": "accountId" }, { "declarator": "containerId = 1", "modifier": "private final", "original_str...
{ "body": "@Test\n public void testGetNewContainers() throws Exception {\n List<Container> containerList = containerDao.getNewContainers(0);\n assertEquals(1, containerList.size());\n assertEquals(testContainer, containerList.get(0));\n }", "class_method_signature": "ContainerDaoTest.testGetNewContainers...
{ "fields": [ { "declarator": "CONTAINER_TABLE = \"Containers\"", "modifier": "public static final", "original_string": "public static final String CONTAINER_TABLE = \"Containers\";", "type": "String", "var_name": "CONTAINER_TABLE" }, { "declarator": "ACCOUNT_ID = \"acc...
{ "body": "public List<Container> getNewContainers(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 = get...
{ "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_279
{ "fields": [], "file": "ambry-utils/src/test/java/com/github/ambry/utils/OpenBitSetTest.java", "identifier": "OpenBitSetTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOpenBitSetTest() {\n OpenBitSet bitSet = new OpenBitSet(1000);\n bitSet.set(0);\n bitSet.set(100);\n Assert.assertTrue(bitSet.get(0));\n Assert.assertTrue(bitSet.get(100));\n Assert.assertFalse(bitSet.get(1));\n bitSet.clear(0);\n Assert.assertFalse(bitSet.g...
{ "fields": [ { "declarator": "bits", "modifier": "private final", "original_string": "private final long[][] bits;", "type": "long[][]", "var_name": "bits" }, { "declarator": "wlen", "modifier": "private", "original_string": "private int wlen;", "type...
{ "body": "public OpenBitSet(long numBits) {\n wlen = (int) bits2words(numBits);\n int lastPageSize = wlen % PAGE_SIZE;\n int fullPageCount = wlen / PAGE_SIZE;\n pageCount = fullPageCount + (lastPageSize == 0 ? 0 : 1);\n\n bits = new long[pageCount][];\n\n for (int i = 0; i < fullPageCount; ++i) {\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_150
{ "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 handlePutRequestTest() throws IOException, InterruptedException {\n try {\n vcrRequests.handlePutRequest(request);\n Assert.fail(\"handlePutRequest should throw UnsupportedOperationException\");\n } catch (UnsupportedOperationException ex) {\n }\n }", "class_metho...
{ "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 public void handlePutRequest(NetworkRequest request) throws IOException, InterruptedException {\n throw new UnsupportedOperationException(\"Request type not supported\");\n }", "class_method_signature": "VcrRequests.handlePutRequest(NetworkRequest request)", "constructor": false, "fu...
{ "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_127
{ "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 testDeleteBlobNotFound() {\n BlobStorageException ex = mockStorageException(BlobErrorCode.BLOB_NOT_FOUND);\n when(mockBlockBlobClient.getPropertiesWithResponse(any(), any(), any())).thenThrow(ex);\n expectCloudStorageException(() -> azureDest.deleteBlob(blobId, deletionTime, (...
{ "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 boolean deleteBlob(BlobId blobId, long deletionTime, short lifeVersion,\n CloudUpdateValidator cloudUpdateValidator) throws CloudStorageException {\n Map<String, Object> updateFields = new HashMap<>();\n // TODO Frontend support needs to handle the special case of life versio...
{ "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_44
{ "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 testBucketingCoverageTransition() throws Exception {\n assumeTrue(bucketingEnabled);\n CountDownLatch scanStartedLatch = new CountDownLatch(1);\n // do not hold the initial scan\n MockThrottler mockThrottler = new MockThrottler(scanStartedLatch, new CountDownLatch(0), 50, 1...
{ "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_170
{ "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 testWarmUpConnectionFailureHandling() throws Exception {\n Properties props = getNonBlockingRouterProperties(\"DC3\");\n MockServerLayout mockServerLayout = new MockServerLayout(mockClusterMap);\n mockSelectorState.set(MockSelectorState.FailConnectionInitiationOnPoll);\n se...
{ "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_259
{ "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 buildContentRangeAndLengthTest() throws RestServiceException {\n // good cases\n doBuildContentRangeAndLengthTest(ByteRanges.fromOffsetRange(4, 8), 12, \"bytes 4-8/12\", 5, true);\n doBuildContentRangeAndLengthTest(ByteRanges.fromOffsetRange(4, 12), 12, \"bytes 4-11/12\", 8, t...
{ "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 Pair<String, Long> buildContentRangeAndLength(ByteRange range, long blobSize,\n boolean resolveRangeOnEmptyBlob) throws RestServiceException {\n try {\n range = range.toResolvedByteRange(blobSize, resolveRangeOnEmptyBlob);\n } catch (IllegalArgumentException e) {\n throw ...
{ "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_13
{ "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 testStartWithBackupFiles() throws Exception {\n // use testUpdateAccount function to create backups and then delete helixStore data.\n testUpdateAccount();\n if (accountService != null) {\n accountService.close();\n }\n deleteStoreIfExists();\n\n // should have s...
{ "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 void close() {\n if (open.compareAndSet(true, false)) {\n if (notifier != null) {\n notifier.unsubscribe(ACCOUNT_METADATA_CHANGE_TOPIC, changeTopicListener);\n }\n if (scheduler != null) {\n shutDownExecutorService(scheduler, config.updaterShutDownTimeout...
{ "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_189
{ "fields": [ { "declarator": "GSE = new GeneralSecurityException(\"Exception to throw for tests\")", "modifier": "static final", "original_string": "static final GeneralSecurityException GSE = new GeneralSecurityException(\"Exception to throw for tests\");", "type": "GeneralSecurityExcept...
{ "body": "@Test\n public void testBadCallback() throws Exception {\n RequestAndResult req = new RequestAndResult(chunkSize * 5 + random.nextInt(chunkSize - 1) + 1);\n router = getNonBlockingRouter();\n final CountDownLatch callbackCalled = new CountDownLatch(1);\n requestAndResultsList.clear();\n for...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(PutManager.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(PutManager.class);", "type": "Logger", "var_name": "logger" }, { "dec...
{ "body": "boolean isOpen() {\n return isOpen.get();\n }", "class_method_signature": "PutManager.isOpen()", "constructor": false, "full_signature": " boolean isOpen()", "identifier": "isOpen", "invocations": [ "get" ], "modifiers": "", "parameters": "()", "return": "boolean", "signature": ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_166
{ "fields": [ { "declarator": "random = new Random()", "modifier": "", "original_string": "Random random = new Random();", "type": "Random", "var_name": "random" }, { "declarator": "clusterMap", "modifier": "", "original_string": "ClusterMap clusterMap;", ...
{ "body": "@Test\n public void testGoodCase() throws Exception {\n initialize();\n BlobId convertedBlobId = RouterUtils.getBlobIdFromString(blobIdStr, clusterMap);\n assertEquals(\"The converted BlobId should be the same as the original.\", originalBlobId, convertedBlobId);\n }", "class_method_signature"...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(RouterUtils.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(RouterUtils.class);", "type": "Logger", "var_name": "logger" } ], "file": ...
{ "body": "static BlobId getBlobIdFromString(String blobIdString, ClusterMap clusterMap) throws RouterException {\n BlobId blobId;\n try {\n blobId = new BlobId(blobIdString, clusterMap);\n logger.trace(\"BlobId {} created with partitionId {}\", blobId, blobId.getPartition());\n } catch (Exception ...
{ "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_131
{ "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 testFindEntriesSinceUsingUpdateTime() throws Exception {\n AzureCloudDestination updateTimeBasedAzureCloudDestination = null;\n try {\n updateTimeBasedAzureCloudDestination =\n new AzureCloudDestination(mockServiceClient, mockBlobBatchClient, mockumentClient, \"foo\...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(AzureCloudDestination.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(AzureCloudDestination.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "@Override\n public void close() throws IOException {\n azureReplicationFeed.close();\n }", "class_method_signature": "AzureCloudDestination.close()", "constructor": false, "full_signature": "@Override public void close()", "identifier": "close", "invocations": [ "close" ], "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_218
{ "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 badResponseHandlerAndRestRequestTest() throws Exception {\n // What happens inside FrontendRestRequestService during this test?\n // 1. Since the RestRequest throws errors, FrontendRestRequestService will attempt to submit response with exception\n // to FrontendTestRespo...
{ "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 shutdown() {\n long shutdownBeginTime = System.currentTimeMillis();\n isUp = false;\n try {\n if (securityService != null) {\n securityService.close();\n securityService = null;\n }\n if (idConverter != null) {\n idConverter.close();\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_52
{ "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 addBlobStoreTest() throws Exception {\n generateConfigs(true, false);\n MockDataNodeId localNode = clusterMap.getDataNodes().get(0);\n List<ReplicaId> localReplicas = clusterMap.getReplicaIds(localNode);\n int newMountPathIndex = 3;\n // add new MountPath to local node\n...
{ "fields": [ { "declarator": "partitionToDiskManager = new ConcurrentHashMap<>()", "modifier": "protected final", "original_string": "protected final ConcurrentHashMap<PartitionId, DiskManager> partitionToDiskManager = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<PartitionId, D...
{ "body": "@Override\n public boolean addBlobStore(ReplicaId replica) {\n if (partitionToDiskManager.containsKey(replica.getPartitionId())) {\n logger.info(\"{} already exists in storage manager, rejecting adding store request\", replica.getPartitionId());\n return false;\n }\n DiskManager diskMan...
{ "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_326
{ "fields": [ { "declarator": "serverSecurityService =\n new AmbryServerSecurityService(new ServerConfig(new VerifiableProperties(new Properties())),\n new ServerMetrics(new MetricRegistry(), AmbryRequests.class, AmbryServer.class))", "modifier": "private final", "original_string":...
{ "body": "@Test\n public void validateConnectionTest() throws Exception {\n //sslSession is null\n TestUtils.assertException(IllegalArgumentException.class,\n () -> serverSecurityService.validateConnection(null).get(), null);\n\n //success case\n SSLSession sslSession = Mockito.mock(SSLSession.cl...
{ "fields": [ { "declarator": "isOpen", "modifier": "private", "original_string": "private boolean isOpen;", "type": "boolean", "var_name": "isOpen" }, { "declarator": "serverConfig", "modifier": "private final", "original_string": "private final ServerConfi...
{ "body": "@Override\n public void validateConnection(SSLSession sslSession, Callback<Void> callback) {\n Exception exception = null;\n serverMetrics.securityServiceValidateConnectionRate.mark();\n if (!isOpen) {\n exception = new RestServiceException(\"ServerSecurityService is closed\", RestServiceErr...
{ "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_29
{ "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 testAddAccount() throws Exception {\n accountDao.addAccount(testAccount);\n verify(mockConnection).prepareStatement(anyString());\n // Run second time to reuse statement\n accountDao.addAccount(testAccount);\n verify(mockConnection).prepareStatement(anyString());\n }", ...
{ "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 void addAccount(Account account) throws SQLException {\n try {\n PreparedStatement insertStatement = dataAccessor.getPreparedStatement(insertSql);\n insertStatement.setString(1, AccountCollectionSerde.accountToJsonNoContainers(account).toString());\n insertStatement.setInt(2, accou...
{ "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_263
{ "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 setUserMetadataHeadersTest() throws Exception {\n // empty user metadata\n MockRestResponseChannel responseChannel = new MockRestResponseChannel();\n assertTrue(\"Should report that headers are set\", RestUtils.setUserMetadataHeaders(new byte[0], responseChannel));\n assert...
{ "fields": [ { "declarator": "HTTP_DATE_FORMAT = \"EEE, dd MMM yyyy HH:mm:ss zzz\"", "modifier": "public static final", "original_string": "public static final String HTTP_DATE_FORMAT = \"EEE, dd MMM yyyy HH:mm:ss zzz\";", "type": "String", "var_name": "HTTP_DATE_FORMAT" }, ...
{ "body": "public static boolean setUserMetadataHeaders(byte[] userMetadata, RestResponseChannel restResponseChannel)\n throws RestServiceException {\n Map<String, String> userMetadataMap = buildUserMetadata(userMetadata);\n boolean setHeaders = userMetadataMap != null;\n if (setHeaders) {\n for (M...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_371
{ "fields": [ { "declarator": "GENERATED_CONTENT_SIZE = 10240", "modifier": "private static final", "original_string": "private static final int GENERATED_CONTENT_SIZE = 10240;", "type": "int", "var_name": "GENERATED_CONTENT_SIZE" }, { "declarator": "GENERATED_CONTENT_P...
{ "body": "@Test\n public void closeTest() throws RestServiceException {\n Channel channel = new MockChannel();\n NettyRequest nettyRequest = createNettyRequest(HttpMethod.POST, \"/\", null, channel);\n Queue<HttpContent> httpContents = new LinkedBlockingQueue<HttpContent>();\n for (int i = 0; i < 5; i++...
{ "fields": [ { "declarator": "bufferWatermark = -1", "modifier": "static", "original_string": "static int bufferWatermark = -1;", "type": "int", "var_name": "bufferWatermark" }, { "declarator": "CLOSED_CHANNEL_EXCEPTION = new ClosedChannelException()", "modifier"...
{ "body": "@Override\n public void close() {\n if (channelOpen.compareAndSet(true, false)) {\n setAutoRead(true);\n contentLock.lock();\n try {\n logger.trace(\"Closing NettyRequest {} with {} content chunks unread\", getUri(), requestContents.size());\n // For non-POST we usually hav...
{ "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_91
{ "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 getErrorCasesTest() throws StoreException {\n // duplicate IDs\n List<StoreKey> listWithDups = new ArrayList<>();\n listWithDups.add(liveKeys.iterator().next());\n listWithDups.add(listWithDups.get(0));\n try {\n store.get(listWithDups, EnumSet.noneOf(StoreGetOption...
{ "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 StoreInfo get(List<? extends StoreKey> ids, EnumSet<StoreGetOptions> storeGetOptions) throws StoreException {\n checkStarted();\n // allows concurrent gets\n final Timer.Context context = metrics.getResponse.time();\n if (ids.size() > 1 && ids.size() != new HashSet<>(ids).si...
{ "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_234
{ "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 testBlobPropertyV1() throws IOException, MessageFormatException {\n // Test Blob property Format V1 for all versions of BlobPropertiesSerDe\n short[] versions = new short[]{VERSION_1, VERSION_2, VERSION_3};\n for (short version : versions) {\n BlobProperties properties;\n...
{ "fields": [ { "declarator": "Version_Field_Size_In_Bytes = 2", "modifier": "public static final", "original_string": "public static final int Version_Field_Size_In_Bytes = 2;", "type": "int", "var_name": "Version_Field_Size_In_Bytes" }, { "declarator": "Crc_Size = 8",...
{ "body": "public static BlobProperties deserializeBlobProperties(InputStream stream)\n throws IOException, MessageFormatException {\n return deserializeAndGetBlobPropertiesWithVersion(stream).getBlobProperties();\n }", "class_method_signature": "MessageFormatRecord.deserializeBlobProperties(InputStream 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_367
{ "fields": [ { "declarator": "verifiableProperties", "modifier": "private static", "original_string": "private static VerifiableProperties verifiableProperties;", "type": "VerifiableProperties", "var_name": "verifiableProperties" }, { "declarator": "router", "mod...
{ "body": "@Test\n public void shutdownWithoutStart() throws IOException {\n AsyncRequestResponseHandler handler = getAsyncRequestResponseHandler(1);\n handler.shutdown();\n }", "class_method_signature": "AsyncRequestResponseHandlerTest.shutdownWithoutStart()", "constructor": false, "full_signature": "@...
{ "fields": [ { "declarator": "metrics", "modifier": "private final", "original_string": "private final RequestResponseHandlerMetrics metrics;", "type": "RequestResponseHandlerMetrics", "var_name": "metrics" }, { "declarator": "asyncRequestWorkers = new ArrayList<>()", ...
{ "body": "@Override\n public void shutdown() {\n long shutdownBeginTime = System.currentTimeMillis();\n try {\n if (isRunning()) {\n isRunning = false;\n logger.info(\"Shutting down AsyncRequestResponseHandler\");\n for (AsyncRequestWorker asyncRequestWorker : asyncRequestWorkers) {\...
{ "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_68
{ "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 swapSegmentRequirementTest() throws Exception {\n requiredSwapSegmentsPerSize = 4;\n alloc = constructAllocator();\n List<DiskSpaceRequirements> requirementsList = new ArrayList<>();\n requirementsList.add(new DiskSpaceRequirements(storeId0, 3, 7, 0));\n requirementsList...
{ "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_222
{ "fields": [ { "declarator": "FRONTEND_CONFIG = new FrontendConfig(new VerifiableProperties(new Properties()))", "modifier": "private static final", "original_string": "private static final FrontendConfig FRONTEND_CONFIG = new FrontendConfig(new VerifiableProperties(new Properties()));", ...
{ "body": "@Test\n public void processRequestTest() throws Exception {\n //rest request being null\n TestUtils.assertException(IllegalArgumentException.class, () -> securityService.preProcessRequest(null).get(),\n null);\n TestUtils.assertException(IllegalArgumentException.class, () -> securityServic...
{ "fields": [ { "declarator": "OPERATIONS = Collections.unmodifiableSet(\n Utils.getStaticFieldValuesAsStrings(Operations.class)\n .collect(Collectors.toCollection(() -> new TreeSet<>(String.CASE_INSENSITIVE_ORDER))))", "modifier": "static final", "original_string": "static final S...
{ "body": "@Override\n public void processRequest(RestRequest restRequest, Callback<Void> callback) {\n Exception exception = null;\n frontendMetrics.securityServiceProcessRequestRate.mark();\n long startTimeMs = System.currentTimeMillis();\n if (!isOpen) {\n exception = new RestServiceException(\"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_87
{ "fields": [ { "declarator": "STORE_KEY_FACTORY", "modifier": "private static final", "original_string": "private static final StoreKeyFactory STORE_KEY_FACTORY;", "type": "StoreKeyFactory", "var_name": "STORE_KEY_FACTORY" }, { "declarator": "tempDir", "modifier"...
{ "body": "@Test\n public void blobReadOptionsTest() throws IOException, StoreException {\n int logCapacity = 2000;\n int[] segCapacities = {2000, 1000};\n for (int segCapacity : segCapacities) {\n Log log = new Log(tempDir.getAbsolutePath(), logCapacity, StoreTestUtils.DEFAULT_DISK_SPACE_ALLOCATOR,\n ...
{ "fields": [ { "declarator": "segment", "modifier": "private final", "original_string": "private final LogSegment segment;", "type": "LogSegment", "var_name": "segment" }, { "declarator": "segmentView", "modifier": "private final", "original_string": "priva...
{ "body": "BlobReadOptions(Log log, Offset offset, MessageInfo info) {\n segment = log.getSegment(offset.getName());\n if (offset.getOffset() + info.getSize() > segment.getEndOffset()) {\n throw new IllegalArgumentException(\n \"Invalid offset [\" + offset + \"] and size [\" + info.getSize() + \"]...
{ "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_388
{ "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 testExceptionOnPoll() {\n List<RequestInfo> requestInfoList = new ArrayList<>();\n requestInfoList.add(new RequestInfo(sslHost, sslPort, new MockSend(3), replicaOnSslNode));\n requestInfoList.add(new RequestInfo(sslHost, sslPort, new MockSend(4), replicaOnSslNode));\n selec...
{ "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_330
{ "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 testStartRefresherWithEmptyStorageUsage() {\n storageUsageRefresher = new HelixStorageUsageRefresher(mockHelixStore, null, storageQuotaConfig);\n Map<String, Map<String, Long>> emptyMap = storageUsageRefresher.getContainerStorageUsage();\n assertTrue(emptyMap.equals(Collection...
{ "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_275
{ "fields": [], "file": "ambry-utils/src/test/java/com/github/ambry/utils/SimpleByteBufferPoolTest.java", "identifier": "SimpleByteBufferPoolTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMultipleRequestedServedAfterBlocked() throws Exception {\n final int n = 3;\n final int smallSize = 1024;\n final int largeSize = n * smallSize;\n final long capacity = n * smallSize;\n final long maxBlockTimeInMs = 200;\n SimpleByteBufferPool pool = new SimpleByt...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(SimpleByteBufferPool.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(SimpleByteBufferPool.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "public long availableMemory() {\n return availableMemory;\n }", "class_method_signature": "SimpleByteBufferPool.availableMemory()", "constructor": false, "full_signature": "public long availableMemory()", "identifier": "availableMemory", "invocations": [], "modifiers": "public", "paramete...
{ "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_331
{ "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 testStartRefresherWithStorageUsage() throws Exception {\n Map<String, Map<String, Long>> expectedUsage = makeStorageUsageAndWriteToHelix(10, 10);\n storageUsageRefresher = new HelixStorageUsageRefresher(mockHelixStore, null, storageQuotaConfig);\n Map<String, Map<String, Long>...
{ "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_274
{ "fields": [], "file": "ambry-utils/src/test/java/com/github/ambry/utils/SimpleByteBufferPoolTest.java", "identifier": "SimpleByteBufferPoolTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFirstBlockedThenSucceed() throws Exception {\n final int size = 1024;\n final long capacity = 1024;\n final long maxBlockTimeInMs = 200;\n SimpleByteBufferPool pool = new SimpleByteBufferPool(capacity);\n CountDownLatch[] allocated = new CountDownLatch[2];\n Count...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(SimpleByteBufferPool.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(SimpleByteBufferPool.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "public long availableMemory() {\n return availableMemory;\n }", "class_method_signature": "SimpleByteBufferPool.availableMemory()", "constructor": false, "full_signature": "public long availableMemory()", "identifier": "availableMemory", "invocations": [], "modifiers": "public", "paramete...
{ "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_366
{ "fields": [ { "declarator": "nettyByteBufLeakHelper = new NettyByteBufLeakHelper()", "modifier": "private", "original_string": "private NettyByteBufLeakHelper nettyByteBufLeakHelper = new NettyByteBufLeakHelper();", "type": "NettyByteBufLeakHelper", "var_name": "nettyByteBufLeakHel...
{ "body": "@Test\n public void closeTest() {\n // request is keep-alive by default.\n HttpRequest request = createRequestWithHeaders(HttpMethod.GET, TestingUri.Close.toString());\n EmbeddedChannel channel = createEmbeddedChannel();\n channel.writeInbound(request);\n\n HttpResponse response = (HttpResp...
{ "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 close() {\n close(new ClosedChannelException());\n }", "class_method_signature": "NettyResponseChannel.close()", "constructor": false, "full_signature": "@Override public void close()", "identifier": "close", "invocations": [ "close" ], "modifiers": "@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_69
{ "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 invalidReserveFileDirTest() throws Exception {\n assertTrue(\"Could not create file\", reserveFileDir.createNewFile());\n alloc = constructAllocator();\n // Should still allow allocation of non-pooled files before init.\n File f1 = allocateAndVerify(storeId0, \"file1\", 5, ...
{ "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_223
{ "fields": [ { "declarator": "FRONTEND_CONFIG = new FrontendConfig(new VerifiableProperties(new Properties()))", "modifier": "private static final", "original_string": "private static final FrontendConfig FRONTEND_CONFIG = new FrontendConfig(new VerifiableProperties(new Properties()));", ...
{ "body": "@Test\n public void postProcessQuotaManagerTest() throws Exception {\n QuotaManager quotaManager = Mockito.mock(QuotaManager.class);\n AmbrySecurityService ambrySecurityService =\n new AmbrySecurityService(new FrontendConfig(new VerifiableProperties(new Properties())),\n new Fronte...
{ "fields": [ { "declarator": "OPERATIONS = Collections.unmodifiableSet(\n Utils.getStaticFieldValuesAsStrings(Operations.class)\n .collect(Collectors.toCollection(() -> new TreeSet<>(String.CASE_INSENSITIVE_ORDER))))", "modifier": "static final", "original_string": "static final S...
{ "body": "@Override\n public void postProcessRequest(RestRequest restRequest, Callback<Void> callback) {\n Exception exception = null;\n frontendMetrics.securityServicePostProcessRequestRate.mark();\n long startTimeMs = System.currentTimeMillis();\n if (!isOpen) {\n exception = new RestServiceExcep...
{ "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_86
{ "fields": [ { "declarator": "STORE_KEY_FACTORY", "modifier": "private static final", "original_string": "private static final StoreKeyFactory STORE_KEY_FACTORY;", "type": "StoreKeyFactory", "var_name": "STORE_KEY_FACTORY" }, { "declarator": "tempDir", "modifier"...
{ "body": "@Test\n public void storeMessageReadSetTest() throws IOException, StoreException {\n int logCapacity = 2000;\n int segCapacity = 1000;\n Log log = new Log(tempDir.getAbsolutePath(), logCapacity, StoreTestUtils.DEFAULT_DISK_SPACE_ALLOCATOR,\n createStoreConfig(segCapacity, setFilePermission...
{ "fields": [ { "declarator": "readOptions", "modifier": "private final", "original_string": "private final List<BlobReadOptions> readOptions;", "type": "List<BlobReadOptions>", "var_name": "readOptions" }, { "declarator": "logger = LoggerFactory.getLogger(StoreMessageR...
{ "body": "StoreMessageReadSet(List<BlobReadOptions> readOptions) {\n Collections.sort(readOptions);\n this.readOptions = readOptions;\n }", "class_method_signature": "StoreMessageReadSet.StoreMessageReadSet(List<BlobReadOptions> readOptions)", "constructor": true, "full_signature": " StoreMessageReadSe...
{ "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_389
{ "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 testWakeup() {\n Assert.assertFalse(\"Selector should not have been woken up at this point\", selector.getAndClearWokenUpStatus());\n networkClient.wakeup();\n Assert.assertTrue(\"Selector should have been woken up at this point\", selector.getAndClearWokenUpStatus());\n }", ...
{ "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 void wakeup() {\n selector.wakeup();\n }", "class_method_signature": "SocketNetworkClient.wakeup()", "constructor": false, "full_signature": "@Override public void wakeup()", "identifier": "wakeup", "invocations": [ "wakeup" ], "modifiers": "@Override public", "p...
{ "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_370
{ "fields": [ { "declarator": "GENERATED_CONTENT_SIZE = 10240", "modifier": "private static final", "original_string": "private static final int GENERATED_CONTENT_SIZE = 10240;", "type": "int", "var_name": "GENERATED_CONTENT_SIZE" }, { "declarator": "GENERATED_CONTENT_P...
{ "body": "@Test\n public void conversionWithGoodInputTest() throws RestServiceException, CertificateException, SSLException {\n // headers\n HttpHeaders headers = new DefaultHttpHeaders(false);\n headers.add(HttpHeaderNames.CONTENT_LENGTH, new Random().nextInt(Integer.MAX_VALUE));\n headers.add(\"header...
{ "fields": [ { "declarator": "bufferWatermark = -1", "modifier": "static", "original_string": "static int bufferWatermark = -1;", "type": "int", "var_name": "bufferWatermark" }, { "declarator": "CLOSED_CHANNEL_EXCEPTION = new ClosedChannelException()", "modifier"...
{ "body": "@Override\n public String toString() {\n return request.toString();\n }", "class_method_signature": "NettyRequest.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [ "toString" ], "modifiers": "@Overrid...
{ "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_90
{ "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 concurrentTtlUpdateTest() throws Exception {\n int extraBlobCount = 2000 / PUT_RECORD_SIZE + 1;\n List<MockId> ids = put(extraBlobCount, PUT_RECORD_SIZE, expiresAtMs);\n List<TtlUpdater> ttlUpdaters = new ArrayList<>();\n for (MockId id : ids) {\n ttlUpdaters.add(new T...
{ "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_235
{ "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 testUpdateRecordV1() throws IOException, MessageFormatException {\n // Test update V1 record\n // irrespective of what values are set for acccountId, containerId and updateTimeMs, legacy values will be returned\n // with Update_Format_V1\n short accountId = Utils.getRandomS...
{ "fields": [ { "declarator": "Version_Field_Size_In_Bytes = 2", "modifier": "public static final", "original_string": "public static final int Version_Field_Size_In_Bytes = 2;", "type": "int", "var_name": "Version_Field_Size_In_Bytes" }, { "declarator": "Crc_Size = 8",...
{ "body": "public static UpdateRecord deserializeUpdateRecord(InputStream stream) throws IOException, MessageFormatException {\n CrcInputStream crcStream = new CrcInputStream(stream);\n DataInputStream inputStream = new DataInputStream(crcStream);\n short version = inputStream.readShort();\n switch (versi...
{ "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_327
{ "fields": [ { "declarator": "serverSecurityService =\n new AmbryServerSecurityService(new ServerConfig(new VerifiableProperties(new Properties())),\n new ServerMetrics(new MetricRegistry(), AmbryRequests.class, AmbryServer.class))", "modifier": "private final", "original_string":...
{ "body": "@Test\n public void validateRequestTest() throws Exception {\n //request is null\n TestUtils.assertException(IllegalArgumentException.class, () -> serverSecurityService.validateRequest(\n null).get(), null);\n\n //success case\n RestRequest request = new MockRestRequest(MockRestRequest....
{ "fields": [ { "declarator": "isOpen", "modifier": "private", "original_string": "private boolean isOpen;", "type": "boolean", "var_name": "isOpen" }, { "declarator": "serverConfig", "modifier": "private final", "original_string": "private final ServerConfi...
{ "body": "@Override\n public void validateRequest(RestRequest restRequest, Callback<Void> callback) {\n Exception exception = null;\n serverMetrics.securityServiceValidateRequestRate.mark();\n if (!isOpen) {\n exception = new RestServiceException(\"ServerSecurityService is closed\", RestServiceErrorCo...
{ "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_28
{ "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 testAccountModifyNotification() throws Exception {\n // Load initial accounts\n generateAccountJsonFile((short) 100, (short) 0, DEFAULT_SEED_1);\n accountService.processAccountJsonFile();\n\n // Register listeners\n Set<Account> notificationsReceived = new HashSet<>();\n...
{ "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_262
{ "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 getLongHeaderTest() throws RestServiceException {\n Map<String, Object> args = new HashMap<>();\n args.put(\"HeaderA\", 1000L);\n args.put(\"HeaderB\", \"NotLong\");\n args.put(\"HeaderC\", \"10000\");\n // getLongHeader() calls getHeader() and in the interest of keeping...
{ "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 Long getLongHeader(Map<String, ?> args, String header, boolean required) throws RestServiceException {\n return getNumericalHeader(args, header, required, Long::parseLong);\n }", "class_method_signature": "RestUtils.getLongHeader(Map<String, ?> args, String header, boolean required)", ...
{ "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_219
{ "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 submitResponseTest() throws JSONException, UnsupportedEncodingException, URISyntaxException {\n String exceptionMsg = TestUtils.getRandomString(10);\n responseHandler.shutdown();\n // handleResponse of FrontendTestResponseHandler throws exception because it has been shutdown.\...
{ "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": "void submitResponse(RestRequest restRequest, RestResponseChannel restResponseChannel,\n ReadableStreamChannel responseBody, Exception exception) {\n try {\n if (restRequest.getArgs().containsKey(InternalKeys.SEND_TRACKING_INFO) && (Boolean) restRequest.getArgs()\n .get(InternalKeys.SE...
{ "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_53
{ "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 updateInstanceConfigFailureTest() throws Exception {\n generateConfigs(true, true);\n MockDataNodeId localNode = clusterMap.getDataNodes().get(0);\n List<ReplicaId> localReplicas = clusterMap.getReplicaIds(localNode);\n MockClusterParticipant mockHelixParticipant = new Mock...
{ "fields": [ { "declarator": "partitionToDiskManager = new ConcurrentHashMap<>()", "modifier": "protected final", "original_string": "protected final ConcurrentHashMap<PartitionId, DiskManager> partitionToDiskManager = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<PartitionId, D...
{ "body": "public void start() throws InterruptedException {\n long startTimeMs = time.milliseconds();\n try {\n logger.info(\"Starting storage manager\");\n List<Thread> startupThreads = new ArrayList<>();\n for (final DiskManager diskManager : diskToDiskManager.values()) {\n Thread threa...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_130
{ "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 testDeleteAfterPartialCompaction() throws Exception {\n BlobStorageException ex = mockStorageException(BlobErrorCode.BLOB_NOT_FOUND);\n when(mockBlockBlobClient.getPropertiesWithResponse(any(), any(), any())).thenThrow(ex);\n // Rig Cosmos to return us a deleted blob on read r...
{ "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 boolean deleteBlob(BlobId blobId, long deletionTime, short lifeVersion,\n CloudUpdateValidator cloudUpdateValidator) throws CloudStorageException {\n Map<String, Object> updateFields = new HashMap<>();\n // TODO Frontend support needs to handle the special case of life versio...
{ "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_188
{ "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 testBadBlobId() throws Exception {\n router = getNonBlockingRouter();\n setOperationParams(CHUNK_SIZE, new GetBlobOptionsBuilder().build());\n String[] badBlobIds = {\"\", \"abc\", \"123\", \"invalid_id\", \"[],/-\"};\n for (String blobId : badBlobIds) {\n for (GetBlob...
{ "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_167
{ "fields": [ { "declarator": "random = new Random()", "modifier": "", "original_string": "Random random = new Random();", "type": "Random", "var_name": "random" }, { "declarator": "clusterMap", "modifier": "", "original_string": "ClusterMap clusterMap;", ...
{ "body": "@Test\n public void testSystemHealthErrorInterpretation() {\n for (RouterErrorCode errorCode : RouterErrorCode.values()) {\n switch (errorCode) {\n case InvalidBlobId:\n case InvalidPutArgument:\n case BlobTooLarge:\n case BadInputChannel:\n case BlobDeleted:\n ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(RouterUtils.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(RouterUtils.class);", "type": "Logger", "var_name": "logger" } ], "file": ...
{ "body": "static boolean isSystemHealthError(Exception exception) {\n boolean isSystemHealthError = true;\n boolean isInternalError = false;\n if (exception instanceof RouterException) {\n RouterErrorCode routerErrorCode = ((RouterException) exception).getErrorCode();\n switch (routerErrorCode) {\...
{ "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_258
{ "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 buildGetBlobOptionsTest() throws RestServiceException {\n // no range\n doBuildGetBlobOptionsTest(null, null, true, true);\n // valid ranges\n doBuildGetBlobOptionsTest(\"bytes=0-7\", ByteRanges.fromOffsetRange(0, 7), true, false, true);\n doBuildGetBlobOptionsTest(\"byt...
{ "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 GetBlobOptions buildGetBlobOptions(Map<String, Object> args, SubResource subResource,\n GetOption getOption, int blobSegmentIdx) throws RestServiceException {\n String rangeHeaderValue = getHeader(args, Headers.RANGE, false);\n if (subResource != null && !subResource.equals(SubReso...
{ "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_12
{ "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 testUpdateContainer() throws Exception {\n assumeTrue(!useNewZNodePath);\n accountService = mockHelixAccountServiceFactory.getAccountService();\n assertEquals(\"The number of account in HelixAccountService is incorrect\", 0,\n accountService.getAllAccounts().size());\n ...
{ "fields": [ { "declarator": "ACCOUNT_METADATA_CHANGE_TOPIC = \"account_metadata_change_topic\"", "modifier": "static final", "original_string": "static final String ACCOUNT_METADATA_CHANGE_TOPIC = \"account_metadata_change_topic\";", "type": "String", "var_name": "ACCOUNT_METADATA_...
{ "body": "@Override\n public boolean updateAccounts(Collection<Account> accounts) {\n return updateAccountsWithAccountMetadataStore(accounts, accountMetadataStore);\n }", "class_method_signature": "HelixAccountService.updateAccounts(Collection<Account> accounts)", "constructor": false, "full_signature": "...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_171
{ "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 testResponseWithNullRequestInfo() throws Exception {\n Properties props = getNonBlockingRouterProperties(\"DC1\");\n VerifiableProperties verifiableProperties = new VerifiableProperties((props));\n RouterConfig routerConfig = new RouterConfig(verifiableProperties);\n router...
{ "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_45
{ "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 testWithLowIndexEntries() throws InterruptedException, StoreException, IOException {\n state.destroy();\n assertTrue(tempDir.getAbsolutePath() + \" could not be deleted\", StoreTestUtils.cleanDirectory(tempDir, true));\n tempDir = StoreTestUtils.createTempDirectory(\"blobStore...
{ "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_126
{ "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 testDownloadBlobException() throws Exception {\n BlobStorageException ex = mockStorageException(BlobErrorCode.INTERNAL_ERROR);\n doThrow(ex).when(mockBlockBlobClient).downloadWithResponse(any(), any(), any(), any(), anyBoolean(), any(), any());\n expectCloudStorageException(()...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(AzureCloudDestination.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(AzureCloudDestination.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "@Override\n public void downloadBlob(BlobId blobId, OutputStream outputStream) throws CloudStorageException {\n try {\n azureBlobDataAccessor.downloadBlob(blobId, outputStream);\n } catch (Exception e) {\n throw toCloudStorageException(\"Error downloading blob \" + blobId, e);\n }\n }"...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_151
{ "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 handleDeleteRequest() throws IOException, InterruptedException {\n try {\n vcrRequests.handleDeleteRequest(request);\n Assert.fail(\"handleDeleteRequest should throw UnsupportedOperationException\");\n } catch (UnsupportedOperationException ex) {\n }\n }", "class_...
{ "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 public void handleDeleteRequest(NetworkRequest request) throws IOException, InterruptedException {\n throw new UnsupportedOperationException(\"Request type not supported\");\n }", "class_method_signature": "VcrRequests.handleDeleteRequest(NetworkRequest request)", "constructor": false,...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_297
{ "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 newSchedulerTest() throws Exception {\n ScheduledExecutorService scheduler = Utils.newScheduler(2, false);\n Future<String> future = scheduler.schedule(new Callable<String>() {\n @Override\n public String call() {\n return Thread.currentThread().getName();\n ...
{ "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 ScheduledExecutorService newScheduler(int numThreads, String threadNamePrefix, boolean isDaemon) {\n ScheduledThreadPoolExecutor scheduler =\n new ScheduledThreadPoolExecutor(numThreads, new SchedulerThreadFactory(threadNamePrefix, isDaemon));\n scheduler.setContinueExistingPerio...
{ "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_32
{ "fields": [ { "declarator": "accountId = 101", "modifier": "private final", "original_string": "private final short accountId = 101;", "type": "short", "var_name": "accountId" }, { "declarator": "containerId = 1", "modifier": "private final", "original_str...
{ "body": "@Test\n public void testGetContainersForAccount() throws Exception {\n List<Container> containerList = containerDao.getContainers(accountId);\n assertEquals(1, containerList.size());\n assertEquals(testContainer, containerList.get(0));\n }", "class_method_signature": "ContainerDaoTest.testGetC...
{ "fields": [ { "declarator": "CONTAINER_TABLE = \"Containers\"", "modifier": "public static final", "original_string": "public static final String CONTAINER_TABLE = \"Containers\";", "type": "String", "var_name": "CONTAINER_TABLE" }, { "declarator": "ACCOUNT_ID = \"acc...
{ "body": "public List<Container> getContainers(int accountId) throws SQLException {\n PreparedStatement getByAccountStatement = dataAccessor.getPreparedStatement(getByAccountSql);\n getByAccountStatement.setInt(1, accountId);\n try (ResultSet rs = getByAccountStatement.executeQuery()) {\n return conver...
{ "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_278
{ "fields": [], "file": "ambry-utils/src/test/java/com/github/ambry/utils/CachedHistogramTest.java", "identifier": "CachedHistogramTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCache() {\n AtomicInteger snapshotCalls = new AtomicInteger(0);\n MockClock clock = new MockClock();\n Reservoir reservoir = new ExponentiallyDecayingReservoir();\n CachedHistogram histogram = new CachedHistogram(clock, reservoir, TimeUnit.SECONDS.toMillis(1), 0.50) {\n...
{ "fields": [ { "declarator": "cache", "modifier": "private final", "original_string": "private final CachedGauge<Double> cache;", "type": "CachedGauge<Double>", "var_name": "cache" } ], "file": "ambry-utils/src/main/java/com/github/ambry/utils/CachedHistogram.java", "ident...
{ "body": "public double getCachedValue() {\n return cache.getValue();\n }", "class_method_signature": "CachedHistogram.getCachedValue()", "constructor": false, "full_signature": "public double getCachedValue()", "identifier": "getCachedValue", "invocations": [ "getValue" ], "modifiers": "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_106
{ "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 testDownload() throws Exception {\n downloadBlob(blobId);\n assertEquals(1, azureMetrics.blobDownloadRequestCount.getCount());\n assertEquals(1, azureMetrics.blobDownloadSuccessCount.getCount());\n assertEquals(0, azureMetrics.blobDownloadErrorCount.getCount());\n assert...
{ "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": "public void downloadBlob(BlobId blobId, OutputStream outputStream) throws BlobStorageException {\n azureMetrics.blobDownloadRequestCount.inc();\n Timer.Context storageTimer = azureMetrics.blobDownloadTime.time();\n try {\n BlobLayout blobLayout = blobLayoutStrategy.getDataBlobLayout(blobId);\...
{ "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_65
{ "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 concurrencyTest() throws Exception {\n alloc = constructAllocator();\n List<DiskSpaceRequirements> requirementsList = new ArrayList<>();\n requirementsList.add(new DiskSpaceRequirements(storeId0, 10, 500, 1));\n requirementsList.add(new DiskSpaceRequirements(storeId1, 5, 25...
{ "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...