id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
13870893_293
{ "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 testDeserializeString() {\n String randomString = TestUtils.getRandomString(10);\n ByteBuffer outputBuffer = ByteBuffer.allocate(4 + randomString.getBytes().length);\n Utils.serializeString(outputBuffer, randomString, StandardCharsets.US_ASCII);\n outputBuffer.flip();\n ...
{ "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 String deserializeString(ByteBuffer inputBuffer, Charset charset) {\n int size = inputBuffer.getInt();\n byte[] value = new byte[size];\n inputBuffer.get(value);\n return new String(value, charset);\n }", "class_method_signature": "Utils.deserializeString(ByteBuffer inputBuffer...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_155
{ "fields": [ { "declarator": "SMALL_BLOB_SIZE = 100", "modifier": "private static final", "original_string": "private static final int SMALL_BLOB_SIZE = 100;", "type": "int", "var_name": "SMALL_BLOB_SIZE" }, { "declarator": "isVcr", "modifier": "private final", ...
{ "body": "@Test\n public void testFindMissingKeys() throws Exception {\n setupCloudStore(false, true, defaultCacheLimit, true);\n int count = 10;\n List<StoreKey> keys = new ArrayList<>();\n Map<String, CloudBlobMetadata> metadataMap = new HashMap<>();\n for (int j = 0; j < count; j++) {\n // Bl...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(CloudBlobStore.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(CloudBlobStore.class);", "type": "Logger", "var_name": "logger" }, { ...
{ "body": "@Override\n public Set<StoreKey> findMissingKeys(List<StoreKey> keys) throws StoreException {\n checkStarted();\n // Check existence of keys in cloud metadata\n // Note that it is ok to refer cache here, because all we are doing is eliminating blobs that were seen before and\n // we don't care...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_122
{ "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 testDelete() throws Exception {\n mockBlobExistence(true);\n assertTrue(\"Expected success\", azureDest.deleteBlob(blobId, deletionTime, (short) 0, dummyCloudUpdateValidator));\n assertEquals(1, azureMetrics.blobUpdatedCount.getCount());\n assertEquals(0, azureMetrics.blobU...
{ "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_41
{ "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 testValidDataSizeAfterDeletes() throws StoreException, IOException {\n assumeTrue(!bucketingEnabled);\n BlobStoreStats blobStoreStats = setupBlobStoreStats(0, 0);\n int numEntries =\n state.getMaxInMemElements() - state.referenceIndex.lastEntry().getValue().size() + sta...
{ "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_175
{ "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 nodeLevelAdaptiveTrackerTest() throws Exception {\n // Mock a simple partition layout for this test: Partition1 has two replicas, one on LocalHost1 and the other on RemoteHost1;\n // Similarly, Partition2 has two replicas, one on LocalHost2 and the other on RemoteHost1.\n Mock...
{ "fields": [ { "declarator": "routerConfig", "modifier": "private final", "original_string": "private final RouterConfig routerConfig;", "type": "RouterConfig", "var_name": "routerConfig" }, { "declarator": "routerMetrics", "modifier": "private final", "ori...
{ "body": "@Override\n public void onResponse(ReplicaId replicaId, TrackedRequestFinalState trackedRequestFinalState) {\n super.onResponse(replicaId, trackedRequestFinalState);\n long elapsedTime;\n if (unexpiredRequestSendTimes.containsKey(replicaId)) {\n elapsedTime = time.milliseconds() - unexpiredR...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_319
{ "fields": [ { "declarator": "NEW_PARTITION_NAME = \"12\"", "modifier": "private static final", "original_string": "private static final String NEW_PARTITION_NAME = \"12\";", "type": "String", "var_name": "NEW_PARTITION_NAME" }, { "declarator": "CLOUD_DC_NAME = \"Cloud...
{ "body": "@Test\n public void cloudReplicaRemovalTest() throws Exception {\n StorageManager storageManager =\n new StorageManager(storeConfig, new DiskManagerConfig(verifiableProperties), Utils.newScheduler(1, true),\n clusterMap.getMetricRegistry(), null, clusterMap, currentNode, null,\n ...
{ "fields": [ { "declarator": "clusterMapConfig", "modifier": "private final", "original_string": "private final ClusterMapConfig clusterMapConfig;", "type": "ClusterMapConfig", "var_name": "clusterMapConfig" }, { "declarator": "storeConfig", "modifier": "private ...
{ "body": "@Override\n public void start() {\n // Add listener for vcr instance config changes\n vcrClusterSpectator.registerInstanceConfigChangeListener(new InstanceConfigChangeListenerImpl());\n vcrClusterSpectator.registerLiveInstanceChangeListener(new LiveInstanceChangeListenerImpl());\n\n // Add lis...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_16
{ "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 testUpdateDuplicateAccounts() throws Exception {\n accountService = mockHelixAccountServiceFactory.getAccountService();\n List<Account> conflictAccounts = new ArrayList<>();\n conflictAccounts.add(new AccountBuilder((short) 1, \"a\", AccountStatus.INACTIVE).build());\n conf...
{ "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_163
{ "fields": [ { "declarator": "DEFAULT_PARALLELISM = 3", "modifier": "private static final", "original_string": "private static final int DEFAULT_PARALLELISM = 3;", "type": "int", "var_name": "DEFAULT_PARALLELISM" }, { "declarator": "MAX_PORTS_PLAIN_TEXT = 3", "mo...
{ "body": "@Test\n public void duplicateBlobIdsTest() throws RouterException {\n blobIds.add(blobIds.get(0));\n try {\n undeleteManager.submitUndeleteOperation(blobIds, UNDELETE_SERVICE_ID, new FutureResult<>(), null);\n fail(\"Should have failed to submit operation because the provided blob id list ...
{ "fields": [ { "declarator": "clusterMap", "modifier": "private final", "original_string": "private final ClusterMap clusterMap;", "type": "ClusterMap", "var_name": "clusterMap" }, { "declarator": "notificationSystem", "modifier": "private final", "original...
{ "body": "void submitUndeleteOperation(Collection<String> blobIdStrs, String serviceId, FutureResult<Void> futureResult,\n Callback<Void> callback) throws RouterException {\n if (!isOpen()) {\n throw new IllegalStateException(\"UndeleteManager is closed\");\n }\n List<BlobId> blobIds = new ArrayLi...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_134
{ "fields": [], "file": "ambry-cloud/src/test/java/com/github/ambry/cloud/azure/CosmosUpdateTimeFindTokenFactoryTest.java", "identifier": "CosmosUpdateTimeFindTokenFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getNewFindTokenTest() {\n CosmosUpdateTimeFindToken cosmosUpdateTimeFindToken1 =\n (CosmosUpdateTimeFindToken) new CosmosUpdateTimeFindTokenFactory().getNewFindToken();\n CosmosUpdateTimeFindToken cosmosUpdateTimeFindToken2 = new CosmosUpdateTimeFindToken();\n assertEqu...
{ "fields": [], "file": "ambry-cloud/src/main/java/com/github/ambry/cloud/azure/CosmosUpdateTimeFindTokenFactory.java", "identifier": "CosmosUpdateTimeFindTokenFactory", "interfaces": "implements FindTokenFactory", "methods": [ { "class_method_signature": "CosmosUpdateTimeFindTokenFactory.getFindTok...
{ "body": "@Override\n public FindToken getNewFindToken() {\n return new CosmosUpdateTimeFindToken();\n }", "class_method_signature": "CosmosUpdateTimeFindTokenFactory.getNewFindToken()", "constructor": false, "full_signature": "@Override public FindToken getNewFindToken()", "identifier": "getNewFindToke...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_358
{ "fields": [ { "declarator": "clusterMapConfig", "modifier": "private final", "original_string": "private final ClusterMapConfig clusterMapConfig;", "type": "ClusterMapConfig", "var_name": "clusterMapConfig" }, { "declarator": "folder = new TemporaryFolder()", "m...
{ "body": "@Test\n public void onReplicaEventTest() {\n TestHardwareLayout testHardwareLayout = new TestHardwareLayout(\"Alpha\");\n TestPartitionLayout testPartitionLayout = new TestPartitionLayout(testHardwareLayout, null);\n ClusterMap clusterMapManager =\n (new StaticClusterAgentsFactory(clusterM...
{ "fields": [ { "declarator": "hardwareLayout", "modifier": "protected final", "original_string": "protected final HardwareLayout hardwareLayout;", "type": "HardwareLayout", "var_name": "hardwareLayout" }, { "declarator": "partitionLayout", "modifier": "protected ...
{ "body": "@Override\n public void onReplicaEvent(ReplicaId replicaId, ReplicaEventType event) {\n if (replicaId instanceof Replica) {\n switch (event) {\n case Disk_Error:\n if (replicaId.getReplicaType() == ReplicaType.DISK_BACKED) {\n ((Disk) replicaId.getDiskId()).onDiskError()...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_57
{ "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 shutdownBlobStoreTest() 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 in...
{ "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 shutdownBlobStore(PartitionId id) {\n DiskManager diskManager = partitionToDiskManager.get(id);\n return diskManager != null && diskManager.shutdownBlobStore(id);\n }", "class_method_signature": "StorageManager.shutdownBlobStore(PartitionId id)", "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_266
{ "fields": [], "file": "ambry-api/src/test/java/com/github/ambry/router/GetBlobOptionsTest.java", "identifier": "GetBlobOptionsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOperationTypeOption() {\n GetBlobOptions options = new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.BlobInfo).build();\n assertEquals(\"OperationType from options not as expected.\", GetBlobOptions.OperationType.BlobInfo,\n options.getOperationTyp...
{ "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 OperationType getOperationType() {\n return operationType;\n }", "class_method_signature": "GetBlobOptions.getOperationType()", "constructor": false, "full_signature": "public OperationType getOperationType()", "identifier": "getOperationType", "invocations": [], "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_323
{ "fields": [], "file": "ambry-server/src/test/java/com/github/ambry/server/AmbryServerSecurityServiceFactoryTest.java", "identifier": "AmbryServerSecurityServiceFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getAmbrySecurityServiceFactoryTest() throws Exception {\n ServerSecurityService serverSecurityService =\n new AmbryServerSecurityServiceFactory(new VerifiableProperties(new Properties()),\n null, null).getServerSecurityService();\n Assert.assertNotNull(serverSec...
{ "fields": [ { "declarator": "serverConfig", "modifier": "private final", "original_string": "private final ServerConfig serverConfig;", "type": "ServerConfig", "var_name": "serverConfig" }, { "declarator": "serverMetrics", "modifier": "private final", "ori...
{ "body": "@Override\n public ServerSecurityService getServerSecurityService() throws InstantiationException {\n return new AmbryServerSecurityService(serverConfig, serverMetrics);\n }", "class_method_signature": "AmbryServerSecurityServiceFactory.getServerSecurityService()", "constructor": false, "full_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_289
{ "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 testReadFileToByteBuffer() throws IOException {\n File file = File.createTempFile(\"test\", \"1\");\n file.deleteOnExit();\n FileChannel fileChannel = Utils.openChannel(file, false);\n byte[] referenceBytes = new byte[20];\n new Random().nextBytes(referenceBytes);\n F...
{ "fields": [ { "declarator": "Infinite_Time = -1", "modifier": "public static final", "original_string": "public static final long Infinite_Time = -1;", "type": "long", "var_name": "Infinite_Time" }, { "declarator": "MIN_PORT_NUM = 1", "modifier": "public static ...
{ "body": "public static int readFileToByteBuffer(FileChannel fileChannel, long offset, ByteBuffer buffer) throws IOException {\n int ioCount = 0;\n int read = 0;\n int expectedRead = buffer.remaining();\n while (buffer.hasRemaining()) {\n int sizeRead = fileChannel.read(buffer, offset);\n if (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_118
{ "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 testPurge() throws Exception {\n assertEquals(\"Expected success\", numBlobsPerQuery, azureStorageCompactor.purgeBlobs(blobMetadataList));\n assertEquals(numBlobsPerQuery, azureMetrics.blobDeletedCount.getCount());\n assertEquals(0, azureMetrics.blobDeleteErrorCount.getCount()...
{ "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_231
{ "fields": [ { "declarator": "CLUSTER_MAP", "modifier": "private static final", "original_string": "private static final ClusterMap CLUSTER_MAP;", "type": "ClusterMap", "var_name": "CLUSTER_MAP" }, { "declarator": "getReplicasHandler", "modifier": "private static...
{ "body": "@Test\n public void getReplicasWithBadInputTest() {\n // bad input - invalid blob id.\n try {\n getReplicasHandler.getReplicas(\"12345\", new MockRestResponseChannel());\n fail(\"Exception should have been thrown because the blobid is invalid\");\n } catch (RestServiceException e) {\n ...
{ "fields": [ { "declarator": "REPLICAS_KEY = \"replicas\"", "modifier": "static", "original_string": "static String REPLICAS_KEY = \"replicas\";", "type": "String", "var_name": "REPLICAS_KEY" }, { "declarator": "metrics", "modifier": "private final", "origi...
{ "body": "ReadableStreamChannel getReplicas(String blobId, RestResponseChannel restResponseChannel)\n throws RestServiceException {\n logger.trace(\"Getting replicas of blob ID - {}\", blobId);\n long startTime = System.currentTimeMillis();\n ReadableStreamChannel channel = null;\n try {\n chan...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_94
{ "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 ttlUpdateErrorCasesTest() throws Exception {\n // ID that does not exist\n verifyTtlUpdateFailure(getUniqueId(), Utils.Infinite_Time, StoreErrorCodes.ID_Not_Found);\n // ID that has expired\n MockId expiredId = null;\n for (MockId expired : expiredKeys) {\n verifyTt...
{ "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 updateTtl(List<MessageInfo> infosToUpdate) throws StoreException {\n checkStarted();\n checkDuplicates(infosToUpdate);\n final Timer.Context context = metrics.ttlUpdateResponse.time();\n try {\n List<IndexValue> indexValuesToUpdate = new ArrayList<>();\n List<...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_374
{ "fields": [ { "declarator": "serverState", "modifier": "private final", "original_string": "private final RestServerState serverState;", "type": "RestServerState", "var_name": "serverState" }, { "declarator": "healthCheckUri = \"/healthCheck\"", "modifier": "pri...
{ "body": "@Test\n public void testRestServerState() {\n Assert.assertEquals(\"Health check Uri mismatch \", healthCheckUri, serverState.getHealthCheckUri());\n Assert.assertFalse(\"Service should be down by default \", serverState.isServiceUp());\n serverState.markServiceUp();\n Assert.assertTrue(\"Serv...
{ "fields": [ { "declarator": "serviceUp = false", "modifier": "private volatile", "original_string": "private volatile boolean serviceUp = false;", "type": "boolean", "var_name": "serviceUp" }, { "declarator": "healthCheckUri", "modifier": "private final", ...
{ "body": "public RestServerState(String healthCheckUri) {\n this.healthCheckUri = healthCheckUri;\n }", "class_method_signature": "RestServerState.RestServerState(String healthCheckUri)", "constructor": true, "full_signature": "public RestServerState(String healthCheckUri)", "identifier": "RestServerSta...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_82
{ "fields": [], "file": "ambry-store/src/test/java/com/github/ambry/store/LogSegmentNameHelperTest.java", "identifier": "LogSegmentNameHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void nameFromFilenameTest() {\n assertEquals(\"Did not get expected name\", \"\", LogSegmentNameHelper.nameFromFilename(\"log_current\"));\n String name = LogSegmentNameHelper.getName(0, 0);\n String filename = LogSegmentNameHelper.nameToFilename(name);\n assertEquals(\"Did not ...
{ "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 nameFromFilename(String filename) {\n if (filename.equals(SINGLE_SEGMENT_LOG_FILE_NAME)) {\n return \"\";\n }\n if (!filename.endsWith(SUFFIX)) {\n throw new IllegalArgumentException(\"The filename of the log segment does not end with [\" + SUFFIX + \"]\");\n }\n Stri...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_227
{ "fields": [], "file": "ambry-frontend/src/test/java/com/github/ambry/frontend/AmbryIdConverterFactoryTest.java", "identifier": "AmbryIdConverterFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void ambryIdConverterTest() throws Exception {\n // dud properties. server should pick up defaults\n Properties properties = new Properties();\n VerifiableProperties verifiableProperties = new VerifiableProperties(properties);\n IdSigningService idSigningService = mock(IdSigning...
{ "fields": [ { "declarator": "idSigningService", "modifier": "private final", "original_string": "private final IdSigningService idSigningService;", "type": "IdSigningService", "var_name": "idSigningService" }, { "declarator": "frontendMetrics", "modifier": "priv...
{ "body": "@Override\n public IdConverter getIdConverter() {\n return new AmbryIdConverter(idSigningService, frontendMetrics);\n }", "class_method_signature": "AmbryIdConverterFactory.getIdConverter()", "constructor": false, "full_signature": "@Override public IdConverter getIdConverter()", "identifier":...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_362
{ "fields": [ { "declarator": "nettyByteBufLeakHelper = new NettyByteBufLeakHelper()", "modifier": "private", "original_string": "private NettyByteBufLeakHelper nettyByteBufLeakHelper = new NettyByteBufLeakHelper();", "type": "NettyByteBufLeakHelper", "var_name": "nettyByteBufLeakHel...
{ "body": "@Test\n public void setRequestTest() {\n HttpRequest request = createRequestWithHeaders(HttpMethod.GET, TestingUri.SetRequest.toString());\n HttpUtil.setKeepAlive(request, false);\n EmbeddedChannel channel = createEmbeddedChannel();\n channel.writeInbound(request);\n\n HttpResponse response...
{ "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": "void setRequest(NettyRequest request) {\n if (request != null) {\n if (this.request == null) {\n this.request = request;\n HttpUtil.setKeepAlive(responseMetadata, request.isKeepAlive());\n } else {\n throw new IllegalStateException(\n \"Request has already been ...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_159
{ "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 testEncryptionFailure() throws InterruptedException, GeneralSecurityException {\n cryptoJobHandler.close();\n MockCryptoService mockCryptoService = new MockCryptoService(new CryptoServiceConfig(verifiableProperties));\n mockCryptoService.exceptionOnEncryption.set(\n new...
{ "fields": [ { "declarator": "enabled = new AtomicBoolean(false)", "modifier": "private final", "original_string": "private final AtomicBoolean enabled = new AtomicBoolean(false);", "type": "AtomicBoolean", "var_name": "enabled" }, { "declarator": "CLOSED_EXCEPTION =\n...
{ "body": "public void close() {\n if (enabled.compareAndSet(true, false)) {\n List<Runnable> pendingTasks = scheduler.shutdownNow();\n for (Runnable task : pendingTasks) {\n if (task instanceof CryptoJob) {\n ((CryptoJob) task).closeJob(CLOSED_EXCEPTION);\n } else {\n log...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_270
{ "fields": [ { "declarator": "ROUND_TRIP_TIME_THRESHOLD = 500", "modifier": "private static final", "original_string": "private static final long ROUND_TRIP_TIME_THRESHOLD = 500;", "type": "long", "var_name": "ROUND_TRIP_TIME_THRESHOLD" }, { "declarator": "TIME_TO_FIRS...
{ "body": "@Test\n public void defaultPerformanceConfigTest() {\n // purposely use empty properties to make config use default value\n VerifiableProperties properties = new VerifiableProperties(new Properties());\n PerformanceConfig config = new PerformanceConfig(properties);\n for (RestMethod method : E...
{ "fields": [ { "declarator": "perfIndicesAndCriteria", "modifier": "private final", "original_string": "private final Map<PerformanceIndex, Criteria> perfIndicesAndCriteria;", "type": "Map<PerformanceIndex, Criteria>", "var_name": "perfIndicesAndCriteria" } ], "file": "ambry...
{ "body": "public Criteria getCriteria(PerformanceIndex performanceIndex) {\n return perfIndicesAndCriteria.get(performanceIndex);\n }", "class_method_signature": "Thresholds.getCriteria(PerformanceIndex performanceIndex)", "constructor": false, "full_signature": "public Criteria getCriteria(PerformanceInde...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
13870893_335
{ "fields": [ { "declarator": "metrics = new DataNodeConfigSourceMetrics(new MetricRegistry())", "modifier": "", "original_string": "DataNodeConfigSourceMetrics metrics = new DataNodeConfigSourceMetrics(new MetricRegistry());", "type": "DataNodeConfigSourceMetrics", "var_name": "metr...
{ "body": "@Test\n public void testListener() throws Exception {\n time.allowSleepCalls(0);\n DataNodeConfigChangeListener listener = mock(DataNodeConfigChangeListener.class);\n compositeSource.addDataNodeConfigChangeListener(listener);\n DataNodeConfigChangeListener primaryListener = captureRegisteredLi...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(CompositeDataNodeConfigSource.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CompositeDataNodeConfigSource.class);", "type": "Logger", "var_n...
{ "body": "@Override\n public void addDataNodeConfigChangeListener(DataNodeConfigChangeListener listener) throws Exception {\n if (recordingListenersRegistered.compareAndSet(false, true)) {\n ConfigChangeRecorder primaryListener = new ConfigChangeRecorder(listener);\n ConfigChangeRecorder secondaryListe...
{ "created": "10/25/2013 8:04:54 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 13870893, "size": null, "stargazer_count": null, "stars": 1345, "updates": "2020-01-27T22:17:59+00:00", "url": "https://github.com/linkedin/ambry...
137178358_0
{ "fields": [ { "declarator": "service", "modifier": "private", "original_string": "private DataService service;", "type": "DataService", "var_name": "service" } ], "file": "bookstore-starter-flow-backend/src/test/java/com/vaadin/samples/backend/DataServiceTest.java", "iden...
{ "body": "@Test\n public void testDataServiceCanFetchProducts() throws Exception {\n assertFalse(service.getAllProducts().isEmpty());\n }", "class_method_signature": "DataServiceTest.testDataServiceCanFetchProducts()", "constructor": false, "full_signature": "@Test public void testDataServiceCanFe...
{ "fields": [], "file": "bookstore-starter-flow-backend/src/main/java/com/vaadin/samples/backend/DataService.java", "identifier": "DataService", "interfaces": "implements Serializable", "methods": [ { "class_method_signature": "DataService.getAllProducts()", "constructor": false, "full_s...
{ "body": "public abstract Collection<Product> getAllProducts();", "class_method_signature": "DataService.getAllProducts()", "constructor": false, "full_signature": "public abstract Collection<Product> getAllProducts()", "identifier": "getAllProducts", "invocations": [], "modifiers": "public abstract", ...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 137178358, "size": 1721, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/vaadin/bookstore-starter-flow" }
137178358_1
{ "fields": [ { "declarator": "service", "modifier": "private", "original_string": "private DataService service;", "type": "DataService", "var_name": "service" } ], "file": "bookstore-starter-flow-backend/src/test/java/com/vaadin/samples/backend/DataServiceTest.java", "iden...
{ "body": "@Test\n public void testDataServiceCanFetchCategories() throws Exception {\n assertFalse(service.getAllCategories().isEmpty());\n }", "class_method_signature": "DataServiceTest.testDataServiceCanFetchCategories()", "constructor": false, "full_signature": "@Test public void testDataServic...
{ "fields": [], "file": "bookstore-starter-flow-backend/src/main/java/com/vaadin/samples/backend/DataService.java", "identifier": "DataService", "interfaces": "implements Serializable", "methods": [ { "class_method_signature": "DataService.getAllProducts()", "constructor": false, "full_s...
{ "body": "public abstract Collection<Category> getAllCategories();", "class_method_signature": "DataService.getAllCategories()", "constructor": false, "full_signature": "public abstract Collection<Category> getAllCategories()", "identifier": "getAllCategories", "invocations": [], "modifiers": "public abs...
{ "created": null, "fork": null, "fork_count": 11, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 137178358, "size": 1721, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/vaadin/bookstore-starter-flow" }
62156481_28
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testGetCipherAlgorithm_nonDefault() throws IOException, URISyntaxException {\n String cipherAlg = \"cipherAlg\";\n\n Configuration conf = new Configuration();\n conf.set(EncryptedFileSystem.CIPHER_ALGORITHM_KEY, cipherAlg);\n delegateFs = FileSystem.newIns...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@VisibleForTesting\n String getCipherAlgorithm() {\n Optional<String> cipher = Optional.ofNullable(getConf().get(CIPHER_ALGORITHM_KEY));\n Optional<String> deprecatedCipher = Optional.ofNullable(getConf().get(DEPRECATED_CIPHER_ALGORITHM_KEY));\n\n if (cipher.isPresent() && deprecate...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_4
{ "fields": [ { "declarator": "PATH = new Path(\"/dummy/path\")", "modifier": "private static final", "original_string": "private static final Path PATH = new Path(\"/dummy/path\");", "type": "Path", "var_name": "PATH" }, { "declarator": "DELEGATE_PATH = new Path(\"/del...
{ "body": "@Test\n public void rename() throws Exception {\n when(delegate.rename(DELEGATE_PATH, DELEGATE_PATH)).thenReturn(false);\n boolean success = convertingFs.rename(PATH, PATH);\n\n assertThat(success).isFalse();\n }", "class_method_signature": "PathConvertingFileSystemTest.rename(...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final FileSystem delegate;", "type": "FileSystem", "var_name": "delegate" }, { "declarator": "toFunc", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public boolean rename(Path src, Path dst) throws IOException {\n return delegate.rename(to(src), to(dst));\n }", "class_method_signature": "PathConvertingFileSystem.rename(Path src, Path dst)", "constructor": false, "full_signature": "@Override public boolean rename(Path src,...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_69
{ "fields": [ { "declarator": "EXECUTOR = MoreExecutors.directExecutor()", "modifier": "private static final", "original_string": "private static final Executor EXECUTOR = MoreExecutors.directExecutor();", "type": "Executor", "var_name": "EXECUTOR" }, { "declarator": "V...
{ "body": "@Test\n public void testGet_succeedsAfterFirstStrategy() {\n chained = new ChainedAsyncKeyStorageStrategy(EXECUTOR, successfulStrategy, failingStrategy);\n\n assertThat(chained.get(KEY).join()).isEqualTo(keyMaterial);\n\n verify(successfulStrategy).get(KEY);\n verifyNoMoreInt...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n public CompletableFuture<KeyMaterial> get(String fileKey) {\n return CompletableFuture.supplyAsync(() -> {\n List<Exception> suppressedExceptions = new ArrayList<>();\n for (AsyncKeyStorageStrategy strategy : strategies) {\n try {\n ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_12
{ "fields": [ { "declarator": "PATH = new Path(\"/dummy/path\")", "modifier": "private static final", "original_string": "private static final Path PATH = new Path(\"/dummy/path\");", "type": "Path", "var_name": "PATH" }, { "declarator": "DELEGATE_PATH = new Path(\"/del...
{ "body": "@Test\n public void getFileChecksum() throws Exception {\n when(delegate.getFileChecksum(DELEGATE_PATH)).thenReturn(fileChecksum);\n FileChecksum checksum = convertingFs.getFileChecksum(PATH);\n\n assertThat(checksum).isEqualTo(fileChecksum);\n }", "class_method_signature": "Pa...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final FileSystem delegate;", "type": "FileSystem", "var_name": "delegate" }, { "declarator": "toFunc", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public FileChecksum getFileChecksum(Path path) throws IOException {\n return fs.getFileChecksum(to(path));\n }", "class_method_signature": "PathConvertingFileSystem.getFileChecksum(Path path)", "constructor": false, "full_signature": "@Override public FileChecksum getFileChec...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_45
{ "fields": [], "file": "crypto-core/src/test/java/com/palantir/crypto2/cipher/CiphersTest.java", "identifier": "CiphersTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testProvider_ignoresUnavailable() {\n assertThat(Ciphers.getProvider(ImmutableList.of(\"Invalid\", \"SunJCE\", \"IBMJCE\"))).doesNotContain(\"Invalid\");\n }", "class_method_signature": "CiphersTest.testProvider_ignoresUnavailable()", "constructor": false, "full_signa...
{ "fields": [ { "declarator": "ACCEPTABLE_PROVIDERS = ImmutableList.of(\"SunJCE\", \"IBMJCE\")", "modifier": "private static final", "original_string": "private static final ImmutableList<String> ACCEPTABLE_PROVIDERS = ImmutableList.of(\"SunJCE\", \"IBMJCE\");", "type": "ImmutableList<Stri...
{ "body": "static String getProvider() {\n return getProvider(ACCEPTABLE_PROVIDERS);\n }", "class_method_signature": "Ciphers.getProvider()", "constructor": false, "full_signature": "static String getProvider()", "identifier": "getProvider", "invocations": [ "getProvider" ], "modifiers": "...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_53
{ "fields": [ { "declarator": "AES_CTR = AesCtrCipher.ALGORITHM", "modifier": "private static final", "original_string": "private static final String AES_CTR = AesCtrCipher.ALGORITHM;", "type": "String", "var_name": "AES_CTR" }, { "declarator": "AES_CBC = AesCbcCipher.A...
{ "body": "@Test\n public void testGetCipher_invalidName() {\n assertThatExceptionOfType(IllegalArgumentException.class)\n .isThrownBy(() -> SeekableCipherFactory.getCipher(\"doesnt_exist\"))\n .withMessage(\"No known SeekableCipher with algorithm: doesnt_exist\");\n }", "...
{ "fields": [], "file": "crypto-core/src/main/java/com/palantir/crypto2/cipher/SeekableCipherFactory.java", "identifier": "SeekableCipherFactory", "interfaces": "", "methods": [ { "class_method_signature": "SeekableCipherFactory.SeekableCipherFactory()", "constructor": true, "full_signat...
{ "body": "@Deprecated\n public static SeekableCipher getCipher(String cipherAlgorithm) {\n switch (cipherAlgorithm) {\n case AesCtrCipher.ALGORITHM:\n return getCipher(cipherAlgorithm, AesCtrCipher.generateKeyMaterial());\n case AesCbcCipher.ALGORITHM:\n ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_73
{ "fields": [ { "declarator": "EXECUTOR = MoreExecutors.directExecutor()", "modifier": "private static final", "original_string": "private static final Executor EXECUTOR = MoreExecutors.directExecutor();", "type": "Executor", "var_name": "EXECUTOR" }, { "declarator": "V...
{ "body": "@Test\n public void testDelete_fails() {\n chained = new ChainedAsyncKeyStorageStrategy(EXECUTOR, successfulStrategy, failingStrategy);\n\n assertThatExceptionOfType(IllegalArgumentException.class)\n .isThrownBy(() -> chained.remove(KEY).join());\n }", "class_method_sig...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n public CompletableFuture<Void> remove(String fileKey) {\n return applyToStrategies(strategy -> strategy.remove(fileKey));\n }", "class_method_signature": "ChainedAsyncKeyStorageStrategy.remove(String fileKey)", "constructor": false, "full_signature": "@Override public Complet...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_24
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testRename_failedRename() throws IOException {\n when(mockFs.rename(path, newPath)).thenReturn(false);\n\n boolean renamed = mockedEfs.rename(path, newPath);\n\n assertThat(renamed).isFalse();\n verify(mockKeyStore, never()).remove(path.toString());\n ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public boolean rename(Path src, Path dst) throws IOException {\n // Copy key material first so the encrypted file always has key material in the key store even if the\n // put or rename fails\n KeyMaterial keyMaterial = keyStore.get(src.toString());\n keyStore.put...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_32
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testDelete_recursiveDelete() throws IOException {\n Path folderPath = new Path(folder.getRoot().getAbsolutePath());\n\n assertThatExceptionOfType(UnsupportedOperationException.class)\n .isThrownBy(() -> efs.delete(folderPath, true))\n .with...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public boolean delete(Path path, boolean recursive) throws IOException {\n if (recursive) {\n throw new UnsupportedOperationException(\"EncryptedFileSystem does not support recursive deletes\");\n }\n keyStore.remove(path.toString());\n return fs.delete...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_8
{ "fields": [ { "declarator": "PATH = new Path(\"/dummy/path\")", "modifier": "private static final", "original_string": "private static final Path PATH = new Path(\"/dummy/path\");", "type": "Path", "var_name": "PATH" }, { "declarator": "DELEGATE_PATH = new Path(\"/del...
{ "body": "@Test\n public void getFileStatus() throws Exception {\n when(delegate.getFileStatus(DELEGATE_PATH)).thenReturn(fileStatus(DELEGATE_PATH));\n FileStatus fileStatus = convertingFs.getFileStatus(PATH);\n\n assertThat(fileStatus).isEqualTo(fileStatus(RETURN_PATH));\n }", "class_me...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final FileSystem delegate;", "type": "FileSystem", "var_name": "delegate" }, { "declarator": "toFunc", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public FileStatus getFileStatus(Path path) throws IOException {\n return toReturnFileStatus(delegate.getFileStatus(to(path)));\n }", "class_method_signature": "PathConvertingFileSystem.getFileStatus(Path path)", "constructor": false, "full_signature": "@Override public FileSt...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_65
{ "fields": [ { "declarator": "executor = MoreExecutors.newDirectExecutorService()", "modifier": "private static final", "original_string": "private static final ListeningExecutorService executor = MoreExecutors.newDirectExecutorService();", "type": "ListeningExecutorService", "var_n...
{ "body": "@Test\n public void testRemove() {\n keys.remove(KEY).join();\n\n verify(delegate).remove(KEY);\n }", "class_method_signature": "DefaultAsyncKeyStorageStrategyTest.testRemove()", "constructor": false, "full_signature": "@Test public void testRemove()", "identifier": "testRemove"...
{ "fields": [ { "declarator": "keys", "modifier": "private final", "original_string": "private final KeyStorageStrategy keys;", "type": "KeyStorageStrategy", "var_name": "keys" }, { "declarator": "executor", "modifier": "private final", "original_string": "p...
{ "body": "@Override\n public CompletableFuture<Void> remove(String fileKey) {\n return CompletableFuture.supplyAsync(() -> {\n keys.remove(fileKey);\n return null;\n }, executor);\n }", "class_method_signature": "DefaultAsyncKeyStorageStrategy.remove(String fileKey)", "c...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_49
{ "fields": [ { "declarator": "AES_CTR = AesCtrCipher.ALGORITHM", "modifier": "private static final", "original_string": "private static final String AES_CTR = AesCtrCipher.ALGORITHM;", "type": "String", "var_name": "AES_CTR" }, { "declarator": "AES_CBC = AesCbcCipher.A...
{ "body": "@Test\n public void testGetAesCtr_noKeyMaterial() {\n SeekableCipher cipher = SeekableCipherFactory.getCipher(AES_CTR);\n assertThat(cipher).isInstanceOf(AesCtrCipher.class);\n assertThat(cipher.getKeyMaterial()).isNotNull();\n }", "class_method_signature": "SeekableCipherFacto...
{ "fields": [], "file": "crypto-core/src/main/java/com/palantir/crypto2/cipher/SeekableCipherFactory.java", "identifier": "SeekableCipherFactory", "interfaces": "", "methods": [ { "class_method_signature": "SeekableCipherFactory.SeekableCipherFactory()", "constructor": true, "full_signat...
{ "body": "@Deprecated\n public static SeekableCipher getCipher(String cipherAlgorithm) {\n switch (cipherAlgorithm) {\n case AesCtrCipher.ALGORITHM:\n return getCipher(cipherAlgorithm, AesCtrCipher.generateKeyMaterial());\n case AesCbcCipher.ALGORITHM:\n ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_48
{ "fields": [ { "declarator": "AES_CTR = AesCtrCipher.ALGORITHM", "modifier": "private static final", "original_string": "private static final String AES_CTR = AesCtrCipher.ALGORITHM;", "type": "String", "var_name": "AES_CTR" }, { "declarator": "AES_CBC = AesCbcCipher.A...
{ "body": "@Test\n public void testGenerateKeyMaterial_aesCbc() {\n KeyMaterial keyMaterial = SeekableCipherFactory.generateKeyMaterial(AES_CBC);\n String algorithm = keyMaterial.getSecretKey().getAlgorithm();\n assertThat(algorithm).isEqualTo(\"AES\");\n }", "class_method_signature": "Se...
{ "fields": [], "file": "crypto-core/src/main/java/com/palantir/crypto2/cipher/SeekableCipherFactory.java", "identifier": "SeekableCipherFactory", "interfaces": "", "methods": [ { "class_method_signature": "SeekableCipherFactory.SeekableCipherFactory()", "constructor": true, "full_signat...
{ "body": "public static KeyMaterial generateKeyMaterial(String cipherAlgorithm) {\n switch (cipherAlgorithm) {\n case AesCtrCipher.ALGORITHM:\n return AesCtrCipher.generateKeyMaterial();\n case AesCbcCipher.ALGORITHM:\n return AesCbcCipher.generateKeyMateria...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_64
{ "fields": [ { "declarator": "executor = MoreExecutors.newDirectExecutorService()", "modifier": "private static final", "original_string": "private static final ListeningExecutorService executor = MoreExecutors.newDirectExecutorService();", "type": "ListeningExecutorService", "var_n...
{ "body": "@Test\n public void testGet_exception() {\n doThrow(IllegalStateException.class).when(delegate).get(KEY);\n\n keys.get(KEY)\n .thenRun(Assert::fail)\n .exceptionally(this::verifyIllegalStateThrown)\n .join();\n }", "class_method_signature":...
{ "fields": [ { "declarator": "keys", "modifier": "private final", "original_string": "private final KeyStorageStrategy keys;", "type": "KeyStorageStrategy", "var_name": "keys" }, { "declarator": "executor", "modifier": "private final", "original_string": "p...
{ "body": "@Override\n public CompletableFuture<KeyMaterial> get(String fileKey) {\n return CompletableFuture.supplyAsync(() -> keys.get(fileKey), executor);\n }", "class_method_signature": "DefaultAsyncKeyStorageStrategy.get(String fileKey)", "constructor": false, "full_signature": "@Override publ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_9
{ "fields": [ { "declarator": "PATH = new Path(\"/dummy/path\")", "modifier": "private static final", "original_string": "private static final Path PATH = new Path(\"/dummy/path\");", "type": "Path", "var_name": "PATH" }, { "declarator": "DELEGATE_PATH = new Path(\"/del...
{ "body": "@Test\n public void setWorkingDirectory() throws Exception {\n convertingFs.setWorkingDirectory(PATH);\n verify(delegate).setWorkingDirectory(DELEGATE_PATH);\n }", "class_method_signature": "PathConvertingFileSystemTest.setWorkingDirectory()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final FileSystem delegate;", "type": "FileSystem", "var_name": "delegate" }, { "declarator": "toFunc", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public void setWorkingDirectory(Path path) {\n delegate.setWorkingDirectory(to(path));\n }", "class_method_signature": "PathConvertingFileSystem.setWorkingDirectory(Path path)", "constructor": false, "full_signature": "@Override public void setWorkingDirectory(Path path)", ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_33
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testDelete_nonRecursiveDeleteOnDir() throws IOException {\n Path folderPath = new Path(folder.getRoot().getAbsolutePath());\n\n assertThatExceptionOfType(IOException.class)\n .isThrownBy(() -> efs.delete(folderPath, false))\n .withMessage(\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public boolean delete(Path path, boolean recursive) throws IOException {\n if (recursive) {\n throw new UnsupportedOperationException(\"EncryptedFileSystem does not support recursive deletes\");\n }\n keyStore.remove(path.toString());\n return fs.delete...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_25
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testRename_successfulRenameFailedRemoveIsIgnored() throws IOException {\n when(mockFs.rename(path, newPath)).thenReturn(true);\n doThrow(new IllegalArgumentException()).when(mockKeyStore).remove(anyString());\n\n assertThat(mockedEfs.rename(path, newPath)).isTrue...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public boolean rename(Path src, Path dst) throws IOException {\n // Copy key material first so the encrypted file always has key material in the key store even if the\n // put or rename fails\n KeyMaterial keyMaterial = keyStore.get(src.toString());\n keyStore.put...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_72
{ "fields": [ { "declarator": "EXECUTOR = MoreExecutors.directExecutor()", "modifier": "private static final", "original_string": "private static final Executor EXECUTOR = MoreExecutors.directExecutor();", "type": "Executor", "var_name": "EXECUTOR" }, { "declarator": "V...
{ "body": "@Test\n public void testRemove_allCalled() {\n chained = new ChainedAsyncKeyStorageStrategy(EXECUTOR, successfulStrategy, successfulStrategy);\n\n chained.remove(KEY).join();\n\n verify(successfulStrategy, times(2)).remove(KEY);\n verifyNoMoreInteractions(successfulStrategy, ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n public CompletableFuture<Void> remove(String fileKey) {\n return applyToStrategies(strategy -> strategy.remove(fileKey));\n }", "class_method_signature": "ChainedAsyncKeyStorageStrategy.remove(String fileKey)", "constructor": false, "full_signature": "@Override public Complet...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_52
{ "fields": [ { "declarator": "AES_CTR = AesCtrCipher.ALGORITHM", "modifier": "private static final", "original_string": "private static final String AES_CTR = AesCtrCipher.ALGORITHM;", "type": "String", "var_name": "AES_CTR" }, { "declarator": "AES_CBC = AesCbcCipher.A...
{ "body": "@Test\n public void testGetAesCbc_keyMaterial() {\n KeyMaterial keyMaterial = mock(KeyMaterial.class);\n SeekableCipher cipher = SeekableCipherFactory.getCipher(AES_CBC, keyMaterial);\n assertThat(cipher).isInstanceOf(AesCbcCipher.class);\n assertThat(cipher.getKeyMaterial())...
{ "fields": [], "file": "crypto-core/src/main/java/com/palantir/crypto2/cipher/SeekableCipherFactory.java", "identifier": "SeekableCipherFactory", "interfaces": "", "methods": [ { "class_method_signature": "SeekableCipherFactory.SeekableCipherFactory()", "constructor": true, "full_signat...
{ "body": "@Deprecated\n public static SeekableCipher getCipher(String cipherAlgorithm) {\n switch (cipherAlgorithm) {\n case AesCtrCipher.ALGORITHM:\n return getCipher(cipherAlgorithm, AesCtrCipher.generateKeyMaterial());\n case AesCbcCipher.ALGORITHM:\n ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_44
{ "fields": [], "file": "crypto-core/src/test/java/com/palantir/crypto2/cipher/CiphersTest.java", "identifier": "CiphersTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testProvider_exists() {\n assertThat(Ciphers.getProvider()).isIn(\"SunJCE\", \"IBMJCE\");\n }", "class_method_signature": "CiphersTest.testProvider_exists()", "constructor": false, "full_signature": "@Test public void testProvider_exists()", "identifier": "testProvi...
{ "fields": [ { "declarator": "ACCEPTABLE_PROVIDERS = ImmutableList.of(\"SunJCE\", \"IBMJCE\")", "modifier": "private static final", "original_string": "private static final ImmutableList<String> ACCEPTABLE_PROVIDERS = ImmutableList.of(\"SunJCE\", \"IBMJCE\");", "type": "ImmutableList<Stri...
{ "body": "static String getProvider() {\n return getProvider(ACCEPTABLE_PROVIDERS);\n }", "class_method_signature": "Ciphers.getProvider()", "constructor": false, "full_signature": "static String getProvider()", "identifier": "getProvider", "invocations": [ "getProvider" ], "modifiers": "...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_13
{ "fields": [ { "declarator": "EFS_URI = URI.create(\"efile:///\")", "modifier": "private static final", "original_string": "private static final URI EFS_URI = URI.create(\"efile:///\");", "type": "URI", "var_name": "EFS_URI" }, { "declarator": "DATA = \"data\"", ...
{ "body": "@Test\n public void testReadWrite() throws IOException {\n byte[] readData = new byte[DATA.length()];\n\n // Write encrypted data\n OutputStream os = efs.create(path);\n IOUtils.write(DATA, os);\n os.close();\n\n // Read encrypted data\n InputStream dis =...
{ "fields": [ { "declarator": "SCHEME = \"\"", "modifier": "private static final", "original_string": "private static final String SCHEME = \"\";", "type": "String", "var_name": "SCHEME" }, { "declarator": "DEFAULT_ALGORITHM = \"RSA\"", "modifier": "private static...
{ "body": "@Override\n public boolean exists(Path path) throws IOException {\n return fs.exists(path);\n }", "class_method_signature": "StandaloneEncryptedFileSystem.exists(Path path)", "constructor": false, "full_signature": "@Override public boolean exists(Path path)", "identifier": "exists", ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_68
{ "fields": [ { "declarator": "EXECUTOR = MoreExecutors.directExecutor()", "modifier": "private static final", "original_string": "private static final Executor EXECUTOR = MoreExecutors.directExecutor();", "type": "Executor", "var_name": "EXECUTOR" }, { "declarator": "V...
{ "body": "@Test\n public void testPut_fails() {\n chained = new ChainedAsyncKeyStorageStrategy(EXECUTOR, successfulStrategy, failingStrategy);\n\n assertThatExceptionOfType(IllegalArgumentException.class)\n .isThrownBy(() -> chained.put(KEY, keyMaterial).join());\n }", "class_met...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n public CompletableFuture<Void> put(String fileKey, KeyMaterial keyMaterial) {\n return applyToStrategies(strategy -> strategy.put(fileKey, keyMaterial));\n }", "class_method_signature": "ChainedAsyncKeyStorageStrategy.put(String fileKey, KeyMaterial keyMaterial)", "constructor"...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_5
{ "fields": [ { "declarator": "PATH = new Path(\"/dummy/path\")", "modifier": "private static final", "original_string": "private static final Path PATH = new Path(\"/dummy/path\");", "type": "Path", "var_name": "PATH" }, { "declarator": "DELEGATE_PATH = new Path(\"/del...
{ "body": "@Test\n public void delete() throws Exception {\n when(delegate.delete(DELEGATE_PATH, false)).thenReturn(false);\n boolean success = convertingFs.delete(PATH, false);\n\n assertThat(success).isFalse();\n }", "class_method_signature": "PathConvertingFileSystemTest.delete()", "...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final FileSystem delegate;", "type": "FileSystem", "var_name": "delegate" }, { "declarator": "toFunc", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public boolean delete(Path path, boolean recursive) throws IOException {\n return delegate.delete(to(path), recursive);\n }", "class_method_signature": "PathConvertingFileSystem.delete(Path path, boolean recursive)", "constructor": false, "full_signature": "@Override public b...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_29
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testGetCipherAlgorithm_deprecated() throws IOException, URISyntaxException {\n String cipherAlg = \"cipherAlg\";\n\n Configuration conf = new Configuration();\n conf.set(EncryptedFileSystem.DEPRECATED_CIPHER_ALGORITHM_KEY, cipherAlg);\n delegateFs = FileSy...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@VisibleForTesting\n String getCipherAlgorithm() {\n Optional<String> cipher = Optional.ofNullable(getConf().get(CIPHER_ALGORITHM_KEY));\n Optional<String> deprecatedCipher = Optional.ofNullable(getConf().get(DEPRECATED_CIPHER_ALGORITHM_KEY));\n\n if (cipher.isPresent() && deprecate...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_75
{ "fields": [ { "declarator": "chained", "modifier": "private", "original_string": "private KeyStorageStrategy chained;", "type": "KeyStorageStrategy", "var_name": "chained" }, { "declarator": "successfulStrategy", "modifier": "private", "original_string": "...
{ "body": "@Test\n public void testAllPutsCalled() {\n chained.put(key, keyMaterial);\n\n InOrder inOrder = inOrder(successfulStrategy, failingStrategy);\n inOrder.verify(successfulStrategy).put(key, keyMaterial);\n inOrder.verify(failingStrategy).put(key, keyMaterial);\n verifyN...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ChainedKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(ChainedKeyStorageStrategy.class);", "type": "Logger", "var_name": "l...
{ "body": "@Override\n public void put(String fileKey, KeyMaterial keyMaterial) {\n for (KeyStorageStrategy strategy : strategies) {\n strategy.put(fileKey, keyMaterial);\n }\n }", "class_method_signature": "ChainedKeyStorageStrategy.put(String fileKey, KeyMaterial keyMaterial)", "c...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_22
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testRename_failedGet() throws IOException {\n doThrow(new IllegalArgumentException()).when(mockKeyStore).get(path.toString());\n\n assertThatExceptionOfType(IllegalArgumentException.class)\n .isThrownBy(() -> mockedEfs.rename(path, newPath));\n ver...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public boolean rename(Path src, Path dst) throws IOException {\n // Copy key material first so the encrypted file always has key material in the key store even if the\n // put or rename fails\n KeyMaterial keyMaterial = keyStore.get(src.toString());\n keyStore.put...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_34
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testDelete_keyMaterialAlreadyDeleted() throws IOException {\n keyStore.remove(path.toString());\n\n assertThat(keyStore.get(path.toString())).isNull();\n assertThat(efs.delete(path, false)).isTrue();\n assertThat(efs.exists(path)).isFalse();\n }", "cl...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public boolean delete(Path path, boolean recursive) throws IOException {\n if (recursive) {\n throw new UnsupportedOperationException(\"EncryptedFileSystem does not support recursive deletes\");\n }\n keyStore.remove(path.toString());\n return fs.delete...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_63
{ "fields": [ { "declarator": "executor = MoreExecutors.newDirectExecutorService()", "modifier": "private static final", "original_string": "private static final ListeningExecutorService executor = MoreExecutors.newDirectExecutorService();", "type": "ListeningExecutorService", "var_n...
{ "body": "@Test\n public void testGet() {\n when(delegate.get(KEY)).thenReturn(keyMaterial);\n\n assertThat(keys.get(KEY).join()).isEqualTo(keyMaterial);\n }", "class_method_signature": "DefaultAsyncKeyStorageStrategyTest.testGet()", "constructor": false, "full_signature": "@Test public voi...
{ "fields": [ { "declarator": "keys", "modifier": "private final", "original_string": "private final KeyStorageStrategy keys;", "type": "KeyStorageStrategy", "var_name": "keys" }, { "declarator": "executor", "modifier": "private final", "original_string": "p...
{ "body": "@Override\n public CompletableFuture<KeyMaterial> get(String fileKey) {\n return CompletableFuture.supplyAsync(() -> keys.get(fileKey), executor);\n }", "class_method_signature": "DefaultAsyncKeyStorageStrategy.get(String fileKey)", "constructor": false, "full_signature": "@Override publ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_18
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testCreate_normalizePathPassedToKeyStore() throws IOException {\n mockedEfs.create(new Path(\"foo//bar\"));\n\n verify(mockKeyStore).put(eq(\"foo/bar\"), any(KeyMaterial.class));\n verifyNoMoreInteractions(mockKeyStore);\n }", "class_method_signature": "Encr...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public FSDataOutputStream create(Path path, FsPermission permission,\n boolean overwrite, int bufferSize, short replication, long blockSize,\n Progressable progress) throws IOException {\n FSDataOutputStream outputStream =\n fs.create(path, permiss...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_59
{ "fields": [ { "declarator": "KEY_ALG = \"AES\"", "modifier": "private static final", "original_string": "private static final String KEY_ALG = \"AES\";", "type": "String", "var_name": "KEY_ALG" }, { "declarator": "KEY_SIZE = 128", "modifier": "private static fin...
{ "body": "@Test\n public void testSerializeDeserialize() {\n SecretKey secretKey = keyMaterial.getSecretKey();\n String algorithm = secretKey.getAlgorithm();\n byte[] encoded = secretKey.getEncoded();\n byte[] iv = keyMaterial.getIv();\n assertThat(KeyMaterials.from(algorithm, e...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(KeyMaterials.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(KeyMaterials.class);", "type": "Logger", "var_name": "log" }, { "declarat...
{ "body": "public static KeyMaterial from(String keyAlgorithm, byte[] encodedKey, byte[] iv) {\n SecretKeySpec secretKey = new SecretKeySpec(encodedKey, keyAlgorithm);\n return KeyMaterial.of(secretKey, iv);\n }", "class_method_signature": "KeyMaterials.from(String keyAlgorithm, byte[] encodedKey, ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_79
{ "fields": [ { "declarator": "chained", "modifier": "private", "original_string": "private KeyStorageStrategy chained;", "type": "KeyStorageStrategy", "var_name": "chained" }, { "declarator": "successfulStrategy", "modifier": "private", "original_string": "...
{ "body": "@Test\n public void testAllDeletesCalled() {\n chained.remove(key);\n\n InOrder inOrder = inOrder(successfulStrategy, failingStrategy);\n inOrder.verify(successfulStrategy).remove(key);\n inOrder.verify(failingStrategy).remove(key);\n verifyNoMoreInteractions(successfu...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ChainedKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(ChainedKeyStorageStrategy.class);", "type": "Logger", "var_name": "l...
{ "body": "@Override\n public void remove(String fileKey) {\n for (KeyStorageStrategy strategy : strategies) {\n strategy.remove(fileKey);\n }\n }", "class_method_signature": "ChainedKeyStorageStrategy.remove(String fileKey)", "constructor": false, "full_signature": "@Override pub...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_2
{ "fields": [ { "declarator": "PATH = new Path(\"/dummy/path\")", "modifier": "private static final", "original_string": "private static final Path PATH = new Path(\"/dummy/path\");", "type": "Path", "var_name": "PATH" }, { "declarator": "DELEGATE_PATH = new Path(\"/del...
{ "body": "@Test\n public void create() throws Exception {\n when(delegate.create(DELEGATE_PATH, null, false, 0, (short) 0, 0, null)).thenReturn(outputStream);\n FSDataOutputStream actualStream = convertingFs.create(PATH, null, false, 0, (short) 0, 0, null);\n\n when(delegate.create(DELEGATE_P...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final FileSystem delegate;", "type": "FileSystem", "var_name": "delegate" }, { "declarator": "toFunc", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public FSDataOutputStream create(Path path, FsPermission permission, boolean overwrite, int bufferSize,\n short replication, long blockSize, Progressable progress) throws IOException {\n return delegate.create(to(path), permission, overwrite, bufferSize, replication, blockS...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_38
{ "fields": [ { "declarator": "remotePath = new Path(\"/test\")", "modifier": "private static final", "original_string": "private static final Path remotePath = new Path(\"/test\");", "type": "Path", "var_name": "remotePath" }, { "declarator": "bytes = \"data\".getBytes...
{ "body": "@Test\n public void testCopyFromLocal() throws IOException {\n testCopyFromLocal(src -> delegatingFs.copyFromLocalFile(src, remotePath));\n testCopyFromLocal(src -> delegatingFs.copyFromLocalFile(false, src, remotePath));\n testCopyFromLocal(src -> delegatingFs.copyFromLocalFile(fal...
{ "fields": [], "file": "hadoop-crypto/src/main/java/com/palantir/crypto2/hadoop/DelegatingFileSystem.java", "identifier": "DelegatingFileSystem", "interfaces": "", "methods": [ { "class_method_signature": "DelegatingFileSystem.DelegatingFileSystem(FileSystem delegate)", "constructor": true, ...
{ "body": "@Override\n public final void copyFromLocalFile(Path src, Path dst) throws IOException {\n copyFromLocalFile(false, src, dst);\n }", "class_method_signature": "DelegatingFileSystem.copyFromLocalFile(Path src, Path dst)", "constructor": false, "full_signature": "@Override public final voi...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_80
{ "fields": [ { "declarator": "keyPair", "modifier": "private", "original_string": "private KeyPair keyPair;", "type": "KeyPair", "var_name": "keyPair" }, { "declarator": "privateKey", "modifier": "private", "original_string": "private PrivateKey privateKey;...
{ "body": "@Test\n public void testDeserialization() {\n String privateEncoded = encode(privateKey.getEncoded());\n String publicEncoded = encode(publicKey.getEncoded());\n KeyPair deserialized = KeyPairs.fromStrings(privateEncoded, publicEncoded, \"RSA\");\n\n // KeyPair does not imple...
{ "fields": [], "file": "crypto-keys/src/main/java/com/palantir/crypto2/keys/KeyPairs.java", "identifier": "KeyPairs", "interfaces": "", "methods": [ { "class_method_signature": "KeyPairs.KeyPairs()", "constructor": true, "full_signature": "private KeyPairs()", "identifier": "KeyP...
{ "body": "public static KeyPair fromStrings(String privateKeyString, String publicKeyString, String algorithm) {\n try {\n KeyFactory keyFactory = KeyFactory.getInstance(algorithm);\n // Private key is only required for decryption, can be null\n Optional<PrivateKey> privateKey...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_14
{ "fields": [ { "declarator": "EFS_URI = URI.create(\"efile:///\")", "modifier": "private static final", "original_string": "private static final URI EFS_URI = URI.create(\"efile:///\");", "type": "URI", "var_name": "EFS_URI" }, { "declarator": "DATA = \"data\"", ...
{ "body": "@Test\n public void testDelete() throws IOException {\n File rootFolder = folder.newFolder();\n\n Path path1 = writeData(rootFolder);\n\n assertThat(efs.exists(path1)).isTrue();\n assertThat(rawFs.exists(path1)).isTrue();\n assertThat(rawFs.exists(keyMaterialPath(path1...
{ "fields": [ { "declarator": "SCHEME = \"\"", "modifier": "private static final", "original_string": "private static final String SCHEME = \"\";", "type": "String", "var_name": "SCHEME" }, { "declarator": "DEFAULT_ALGORITHM = \"RSA\"", "modifier": "private static...
{ "body": "@Override\n public boolean delete(Path path, boolean recursive) throws IOException {\n // Since StandaloneEncryptedFileSystem uses a FileKeyStorageStrategy, the delegate delete call on folders\n // deletes both the payload files and the adjacent encryption materials. For files we can\n ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_43
{ "fields": [ { "declarator": "bytes = \"bytes\".getBytes(StandardCharsets.UTF_8)", "modifier": "private static final", "original_string": "private static final byte[] bytes = \"bytes\".getBytes(StandardCharsets.UTF_8);", "type": "byte[]", "var_name": "bytes" }, { "decl...
{ "body": "@Test\n public void testWrite_callsBatchWrite() throws IOException {\n scos.write(bytes);\n verify(cos).write(bytes);\n }", "class_method_signature": "FsCipherOutputStreamTest.testWrite_callsBatchWrite()", "constructor": false, "full_signature": "@Test public void testWrite_callsB...
{ "fields": [], "file": "hadoop-crypto/src/main/java/com/palantir/crypto2/hadoop/cipher/FsCipherOutputStream.java", "identifier": "FsCipherOutputStream", "interfaces": "", "methods": [ { "class_method_signature": "FsCipherOutputStream.FsCipherOutputStream(FSDataOutputStream delegate, SeekableCipher ...
{ "body": "@Override\n public void write(byte[] bytes, int off, int len) throws IOException {\n out.write(bytes, off, len);\n }", "class_method_signature": "FsCipherOutputStream.write(byte[] bytes, int off, int len)", "constructor": false, "full_signature": "@Override public void write(byte[] bytes...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_55
{ "fields": [ { "declarator": "supplier", "modifier": "private", "original_string": "private CipherStreamSupplier supplier;", "type": "CipherStreamSupplier", "var_name": "supplier" }, { "declarator": "is", "modifier": "private", "original_string": "private I...
{ "body": "@Test\n public void testGetCipherInputStream() throws IOException {\n assertThat(supplier.getInputStream(is, cipher)).isInstanceOf(CipherInputStream.class);\n }", "class_method_signature": "CipherStreamSupplierImplTest.testGetCipherInputStream()", "constructor": false, "full_signature": ...
{ "fields": [], "file": "crypto-core/src/main/java/com/palantir/crypto2/cipher/CipherStreamSupplierImpl.java", "identifier": "CipherStreamSupplierImpl", "interfaces": "implements CipherStreamSupplier", "methods": [ { "class_method_signature": "CipherStreamSupplierImpl.getInputStream(InputStream is, ...
{ "body": "@Override\n public CipherInputStream getInputStream(InputStream is, Cipher cipher) {\n return new CipherInputStream(is, cipher);\n }", "class_method_signature": "CipherStreamSupplierImpl.getInputStream(InputStream is, Cipher cipher)", "constructor": false, "full_signature": "@Override p...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_54
{ "fields": [ { "declarator": "AES_CTR = AesCtrCipher.ALGORITHM", "modifier": "private static final", "original_string": "private static final String AES_CTR = AesCtrCipher.ALGORITHM;", "type": "String", "var_name": "AES_CTR" }, { "declarator": "AES_CBC = AesCbcCipher.A...
{ "body": "@Test\n public void testGetCipher_invalidNameKeyMaterial() {\n KeyMaterial keyMaterial = mock(KeyMaterial.class);\n\n assertThatExceptionOfType(IllegalArgumentException.class)\n .isThrownBy(() -> SeekableCipherFactory.getCipher(\"doesnt_exist\", keyMaterial))\n ...
{ "fields": [], "file": "crypto-core/src/main/java/com/palantir/crypto2/cipher/SeekableCipherFactory.java", "identifier": "SeekableCipherFactory", "interfaces": "", "methods": [ { "class_method_signature": "SeekableCipherFactory.SeekableCipherFactory()", "constructor": true, "full_signat...
{ "body": "@Deprecated\n public static SeekableCipher getCipher(String cipherAlgorithm) {\n switch (cipherAlgorithm) {\n case AesCtrCipher.ALGORITHM:\n return getCipher(cipherAlgorithm, AesCtrCipher.generateKeyMaterial());\n case AesCbcCipher.ALGORITHM:\n ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_42
{ "fields": [ { "declarator": "bytes = \"bytes\".getBytes(StandardCharsets.UTF_8)", "modifier": "private static final", "original_string": "private static final byte[] bytes = \"bytes\".getBytes(StandardCharsets.UTF_8);", "type": "byte[]", "var_name": "bytes" }, { "decl...
{ "body": "@Test\n public void testWrite_callsWriteWithLength() throws IOException {\n scos.write(bytes, 0, bytes.length);\n verify(cos).write(bytes, 0, bytes.length);\n }", "class_method_signature": "FsCipherOutputStreamTest.testWrite_callsWriteWithLength()", "constructor": false, "full_sig...
{ "fields": [], "file": "hadoop-crypto/src/main/java/com/palantir/crypto2/hadoop/cipher/FsCipherOutputStream.java", "identifier": "FsCipherOutputStream", "interfaces": "", "methods": [ { "class_method_signature": "FsCipherOutputStream.FsCipherOutputStream(FSDataOutputStream delegate, SeekableCipher ...
{ "body": "@Override\n public void write(byte[] bytes, int off, int len) throws IOException {\n out.write(bytes, off, len);\n }", "class_method_signature": "FsCipherOutputStream.write(byte[] bytes, int off, int len)", "constructor": false, "full_signature": "@Override public void write(byte[] bytes...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_15
{ "fields": [ { "declarator": "EFS_URI = URI.create(\"efile:///\")", "modifier": "private static final", "original_string": "private static final URI EFS_URI = URI.create(\"efile:///\");", "type": "URI", "var_name": "EFS_URI" }, { "declarator": "DATA = \"data\"", ...
{ "body": "@Test\n public void testRename() throws IOException {\n File rootFolder = folder.newFolder();\n Path rootPath = new Path(rootFolder.getAbsolutePath());\n Path dstPath = new Path(rootPath, UUID.randomUUID().toString());\n\n Path srcPath = writeData(rootFolder);\n\n asse...
{ "fields": [ { "declarator": "SCHEME = \"\"", "modifier": "private static final", "original_string": "private static final String SCHEME = \"\";", "type": "String", "var_name": "SCHEME" }, { "declarator": "DEFAULT_ALGORITHM = \"RSA\"", "modifier": "private static...
{ "body": "@Override\n public boolean rename(Path src, Path dst) throws IOException {\n // Since StandaloneEncryptedFileSystem uses a FileKeyStorageStrategy, the delegate rename call on folders\n // renames both the payload files and the adjacent encryption materials. For files we can\n // rel...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_39
{ "fields": [ { "declarator": "remotePath = new Path(\"/test\")", "modifier": "private static final", "original_string": "private static final Path remotePath = new Path(\"/test\");", "type": "Path", "var_name": "remotePath" }, { "declarator": "bytes = \"data\".getBytes...
{ "body": "@Test\n public void testCopyToLocal() throws IOException {\n testCopyToLocal(dst -> delegatingFs.copyToLocalFile(remotePath, dst));\n testCopyToLocal(dst -> delegatingFs.copyToLocalFile(false, remotePath, dst));\n testCopyToLocal(dst -> delegatingFs.copyToLocalFile(false, remotePath...
{ "fields": [], "file": "hadoop-crypto/src/main/java/com/palantir/crypto2/hadoop/DelegatingFileSystem.java", "identifier": "DelegatingFileSystem", "interfaces": "", "methods": [ { "class_method_signature": "DelegatingFileSystem.DelegatingFileSystem(FileSystem delegate)", "constructor": true, ...
{ "body": "@Override\n public final void copyToLocalFile(Path src, Path dst) throws IOException {\n copyToLocalFile(false, src, dst);\n }", "class_method_signature": "DelegatingFileSystem.copyToLocalFile(Path src, Path dst)", "constructor": false, "full_signature": "@Override public final void copy...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_3
{ "fields": [ { "declarator": "PATH = new Path(\"/dummy/path\")", "modifier": "private static final", "original_string": "private static final Path PATH = new Path(\"/dummy/path\");", "type": "Path", "var_name": "PATH" }, { "declarator": "DELEGATE_PATH = new Path(\"/del...
{ "body": "@Test\n public void append() throws Exception {\n when(delegate.append(DELEGATE_PATH, 0, null)).thenReturn(outputStream);\n FSDataOutputStream actualStream = convertingFs.append(PATH, 0, null);\n\n assertThat(actualStream).isEqualTo(outputStream);\n }", "class_method_signature"...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final FileSystem delegate;", "type": "FileSystem", "var_name": "delegate" }, { "declarator": "toFunc", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public FSDataOutputStream append(Path path, int bufferSize, Progressable progress) throws IOException {\n return delegate.append(to(path), bufferSize, progress);\n }", "class_method_signature": "PathConvertingFileSystem.append(Path path, int bufferSize, Progressable progress)", ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_78
{ "fields": [ { "declarator": "chained", "modifier": "private", "original_string": "private KeyStorageStrategy chained;", "type": "KeyStorageStrategy", "var_name": "chained" }, { "declarator": "successfulStrategy", "modifier": "private", "original_string": "...
{ "body": "@Test\n public void testAllStrategiesFail() {\n chained = new ChainedKeyStorageStrategy(failingStrategy);\n\n assertThatExceptionOfType(RuntimeException.class)\n .isThrownBy(() -> chained.get(key))\n .withMessage(\"Unable to get key material for 'key' using an...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ChainedKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(ChainedKeyStorageStrategy.class);", "type": "Logger", "var_name": "l...
{ "body": "@Override\n public KeyMaterial get(String fileKey) {\n List<Exception> suppressedExceptions = new ArrayList<>();\n for (KeyStorageStrategy strategy : strategies) {\n try {\n return strategy.get(fileKey);\n } catch (Exception e) {\n suppre...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_58
{ "fields": [ { "declarator": "KEY_ALG = \"AES\"", "modifier": "private static final", "original_string": "private static final String KEY_ALG = \"AES\";", "type": "String", "var_name": "KEY_ALG" }, { "declarator": "KEY_SIZE = 128", "modifier": "private static fin...
{ "body": "@Test\n public void testGenerateIv() {\n byte[] iv = KeyMaterials.generateIv(IV_SIZE);\n assertThat(iv).hasSize(IV_SIZE);\n }", "class_method_signature": "KeyMaterialsTest.testGenerateIv()", "constructor": false, "full_signature": "@Test public void testGenerateIv()", "identifie...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(KeyMaterials.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(KeyMaterials.class);", "type": "Logger", "var_name": "log" }, { "declarat...
{ "body": "public static byte[] generateIv(int ivSize) {\n byte[] iv = new byte[ivSize];\n SecureRandom rng = new SecureRandom();\n rng.nextBytes(iv);\n return iv;\n }", "class_method_signature": "KeyMaterials.generateIv(int ivSize)", "constructor": false, "full_signature": "publi...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_19
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testOpen_normalizePathPassedToKeyStore() throws IOException {\n mockedEfs.open(new Path(\"foo//bar\"));\n\n verify(mockKeyStore).get(\"foo/bar\");\n verifyNoMoreInteractions(mockKeyStore);\n }", "class_method_signature": "EncryptedFileSystemTest.testOpen_nor...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public FSDataInputStream open(Path path, int bufferSize) throws IOException {\n FSDataInputStream encryptedStream = fs.open(path, bufferSize);\n\n KeyMaterial keyMaterial = keyStore.get(path.toString());\n\n return new FSDataInputStream(new FsCipherInputStream(encryptedS...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_62
{ "fields": [ { "declarator": "executor = MoreExecutors.newDirectExecutorService()", "modifier": "private static final", "original_string": "private static final ListeningExecutorService executor = MoreExecutors.newDirectExecutorService();", "type": "ListeningExecutorService", "var_n...
{ "body": "@Test\n public void testPut_exception() {\n doThrow(IllegalStateException.class).when(delegate).put(KEY, keyMaterial);\n\n keys.put(KEY, keyMaterial)\n .thenRun(Assert::fail)\n .exceptionally(this::verifyIllegalStateThrown)\n .join();\n }", ...
{ "fields": [ { "declarator": "keys", "modifier": "private final", "original_string": "private final KeyStorageStrategy keys;", "type": "KeyStorageStrategy", "var_name": "keys" }, { "declarator": "executor", "modifier": "private final", "original_string": "p...
{ "body": "@Override\n public CompletableFuture<Void> put(String fileKey, KeyMaterial keyMaterial) {\n return CompletableFuture.supplyAsync(() -> {\n keys.put(fileKey, keyMaterial);\n return null;\n }, executor);\n }", "class_method_signature": "DefaultAsyncKeyStorageStrate...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_35
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testDelete_fileAlreadyDeleted() throws IOException {\n delegateFs.delete(path, false);\n\n assertThat(keyStore.get(path.toString())).isInstanceOf(KeyMaterial.class);\n assertThat(efs.delete(path, false)).isFalse();\n assertThat(keyStore.get(path.toString()...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public boolean delete(Path path, boolean recursive) throws IOException {\n if (recursive) {\n throw new UnsupportedOperationException(\"EncryptedFileSystem does not support recursive deletes\");\n }\n keyStore.remove(path.toString());\n return fs.delete...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_23
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testRename_failedPut() throws IOException {\n doThrow(new IllegalArgumentException()).when(mockKeyStore).put(newPath.toString(), keyMaterial);\n\n assertThatExceptionOfType(IllegalArgumentException.class)\n .isThrownBy(() -> mockedEfs.rename(path, newPath...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public boolean rename(Path src, Path dst) throws IOException {\n // Copy key material first so the encrypted file always has key material in the key store even if the\n // put or rename fails\n KeyMaterial keyMaterial = keyStore.get(src.toString());\n keyStore.put...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_74
{ "fields": [ { "declarator": "EXECUTOR = MoreExecutors.directExecutor()", "modifier": "private static final", "original_string": "private static final Executor EXECUTOR = MoreExecutors.directExecutor();", "type": "Executor", "var_name": "EXECUTOR" }, { "declarator": "V...
{ "body": "@Test\n public void testCancelForwarded() {\n DeterministicExecutor executor = new DeterministicExecutor();\n chained = new ChainedAsyncKeyStorageStrategy(executor, successfulStrategy);\n\n chained.get(KEY).cancel(true);\n executor.runUntilIdle();\n\n verify(successful...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n public CompletableFuture<KeyMaterial> get(String fileKey) {\n return CompletableFuture.supplyAsync(() -> {\n List<Exception> suppressedExceptions = new ArrayList<>();\n for (AsyncKeyStorageStrategy strategy : strategies) {\n try {\n ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_61
{ "fields": [ { "declarator": "executor = MoreExecutors.newDirectExecutorService()", "modifier": "private static final", "original_string": "private static final ListeningExecutorService executor = MoreExecutors.newDirectExecutorService();", "type": "ListeningExecutorService", "var_n...
{ "body": "@Test\n public void testPut() {\n keys.put(KEY, keyMaterial).join();\n\n verify(delegate).put(KEY, keyMaterial);\n }", "class_method_signature": "DefaultAsyncKeyStorageStrategyTest.testPut()", "constructor": false, "full_signature": "@Test public void testPut()", "identifier": "...
{ "fields": [ { "declarator": "keys", "modifier": "private final", "original_string": "private final KeyStorageStrategy keys;", "type": "KeyStorageStrategy", "var_name": "keys" }, { "declarator": "executor", "modifier": "private final", "original_string": "p...
{ "body": "@Override\n public CompletableFuture<Void> put(String fileKey, KeyMaterial keyMaterial) {\n return CompletableFuture.supplyAsync(() -> {\n keys.put(fileKey, keyMaterial);\n return null;\n }, executor);\n }", "class_method_signature": "DefaultAsyncKeyStorageStrate...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_36
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testAppend() {\n assertThatExceptionOfType(UnsupportedOperationException.class)\n .isThrownBy(() -> mockedEfs.append(path, 0, null))\n .withMessage(\"appending to encrypted files is not supported\");\n }", "class_method_signature": "Encrypted...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public FSDataOutputStream append(Path _path, int _bufferSize, Progressable _progress) throws IOException {\n throw new UnsupportedOperationException(\"appending to encrypted files is not supported\");\n }", "class_method_signature": "EncryptedFileSystem.append(Path _path, int _bu...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_20
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testRename_normalizePathPassedToKeyStore() throws IOException {\n mockedEfs.rename(new Path(\"src//foo\"), new Path(\"dst//bar\"));\n\n verify(mockKeyStore).get(\"src/foo\");\n verify(mockKeyStore).put(\"dst/bar\", keyMaterial);\n verify(mockKeyStore).remo...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public boolean rename(Path src, Path dst) throws IOException {\n // Copy key material first so the encrypted file always has key material in the key store even if the\n // put or rename fails\n KeyMaterial keyMaterial = keyStore.get(src.toString());\n keyStore.put...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_77
{ "fields": [ { "declarator": "chained", "modifier": "private", "original_string": "private KeyStorageStrategy chained;", "type": "KeyStorageStrategy", "var_name": "chained" }, { "declarator": "successfulStrategy", "modifier": "private", "original_string": "...
{ "body": "@Test\n public void testFailedGetIgnored() {\n chained = new ChainedKeyStorageStrategy(failingStrategy, successfulStrategy);\n\n assertThat(chained.get(key)).isEqualTo(keyMaterial);\n\n InOrder inOrder = inOrder(successfulStrategy, failingStrategy);\n inOrder.verify(failingSt...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ChainedKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(ChainedKeyStorageStrategy.class);", "type": "Logger", "var_name": "l...
{ "body": "@Override\n public KeyMaterial get(String fileKey) {\n List<Exception> suppressedExceptions = new ArrayList<>();\n for (KeyStorageStrategy strategy : strategies) {\n try {\n return strategy.get(fileKey);\n } catch (Exception e) {\n suppre...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_57
{ "fields": [ { "declarator": "KEY_ALG = \"AES\"", "modifier": "private static final", "original_string": "private static final String KEY_ALG = \"AES\";", "type": "String", "var_name": "KEY_ALG" }, { "declarator": "KEY_SIZE = 128", "modifier": "private static fin...
{ "body": "@Test\n public void testGenerateKey() {\n SecretKey secretKey = KeyMaterials.generateKey(KEY_ALG, KEY_SIZE);\n assertThat(secretKey.getAlgorithm()).isEqualTo(KEY_ALG);\n }", "class_method_signature": "KeyMaterialsTest.testGenerateKey()", "constructor": false, "full_signature": "@T...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(KeyMaterials.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(KeyMaterials.class);", "type": "Logger", "var_name": "log" }, { "declarat...
{ "body": "public static SecretKey generateKey(String keyAlgorithm, int keySize) {\n try {\n KeyGenerator keyGen = KeyGenerator.getInstance(keyAlgorithm);\n keyGen.init(getSafeKeyLength(keyAlgorithm, keySize));\n return keyGen.generateKey();\n } catch (NoSuchAlgorithmExc...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_41
{ "fields": [ { "declarator": "bytes = \"bytes\".getBytes(StandardCharsets.UTF_8)", "modifier": "private static final", "original_string": "private static final byte[] bytes = \"bytes\".getBytes(StandardCharsets.UTF_8);", "type": "byte[]", "var_name": "bytes" }, { "decl...
{ "body": "@Test\n public void testWrite() throws IOException {\n scos.write(0);\n verify(cos).write(0);\n }", "class_method_signature": "FsCipherOutputStreamTest.testWrite()", "constructor": false, "full_signature": "@Test public void testWrite()", "identifier": "testWrite", "invocation...
{ "fields": [], "file": "hadoop-crypto/src/main/java/com/palantir/crypto2/hadoop/cipher/FsCipherOutputStream.java", "identifier": "FsCipherOutputStream", "interfaces": "", "methods": [ { "class_method_signature": "FsCipherOutputStream.FsCipherOutputStream(FSDataOutputStream delegate, SeekableCipher ...
{ "body": "@Override\n public void write(byte[] bytes, int off, int len) throws IOException {\n out.write(bytes, off, len);\n }", "class_method_signature": "FsCipherOutputStream.write(byte[] bytes, int off, int len)", "constructor": false, "full_signature": "@Override public void write(byte[] bytes...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_16
{ "fields": [ { "declarator": "EFS_URI = URI.create(\"efile:///\")", "modifier": "private static final", "original_string": "private static final URI EFS_URI = URI.create(\"efile:///\");", "type": "URI", "var_name": "EFS_URI" }, { "declarator": "DATA = \"data\"", ...
{ "body": "@Test\n public void testOnlyPublicKey() throws IOException {\n byte[] dataBytes = DATA.getBytes(StandardCharsets.UTF_8);\n byte[] readData = new byte[DATA.length()];\n\n conf.unset(StandaloneEncryptedFileSystem.PRIVATE_KEY_CONF);\n FileSystem efsPublic = FileSystem.newInstanc...
{ "fields": [ { "declarator": "SCHEME = \"\"", "modifier": "private static final", "original_string": "private static final String SCHEME = \"\";", "type": "String", "var_name": "SCHEME" }, { "declarator": "DEFAULT_ALGORITHM = \"RSA\"", "modifier": "private static...
{ "body": "@Override\n public boolean exists(Path path) throws IOException {\n return fs.exists(path);\n }", "class_method_signature": "StandaloneEncryptedFileSystem.exists(Path path)", "constructor": false, "full_signature": "@Override public boolean exists(Path path)", "identifier": "exists", ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_0
{ "fields": [ { "declarator": "PATH = new Path(\"/dummy/path\")", "modifier": "private static final", "original_string": "private static final Path PATH = new Path(\"/dummy/path\");", "type": "Path", "var_name": "PATH" }, { "declarator": "DELEGATE_PATH = new Path(\"/del...
{ "body": "@Test\n public void getUri() throws Exception {\n when(delegate.getUri()).thenReturn(DELEGATE_URI);\n URI actualUri = convertingFs.getUri();\n\n assertThat(actualUri).isEqualTo(RETURN_URI);\n }", "class_method_signature": "PathConvertingFileSystemTest.getUri()", "constructor"...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final FileSystem delegate;", "type": "FileSystem", "var_name": "delegate" }, { "declarator": "toFunc", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public URI getUri() {\n return fromUriFunc.apply(delegate.getUri());\n }", "class_method_signature": "PathConvertingFileSystem.getUri()", "constructor": false, "full_signature": "@Override public URI getUri()", "identifier": "getUri", "invocations": [ "apply", "ge...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_1
{ "fields": [ { "declarator": "PATH = new Path(\"/dummy/path\")", "modifier": "private static final", "original_string": "private static final Path PATH = new Path(\"/dummy/path\");", "type": "Path", "var_name": "PATH" }, { "declarator": "DELEGATE_PATH = new Path(\"/del...
{ "body": "@Test\n public void open() throws Exception {\n when(delegate.open(DELEGATE_PATH, 0)).thenReturn(inputStream);\n FSDataInputStream actualStream = convertingFs.open(PATH, 0);\n\n assertThat(actualStream).isEqualTo(inputStream);\n }", "class_method_signature": "PathConvertingFile...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final FileSystem delegate;", "type": "FileSystem", "var_name": "delegate" }, { "declarator": "toFunc", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public FSDataInputStream open(Path path, int bufferSize) throws IOException {\n return delegate.open(to(path), bufferSize);\n }", "class_method_signature": "PathConvertingFileSystem.open(Path path, int bufferSize)", "constructor": false, "full_signature": "@Override public FS...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_17
{ "fields": [ { "declarator": "EFS_URI = URI.create(\"efile:///\")", "modifier": "private static final", "original_string": "private static final URI EFS_URI = URI.create(\"efile:///\");", "type": "URI", "var_name": "EFS_URI" }, { "declarator": "DATA = \"data\"", ...
{ "body": "@Test\n public void testListStatus_keyMaterialFilesFiltered() throws IOException {\n OutputStream os = efs.create(path);\n os.write(0x00);\n os.close();\n\n FileStatus[] fileStatus = efs.listStatus(path);\n FileStatus[] fileStatuses = efs.listStatus(path.getParent());\...
{ "fields": [ { "declarator": "SCHEME = \"\"", "modifier": "private static final", "original_string": "private static final String SCHEME = \"\";", "type": "String", "var_name": "SCHEME" }, { "declarator": "DEFAULT_ALGORITHM = \"RSA\"", "modifier": "private static...
{ "body": "@Override\n // TODO(jellis): consider moving logic related to FileKeyStorageStrategy into a separate FileSystem\n public FileStatus[] listStatus(Path path) throws IOException {\n Collection<FileStatus> files = Collections2.filter(Arrays.asList(fs.listStatus(path)), NOT_KEY_MATERIAL);\n ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_40
{ "fields": [ { "declarator": "remotePath = new Path(\"/test\")", "modifier": "private static final", "original_string": "private static final Path remotePath = new Path(\"/test\");", "type": "Path", "var_name": "remotePath" }, { "declarator": "bytes = \"data\".getBytes...
{ "body": "@Test\n public void testGetFileBlockLocations() throws IOException {\n Path path = new Path(\"test-path\");\n BlockLocation location = new BlockLocation(\n new String[] {\"some-host:50010\"}, new String[] {\"some-host\"}, 0L, 0L);\n when(delegate.getFileBlockLocations...
{ "fields": [], "file": "hadoop-crypto/src/main/java/com/palantir/crypto2/hadoop/DelegatingFileSystem.java", "identifier": "DelegatingFileSystem", "interfaces": "", "methods": [ { "class_method_signature": "DelegatingFileSystem.DelegatingFileSystem(FileSystem delegate)", "constructor": true, ...
{ "body": "@Override\n public final BlockLocation[] getFileBlockLocations(Path path, long start, long len) throws IOException {\n return fs.getFileBlockLocations(path, start, len);\n }", "class_method_signature": "DelegatingFileSystem.getFileBlockLocations(Path path, long start, long len)", "construc...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_56
{ "fields": [ { "declarator": "supplier", "modifier": "private", "original_string": "private CipherStreamSupplier supplier;", "type": "CipherStreamSupplier", "var_name": "supplier" }, { "declarator": "is", "modifier": "private", "original_string": "private I...
{ "body": "@Test\n public void testGetCipherOutputStream() {\n assertThat(supplier.getOutputStream(os, cipher)).isInstanceOf(CipherOutputStream.class);\n }", "class_method_signature": "CipherStreamSupplierImplTest.testGetCipherOutputStream()", "constructor": false, "full_signature": "@Test public v...
{ "fields": [], "file": "crypto-core/src/main/java/com/palantir/crypto2/cipher/CipherStreamSupplierImpl.java", "identifier": "CipherStreamSupplierImpl", "interfaces": "implements CipherStreamSupplier", "methods": [ { "class_method_signature": "CipherStreamSupplierImpl.getInputStream(InputStream is, ...
{ "body": "@Override\n public CipherOutputStream getOutputStream(OutputStream os, Cipher cipher) {\n return new CipherOutputStream(os, cipher);\n }", "class_method_signature": "CipherStreamSupplierImpl.getOutputStream(OutputStream os, Cipher cipher)", "constructor": false, "full_signature": "@Overr...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_76
{ "fields": [ { "declarator": "chained", "modifier": "private", "original_string": "private KeyStorageStrategy chained;", "type": "KeyStorageStrategy", "var_name": "chained" }, { "declarator": "successfulStrategy", "modifier": "private", "original_string": "...
{ "body": "@Test\n public void testGetSucceeds() {\n assertThat(chained.get(key)).isEqualTo(keyMaterial);\n\n InOrder inOrder = inOrder(successfulStrategy, failingStrategy);\n inOrder.verify(successfulStrategy).get(key);\n verifyNoMoreInteractions(successfulStrategy, failingStrategy);\n...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ChainedKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(ChainedKeyStorageStrategy.class);", "type": "Logger", "var_name": "l...
{ "body": "@Override\n public KeyMaterial get(String fileKey) {\n List<Exception> suppressedExceptions = new ArrayList<>();\n for (KeyStorageStrategy strategy : strategies) {\n try {\n return strategy.get(fileKey);\n } catch (Exception e) {\n suppre...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_21
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testRename_successful() throws IOException {\n KeyMaterial actualKeyMaterial = keyStore.get(path.toString());\n\n efs.rename(path, newPath);\n\n assertThat(efs.exists(path)).isFalse();\n assertThat(efs.exists(newPath)).isTrue();\n\n assertThat(keySt...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public boolean rename(Path src, Path dst) throws IOException {\n // Copy key material first so the encrypted file always has key material in the key store even if the\n // put or rename fails\n KeyMaterial keyMaterial = keyStore.get(src.toString());\n keyStore.put...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_37
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test // https://github.com/palantir/hadoop-crypto/issues/27\n public void testCopyFromLocalFile() throws IOException {\n File file = folder.newFile();\n byte[] data = \"data\".getBytes(StandardCharsets.UTF_8);\n byte[] readBytes = new byte[data.length];\n\n IOUtils.write(dat...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public FSDataInputStream open(Path path, int bufferSize) throws IOException {\n FSDataInputStream encryptedStream = fs.open(path, bufferSize);\n\n KeyMaterial keyMaterial = keyStore.get(path.toString());\n\n return new FSDataInputStream(new FsCipherInputStream(encryptedS...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_60
{ "fields": [], "file": "crypto-keys/src/test/java/com/palantir/crypto2/keys/PublicKeysTest.java", "identifier": "PublicKeysTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFrom_generatesEquivalent() {\n PublicKey expectedKey = TestKeyPairs.generateKeyPair().getPublic();\n PublicKey actualKey = PublicKeys.from(expectedKey.getAlgorithm(), expectedKey.getEncoded());\n assertThat(actualKey).isEqualTo(expectedKey);\n }", "class...
{ "fields": [], "file": "crypto-keys/src/main/java/com/palantir/crypto2/keys/PublicKeys.java", "identifier": "PublicKeys", "interfaces": "", "methods": [ { "class_method_signature": "PublicKeys.PublicKeys()", "constructor": true, "full_signature": "private PublicKeys()", "identifi...
{ "body": "public static PublicKey from(String algorithm, byte[] encodedKey) {\n try {\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(encodedKey);\n KeyFactory keyFactory = KeyFactory.getInstance(algorithm);\n return keyFactory.generatePublic(keySpec);\n } catch (...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_51
{ "fields": [ { "declarator": "AES_CTR = AesCtrCipher.ALGORITHM", "modifier": "private static final", "original_string": "private static final String AES_CTR = AesCtrCipher.ALGORITHM;", "type": "String", "var_name": "AES_CTR" }, { "declarator": "AES_CBC = AesCbcCipher.A...
{ "body": "@Test\n public void testGetAesCbc_noKeyMaterial() {\n SeekableCipher cipher = SeekableCipherFactory.getCipher(AES_CBC);\n assertThat(cipher).isInstanceOf(AesCbcCipher.class);\n assertThat(cipher.getKeyMaterial()).isNotNull();\n }", "class_method_signature": "SeekableCipherFacto...
{ "fields": [], "file": "crypto-core/src/main/java/com/palantir/crypto2/cipher/SeekableCipherFactory.java", "identifier": "SeekableCipherFactory", "interfaces": "", "methods": [ { "class_method_signature": "SeekableCipherFactory.SeekableCipherFactory()", "constructor": true, "full_signat...
{ "body": "@Deprecated\n public static SeekableCipher getCipher(String cipherAlgorithm) {\n switch (cipherAlgorithm) {\n case AesCtrCipher.ALGORITHM:\n return getCipher(cipherAlgorithm, AesCtrCipher.generateKeyMaterial());\n case AesCbcCipher.ALGORITHM:\n ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_47
{ "fields": [ { "declarator": "AES_CTR = AesCtrCipher.ALGORITHM", "modifier": "private static final", "original_string": "private static final String AES_CTR = AesCtrCipher.ALGORITHM;", "type": "String", "var_name": "AES_CTR" }, { "declarator": "AES_CBC = AesCbcCipher.A...
{ "body": "@Test\n public void testGenerateKeyMaterial_aesCtr() {\n KeyMaterial keyMaterial = SeekableCipherFactory.generateKeyMaterial(AES_CTR);\n String algorithm = keyMaterial.getSecretKey().getAlgorithm();\n assertThat(algorithm).isEqualTo(\"AES\");\n }", "class_method_signature": "Se...
{ "fields": [], "file": "crypto-core/src/main/java/com/palantir/crypto2/cipher/SeekableCipherFactory.java", "identifier": "SeekableCipherFactory", "interfaces": "", "methods": [ { "class_method_signature": "SeekableCipherFactory.SeekableCipherFactory()", "constructor": true, "full_signat...
{ "body": "public static KeyMaterial generateKeyMaterial(String cipherAlgorithm) {\n switch (cipherAlgorithm) {\n case AesCtrCipher.ALGORITHM:\n return AesCtrCipher.generateKeyMaterial();\n case AesCbcCipher.ALGORITHM:\n return AesCbcCipher.generateKeyMateria...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_10
{ "fields": [ { "declarator": "PATH = new Path(\"/dummy/path\")", "modifier": "private static final", "original_string": "private static final Path PATH = new Path(\"/dummy/path\");", "type": "Path", "var_name": "PATH" }, { "declarator": "DELEGATE_PATH = new Path(\"/del...
{ "body": "@Test\n public void getWorkingDirectory() throws Exception {\n when(delegate.getWorkingDirectory()).thenReturn(DELEGATE_PATH);\n Path workingDirectory = convertingFs.getWorkingDirectory();\n\n assertThat(workingDirectory).isEqualTo(RETURN_PATH);\n }", "class_method_signature": ...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final FileSystem delegate;", "type": "FileSystem", "var_name": "delegate" }, { "declarator": "toFunc", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public Path getWorkingDirectory() {\n return from(delegate.getWorkingDirectory());\n }", "class_method_signature": "PathConvertingFileSystem.getWorkingDirectory()", "constructor": false, "full_signature": "@Override public Path getWorkingDirectory()", "identifier": "getWork...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_6
{ "fields": [ { "declarator": "PATH = new Path(\"/dummy/path\")", "modifier": "private static final", "original_string": "private static final Path PATH = new Path(\"/dummy/path\");", "type": "Path", "var_name": "PATH" }, { "declarator": "DELEGATE_PATH = new Path(\"/del...
{ "body": "@Test\n public void makeQualified() {\n when(delegate.makeQualified(DELEGATE_PATH)).thenReturn(DELEGATE_PATH);\n Path path = convertingFs.makeQualified(PATH);\n\n assertThat(path).isEqualTo(RETURN_PATH);\n }", "class_method_signature": "PathConvertingFileSystemTest.makeQualifie...
{ "fields": [ { "declarator": "delegate", "modifier": "private final", "original_string": "private final FileSystem delegate;", "type": "FileSystem", "var_name": "delegate" }, { "declarator": "toFunc", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public Path makeQualified(Path path) {\n return from(delegate.makeQualified(to(path)));\n }", "class_method_signature": "PathConvertingFileSystem.makeQualified(Path path)", "constructor": false, "full_signature": "@Override public Path makeQualified(Path path)", "identifier...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_67
{ "fields": [ { "declarator": "EXECUTOR = MoreExecutors.directExecutor()", "modifier": "private static final", "original_string": "private static final Executor EXECUTOR = MoreExecutors.directExecutor();", "type": "Executor", "var_name": "EXECUTOR" }, { "declarator": "V...
{ "body": "@Test\n public void testPut_allCalled() {\n chained = new ChainedAsyncKeyStorageStrategy(EXECUTOR, successfulStrategy, successfulStrategy);\n\n chained.put(KEY, keyMaterial).join();\n\n verify(successfulStrategy, times(2)).put(KEY, keyMaterial);\n verifyNoMoreInteractions(suc...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n public CompletableFuture<Void> put(String fileKey, KeyMaterial keyMaterial) {\n return applyToStrategies(strategy -> strategy.put(fileKey, keyMaterial));\n }", "class_method_signature": "ChainedAsyncKeyStorageStrategy.put(String fileKey, KeyMaterial keyMaterial)", "constructor"...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_30
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testGetCipherAlgorithm_bothConfigured() throws IOException, URISyntaxException {\n String cipherAlg = \"cipherAlg\";\n\n Configuration conf = new Configuration();\n conf.set(EncryptedFileSystem.CIPHER_ALGORITHM_KEY, cipherAlg);\n conf.set(EncryptedFileSyst...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@VisibleForTesting\n String getCipherAlgorithm() {\n Optional<String> cipher = Optional.ofNullable(getConf().get(CIPHER_ALGORITHM_KEY));\n Optional<String> deprecatedCipher = Optional.ofNullable(getConf().get(DEPRECATED_CIPHER_ALGORITHM_KEY));\n\n if (cipher.isPresent() && deprecate...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_26
{ "fields": [ { "declarator": "MB = 1024 * 1024", "modifier": "private static final", "original_string": "private static final int MB = 1024 * 1024;", "type": "int", "var_name": "MB" }, { "declarator": "random = new Random()", "modifier": "private static final", ...
{ "body": "@Test\n public void testRename_failedRenameFailedRemoveIsIgnored() throws IOException {\n when(mockFs.rename(path, newPath)).thenReturn(false);\n doThrow(new IllegalArgumentException()).when(mockKeyStore).remove(anyString());\n\n assertThat(mockedEfs.rename(path, newPath)).isFalse()...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(EncryptedFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(EncryptedFileSystem.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n public boolean rename(Path src, Path dst) throws IOException {\n // Copy key material first so the encrypted file always has key material in the key store even if the\n // put or rename fails\n KeyMaterial keyMaterial = keyStore.get(src.toString());\n keyStore.put...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_71
{ "fields": [ { "declarator": "EXECUTOR = MoreExecutors.directExecutor()", "modifier": "private static final", "original_string": "private static final Executor EXECUTOR = MoreExecutors.directExecutor();", "type": "Executor", "var_name": "EXECUTOR" }, { "declarator": "V...
{ "body": "@Test\n public void testGet_AllStrategiesFail() {\n chained = new ChainedAsyncKeyStorageStrategy(EXECUTOR, failingStrategy);\n\n assertThatExceptionOfType(CompletionException.class)\n .isThrownBy(() -> chained.get(KEY).join())\n .withCauseInstanceOf(RuntimeExc...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n public CompletableFuture<KeyMaterial> get(String fileKey) {\n return CompletableFuture.supplyAsync(() -> {\n List<Exception> suppressedExceptions = new ArrayList<>();\n for (AsyncKeyStorageStrategy strategy : strategies) {\n try {\n ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...
62156481_70
{ "fields": [ { "declarator": "EXECUTOR = MoreExecutors.directExecutor()", "modifier": "private static final", "original_string": "private static final Executor EXECUTOR = MoreExecutors.directExecutor();", "type": "Executor", "var_name": "EXECUTOR" }, { "declarator": "V...
{ "body": "@Test\n public void testGet_FailedGetIgnored() {\n chained = new ChainedAsyncKeyStorageStrategy(EXECUTOR, failingStrategy, successfulStrategy);\n\n assertThat(chained.get(KEY).join()).isEqualTo(keyMaterial);\n\n verify(failingStrategy).get(KEY);\n verify(successfulStrategy).g...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ChainedAsyncKeyStorageStrategy.class);", "type": "Logger", "var_name"...
{ "body": "@Override\n public CompletableFuture<KeyMaterial> get(String fileKey) {\n return CompletableFuture.supplyAsync(() -> {\n List<Exception> suppressedExceptions = new ArrayList<>();\n for (AsyncKeyStorageStrategy strategy : strategies) {\n try {\n ...
{ "created": "6/28/2016 4:18:49 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 62156481, "size": null, "stargazer_count": null, "stars": 27, "updates": "2020-01-20T18:40:59+00:00", "url": "https://github.com/palantir/hadoop-c...