id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
36960637_479 | {
"fields": [
{
"declarator": "LOW_TS = 10L",
"modifier": "private static final",
"original_string": "private static final long LOW_TS = 10L;",
"type": "long",
"var_name": "LOW_TS"
},
{
"declarator": "LOW_TS2 = 2 * LOW_TS",
"modifier": "private static final",
... | {
"body": "@Test\n public void conservativeSweepCallsFollower() {\n enqueueWriteCommitted(TABLE_CONS, LOW_TS);\n enqueueWriteCommitted(TABLE_CONS, LOW_TS2);\n sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD));\n\n ArgumentCaptor<Set> captor = ArgumentCaptor.forClass(Set.class);\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_880 | {
"fields": [
{
"declarator": "timelock",
"modifier": "@Mock private",
"original_string": "@Mock private NamespacedConjureTimelockService timelock;",
"type": "NamespacedConjureTimelockService",
"var_name": "timelock"
},
{
"declarator": "lockRequest",
"modifier": "... | {
"body": "@Test\n public void shouldHandleUnsuccessfulLockResponses() {\n when(timelock.lock(any())).thenReturn(ConjureLockResponse.unsuccessful(UnsuccessfulLockResponse.of()));\n\n LockResponse clientResponse = lockLeaseService.lock(lockRequest);\n assertThat(clientResponse.wasSuccessful()).... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final NamespacedConjureTimelockService delegate;",
"type": "NamespacedConjureTimelockService",
"var_name": "delegate"
},
{
"declarator": "clientId",
"modifier": "pri... | {
"body": "LockResponse lock(LockRequest request) {\n return lockService.lock(request);\n }",
"class_method_signature": "LockLeaseService.lock(LockRequest request)",
"constructor": false,
"full_signature": " LockResponse lock(LockRequest request)",
"identifier": "lock",
"invocations": [
"lock"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_496 | {
"fields": [
{
"declarator": "LOW_TS = 10L",
"modifier": "private static final",
"original_string": "private static final long LOW_TS = 10L;",
"type": "long",
"var_name": "LOW_TS"
},
{
"declarator": "LOW_TS2 = 2 * LOW_TS",
"modifier": "private static final",
... | {
"body": "@Test\n public void sweepableCellsGetsScrubbedWheneverPartitionIsCompletelySwept() {\n for (int i = 0; i < readBatchSize; i++) {\n long referenceTimestamp = LOW_TS + SweepQueueUtils.minTsForFinePartition(i);\n enqueueWriteCommitted(TABLE_CONS, referenceTimestamp);\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_59 | {
"fields": [
{
"declarator": "TIMESTAMP = 12345L",
"modifier": "private static final",
"original_string": "private static final long TIMESTAMP = 12345L;",
"type": "long",
"var_name": "TIMESTAMP"
},
{
"declarator": "INITIAL_UPPER_LIMIT = 10L",
"modifier": "private... | {
"body": "@Test\n public void shouldNotIncreaseTheUpperLimitIfWouldOverflow() {\n assertThatExceptionOfType(ArithmeticException.class)\n .isThrownBy(() -> upperLimit.increaseToAtLeast(Long.MAX_VALUE - BUFFER + 1));\n }",
"class_method_signature": "PersistentUpperLimitTest.shouldNotIncre... | {
"fields": [
{
"declarator": "BUFFER = 1_000_000",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final long BUFFER = 1_000_000;",
"type": "long",
"var_name": "BUFFER"
},
{
"declarator": "currentLimit",
"mod... | {
"body": "public void increaseToAtLeast(long newLimit) {\n if (newLimit > currentLimit) {\n updateLimit(newLimit);\n }\n }",
"class_method_signature": "PersistentUpperLimit.increaseToAtLeast(long newLimit)",
"constructor": false,
"full_signature": "public void increaseToAtLeast(long... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_253 | {
"fields": [
{
"declarator": "SIMPLE_NAME_METADATA_DESCRIPTION = NameMetadataDescription.safe(\n \"string\", ValueType.STRING)",
"modifier": "private static final",
"original_string": "private static final NameMetadataDescription SIMPLE_NAME_METADATA_DESCRIPTION = NameMetadataDescrip... | {
"body": "@Test\n public void differentOrderingOfFieldsInSerializedPrefixIsAcceptable() {\n String jumbledPrefix = \"{\\\"beta\\\": \\\"AAAAAAA==\\\", \\\"alpha\\\": 42}\";\n assertThat(MULTIPART_NAME_METADATA_DESCRIPTION.parseFromJson(jumbledPrefix, true))\n .containsExactly(SAMPLE_R... | {
"fields": [
{
"declarator": "HASH_ROW_COMPONENT_NAME = \"hashOfRowComponents\"",
"modifier": "public static final",
"original_string": "public static final String HASH_ROW_COMPONENT_NAME = \"hashOfRowComponents\";",
"type": "String",
"var_name": "HASH_ROW_COMPONENT_NAME"
},
... | {
"body": "public byte[] parseFromJson(String json, boolean allowPrefix) {\n try {\n JsonNode jsonNode = OBJECT_MAPPER.readTree(json);\n Preconditions.checkState(jsonNode.isObject(),\n \"Only JSON objects can be deserialized into parsed byte arrays. Passed json was: %s... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_603 | {
"fields": [
{
"declarator": "delegate = mock(TransactionService.class)",
"modifier": "private final",
"original_string": "private final TransactionService delegate = mock(TransactionService.class);",
"type": "TransactionService",
"var_name": "delegate"
},
{
"declarato... | {
"body": "@Test\n public void passesThroughGetsOnMultipleValidTimestamps() {\n Map<Long, Long> result = preStartHandlingService.get(TWO_VALID_TIMESTAMPS);\n assertThat(result).containsExactly(Maps.immutableEntry(START_TIMESTAMP, COMMIT_TIMESTAMP));\n verify(delegate).get(eq(TWO_VALID_TIMESTAM... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final TransactionService delegate;",
"type": "TransactionService",
"var_name": "delegate"
},
{
"declarator": "synchronousAsyncTransactionService",
"modifier": "priva... | {
"body": "@CheckForNull\n @Override\n public Long get(long startTimestamp) {\n return AtlasFutures.getUnchecked(getInternal(startTimestamp, synchronousAsyncTransactionService));\n }",
"class_method_signature": "PreStartHandlingTransactionService.get(long startTimestamp)",
"constructor": false,
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_316 | {
"fields": [
{
"declarator": "ARG_NAME = \"argName\"",
"modifier": "private static final",
"original_string": "private static final String ARG_NAME = \"argName\";",
"type": "String",
"var_name": "ARG_NAME"
},
{
"declarator": "SAFE_TABLE_REFERENCE = TableReference.creat... | {
"body": "@Test\n public void returnsSafeRangeWhenAllSafe() {\n assertThat(LoggingArgs.range(SAFE_TABLE_REFERENCE, SAFE_RANGE_REQUEST))\n .isInstanceOf(SafeArg.class);\n }",
"class_method_signature": "LoggingArgsTest.returnsSafeRangeWhenAllSafe()",
"constructor": false,
"full_signat... | {
"fields": [
{
"declarator": "PLACEHOLDER_TABLE_NAME = \"{table}\"",
"modifier": "private static final",
"original_string": "private static final String PLACEHOLDER_TABLE_NAME = \"{table}\";",
"type": "String",
"var_name": "PLACEHOLDER_TABLE_NAME"
},
{
"declarator": "P... | {
"body": "public static Arg<RangeRequest> range(TableReference tableReference, RangeRequest range) {\n return getArg(\"range\",\n range,\n range.getColumnNames().stream().allMatch(\n (columnName) -> logArbitrator.isColumnNameSafe(tableReference, PtBytes.toS... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_746 | {
"fields": [
{
"declarator": "DC_1 = \"dc1\"",
"modifier": "private static final",
"original_string": "private static final String DC_1 = \"dc1\";",
"type": "String",
"var_name": "DC_1"
},
{
"declarator": "DC_2 = \"dc2\"",
"modifier": "private static final",
... | {
"body": "@Test\n public void oneDcOneRackAndMoreHostsThanRfThrows() throws TException {\n setTopology(createDetails(DC_1, RACK_1, HOST_1),\n createDetails(DC_1, RACK_1, HOST_2),\n createDetails(DC_1, RACK_1, HOST_3),\n createDetails(DC_1, RACK_1, HOST_4));\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraVerifier.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraVerifier.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "static Set<String> sanityCheckDatacenters(CassandraClient client, CassandraKeyValueServiceConfig config)\n throws TException {\n createSimpleRfTestKeyspaceIfNotExists(client);\n\n Multimap<String, String> datacenterToRack = HashMultimap.create();\n Set<String> hosts = Sets.n... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_896 | {
"fields": [
{
"declarator": "TOKEN_1 = LockToken.of(UUID.randomUUID())",
"modifier": "private static final",
"original_string": "private static final LockToken TOKEN_1 = LockToken.of(UUID.randomUUID());",
"type": "LockToken",
"var_name": "TOKEN_1"
},
{
"declarator": "... | {
"body": "@Test\n public void waitForLocksDelegates() {\n WaitForLocksRequest request = WaitForLocksRequest.of(LOCKS, TIMEOUT);\n timelock.waitForLocks(request);\n\n verify(delegate).waitForLocks(request);\n verifyNoMoreInteractions(refresher);\n }",
"class_method_signature": "Tim... | {
"fields": [
{
"declarator": "refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\")",
"modifier": "private static final",
"original_string": "private static final ScheduledExecutorService refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\");",
"type": "Scheduled... | {
"body": "@Override\n public WaitForLocksResponse waitForLocks(WaitForLocksRequest request) {\n return executeOnTimeLock(() -> delegate.waitForLocks(request));\n }",
"class_method_signature": "TimeLockClient.waitForLocks(WaitForLocksRequest request)",
"constructor": false,
"full_signature": "@Over... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_195 | {
"fields": [
{
"declarator": "REQUEST_1 = UUID.randomUUID()",
"modifier": "private static final",
"original_string": "private static final UUID REQUEST_1 = UUID.randomUUID();",
"type": "UUID",
"var_name": "REQUEST_1"
},
{
"declarator": "REQUEST_2 = UUID.randomUUID()",
... | {
"body": "@Test\n public void removesRequestIfSupplierThrows() {\n assertThatThrownBy(() ->\n awaitedLocks.getExistingOrAwait(REQUEST_1, () -> {\n throw new RuntimeException(\"foo\");\n })).isInstanceOf(RuntimeException.class);\n\n assertRequestsWereR... | {
"fields": [
{
"declarator": "requestsById = Maps.newConcurrentMap()",
"modifier": "@VisibleForTesting\n final",
"original_string": "@VisibleForTesting\n final ConcurrentMap<UUID, AsyncResult<Void>> requestsById = Maps.newConcurrentMap();",
"type": "ConcurrentMap<UUID, AsyncResult<V... | {
"body": "public AsyncResult<Void> getExistingOrAwait(\n UUID requestId,\n Supplier<AsyncResult<Void>> lockAwaiter) {\n AsyncResult<Void> result = requestsById.computeIfAbsent(\n requestId,\n ignored -> lockAwaiter.get());\n\n registerCompletionHandle... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_480 | {
"fields": [
{
"declarator": "LOW_TS = 10L",
"modifier": "private static final",
"original_string": "private static final long LOW_TS = 10L;",
"type": "long",
"var_name": "LOW_TS"
},
{
"declarator": "LOW_TS2 = 2 * LOW_TS",
"modifier": "private static final",
... | {
"body": "@Test\n public void thoroughSweepCallsFollower() {\n enqueueWriteCommitted(TABLE_THOR, LOW_TS);\n enqueueWriteCommitted(TABLE_THOR, LOW_TS2);\n sweepNextBatch(ShardAndStrategy.thorough(THOR_SHARD));\n\n ArgumentCaptor<Set> captor = ArgumentCaptor.forClass(Set.class);\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_879 | {
"fields": [
{
"declarator": "timelock",
"modifier": "@Mock private",
"original_string": "@Mock private NamespacedConjureTimelockService timelock;",
"type": "NamespacedConjureTimelockService",
"var_name": "timelock"
},
{
"declarator": "lockRequest",
"modifier": "... | {
"body": "@Test\n public void lockResponseHasCorrectLeasedLock() {\n Lease lease = getLease();\n when(timelock.lock(any()))\n .thenReturn(ConjureLockResponse.successful(SuccessfulLockResponse.of(LOCK_TOKEN, lease)));\n\n LockResponse clientResponse = lockLeaseService.lock(lockR... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final NamespacedConjureTimelockService delegate;",
"type": "NamespacedConjureTimelockService",
"var_name": "delegate"
},
{
"declarator": "clientId",
"modifier": "pri... | {
"body": "LockResponse lock(LockRequest request) {\n return lockService.lock(request);\n }",
"class_method_signature": "LockLeaseService.lock(LockRequest request)",
"constructor": false,
"full_signature": " LockResponse lock(LockRequest request)",
"identifier": "lock",
"invocations": [
"lock"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_654 | {
"fields": [
{
"declarator": "SWEEP_PRIORITY = TableReference.create(\n SweepSchema.INSTANCE.getNamespace(), SweepPriorityTable.getRawTableName())",
"modifier": "private static final",
"original_string": "private static final TableReference SWEEP_PRIORITY = TableReference.create(\n ... | {
"body": "@Test\n public void sweepPriorityTableIsASweepTable() {\n assertThat(KeyValueServiceValidators.isSweepTableReference(SWEEP_PRIORITY)).isTrue();\n }",
"class_method_signature": "KeyValueServiceValidatorsTest.sweepPriorityTableIsASweepTable()",
"constructor": false,
"full_signature": "@Tes... | {
"fields": [],
"file": "atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/schema/KeyValueServiceValidators.java",
"identifier": "KeyValueServiceValidators",
"interfaces": "",
"methods": [
{
"class_method_signature": "KeyValueServiceValidators.KeyValueServiceValidators()",
"constructor": ... | {
"body": "@VisibleForTesting\n static boolean isSweepTableReference(TableReference tableReference) {\n return tableReference.getNamespace().equals(SweepSchema.INSTANCE.getNamespace());\n }",
"class_method_signature": "KeyValueServiceValidators.isSweepTableReference(TableReference tableReference)",
"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_204 | {
"fields": [
{
"declarator": "WINDOW_SIZE = 10",
"modifier": "private static final",
"original_string": "private static final int WINDOW_SIZE = 10;",
"type": "int",
"var_name": "WINDOW_SIZE"
},
{
"declarator": "slidingWindow = new ArrayLockEventSlidingWindow(WINDOW_SIZ... | {
"body": "@Test\n public void whenNoNewEventsReturnEmptyList() {\n whenLogContainsEvents0To4();\n assertThat(slidingWindow.getNextEvents(4).get()).isEmpty();\n }",
"class_method_signature": "ArrayLockEventSlidingWindowTest.whenNoNewEventsReturnEmptyList()",
"constructor": false,
"full_signa... | {
"fields": [
{
"declarator": "buffer",
"modifier": "private final",
"original_string": "private final LockWatchEvent[] buffer;",
"type": "LockWatchEvent[]",
"var_name": "buffer"
},
{
"declarator": "maxSize",
"modifier": "private final",
"original_string": "... | {
"body": "public Optional<List<LockWatchEvent>> getNextEvents(long version) {\n if (versionInTheFuture(version) || versionTooOld(version)) {\n return Optional.empty();\n }\n int startIndex = LongMath.mod(version + 1, maxSize);\n int windowSize = Ints.saturatedCast(lastVersion()... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_711 | {
"fields": [
{
"declarator": "DEFAULT_VALUE = 123",
"modifier": "private static final",
"original_string": "private static final int DEFAULT_VALUE = 123;",
"type": "int",
"var_name": "DEFAULT_VALUE"
},
{
"declarator": "delegate = mock(Supplier.class)",
"modifier"... | {
"body": "@Test\n public void canCancelReturnedFuture() {\n SettableFuture<Long> future = SettableFuture.create();\n CoalescingSupplier<Long> supplier = new CoalescingSupplier<>(() -> Futures.getUnchecked(future));\n ListenableFuture<Long> returned = supplier.getAsync();\n returned.can... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final Supplier<T> delegate;",
"type": "Supplier<T>",
"var_name": "delegate"
},
{
"declarator": "executor =\n MoreExecutors.listeningDecorator(PTExecutors.newCac... | {
"body": "public ListenableFuture<T> getAsync() {\n return Futures.nonCancellationPropagating(getAsyncNotHandlingCancellation());\n }",
"class_method_signature": "CoalescingSupplier.getAsync()",
"constructor": false,
"full_signature": "public ListenableFuture<T> getAsync()",
"identifier": "getAsync... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_341 | {
"fields": [
{
"declarator": "NAME = CloseableTraceTest.class.getName()",
"modifier": "private static final",
"original_string": "private static final String NAME = CloseableTraceTest.class.getName();",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "observer"... | {
"body": "@Test\n public void noOp() throws Exception {\n assertSame(CloseableTrace.noOp(), CloseableTrace.noOp());\n }",
"class_method_signature": "CloseableTraceTest.noOp()",
"constructor": false,
"full_signature": "@Test public void noOp()",
"identifier": "noOp",
"invocations": [
"asser... | {
"fields": [
{
"declarator": "NO_OP = new CloseableTrace(null)",
"modifier": "private static final",
"original_string": "private static final CloseableTrace NO_OP = new CloseableTrace(null);",
"type": "CloseableTrace",
"var_name": "NO_OP"
},
{
"declarator": "trace",
... | {
"body": "public static CloseableTrace noOp() {\n return NO_OP;\n }",
"class_method_signature": "CloseableTrace.noOp()",
"constructor": false,
"full_signature": "public static CloseableTrace noOp()",
"identifier": "noOp",
"invocations": [],
"modifiers": "public static",
"parameters": "()",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_592 | {
"fields": [
{
"declarator": "EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L)",
"modifier": "private static final",
"original_string": "private static final Function<Long, Long> EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L);",
"type": "Function<Long, Long>",
"var_name": "EXT... | {
"body": "@Test\n public void putUnlessExistsThrowsIfFunctionReturnsUnmappedValue() {\n assertThatThrownBy(() -> delegatingTransactionService.putUnlessExists(4L, 12L))\n .isInstanceOf(IllegalStateException.class)\n .hasMessageContaining(\"Could not find a transaction service f... | {
"fields": [
{
"declarator": "timestampToServiceKey",
"modifier": "private final",
"original_string": "private final Function<Long, T> timestampToServiceKey;",
"type": "Function<Long, T>",
"var_name": "timestampToServiceKey"
},
{
"declarator": "keyedServices",
"m... | {
"body": "@Override\n public void putUnlessExists(long startTimestamp, long commitTimestamp) throws KeyAlreadyExistsException {\n TransactionService service = getServiceForTimestamp(keyedServices, startTimestamp).orElseThrow(\n () -> new UnsupportedOperationException(\"putUnlessExists should... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_438 | {
"fields": [
{
"declarator": "NOTHING = getTableRef(\"nothing\")",
"modifier": "private static final",
"original_string": "private static final TableReference NOTHING = getTableRef(\"nothing\");",
"type": "TableReference",
"var_name": "NOTHING"
},
{
"declarator": "CONS... | {
"body": "@Test\n public void getStrategyThrowsForIllegalMetadata() {\n when(mockKvs.getMetadataForTable(any())).thenReturn(AtlasDbConstants.EMPTY_TABLE_METADATA);\n assertThatThrownBy(() -> partitioner.getStrategy(getWriteInfoWithFixedCellHash(getTableRef(\"a\"), 0)))\n .isInstanceOf... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(WriteInfoPartitioner.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(WriteInfoPartitioner.class);",
"type": "Logger",
"var_name": "log"
},
{... | {
"body": "@VisibleForTesting\n Optional<SweeperStrategy> getStrategy(WriteInfo writeInfo) {\n return cache.getUnchecked(writeInfo.tableRef());\n }",
"class_method_signature": "WriteInfoPartitioner.getStrategy(WriteInfo writeInfo)",
"constructor": false,
"full_signature": "@VisibleForTesting Option... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_984 | {
"fields": [
{
"declarator": "CLIENT = \"testClient\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT = \"testClient\";",
"type": "String",
"var_name": "CLIENT"
},
{
"declarator": "SERVER_1 = \"http://localhost:8080\"",
... | {
"body": "@Test\n public void preservesAbsenceOfSslOnConversionToNamespacedServerListIfAbsent() {\n ImmutableServerListConfig serversListWithoutSsl = ImmutableServerListConfig.copyOf(SERVERS_LIST)\n .withSslConfiguration(Optional.empty());\n TimeLockClientConfig config = ImmutableTime... | {
"fields": [],
"file": "atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockClientConfig.java",
"identifier": "TimeLockClientConfig",
"interfaces": "",
"methods": [
{
"class_method_signature": "TimeLockClientConfig.client()",
"constructor": false,
"full_signature": "@Deprec... | {
"body": "public ServerListConfig toNamespacedServerList() {\n return ServerListConfigs.namespaceUris(serversList(), getClientOrThrow());\n }",
"class_method_signature": "TimeLockClientConfig.toNamespacedServerList()",
"constructor": false,
"full_signature": "public ServerListConfig toNamespacedServe... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_18 | {
"fields": [
{
"declarator": "RESULTS = SweepResults.builder()\n .nextStartRow(Optional.of(PtBytes.toBytes(\"ABC\")))\n .cellTsPairsExamined(1000L)\n .staleValuesDeleted(100L)\n .minSweptTimestamp(10L)\n .timeInMillis(1L)\n .timeSweepStarted... | {
"body": "@Test\n public void accumulateWithNextRowInOppositeOrder() {\n Assert.assertThat(OTHER_RESULTS.accumulateWith(RESULTS), Matchers.equalTo(COMBINED_RESULTS_AND_OTHER));\n }",
"class_method_signature": "SweepResultsTest.accumulateWithNextRowInOppositeOrder()",
"constructor": false,
"full_si... | {
"fields": [],
"file": "atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/SweepResults.java",
"identifier": "SweepResults",
"interfaces": "",
"methods": [
{
"class_method_signature": "SweepResults.getPreviousStartRowNullable()",
"constructor": false,
"full_signature": "@Nullab... | {
"body": "public SweepResults accumulateWith(SweepResults other) {\n return SweepResults.builder()\n .nextStartRow(maxRowOptional(getNextStartRow(), other.getNextStartRow()))\n .cellTsPairsExamined(getCellTsPairsExamined() + other.getCellTsPairsExamined())\n .stale... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_859 | {
"fields": [
{
"declarator": "tempFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "tempFolder"
},
{
"declarator": "sourc... | {
"body": "@Test\n public void eventuallyStopRetrying() {\n long lowerBound = 10;\n long upperBound = 25;\n insertValuesWithinBounds(lowerBound, upperBound, source);\n\n PaxosStateLog<PaxosValue> targetMock = mock(PaxosStateLog.class);\n Exception expectedException = new RuntimeE... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PaxosStateLogMigrator.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PaxosStateLogMigrator.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "public static <V extends Persistable & Versionable> long migrateAndReturnCutoff(MigrationContext<V> context) {\n PaxosStateLogMigrator<V> migrator = new PaxosStateLogMigrator<>(context.sourceLog(), context.destinationLog());\n if (!context.migrationState().isInMigratedState()) {\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_80 | {
"fields": [
{
"declarator": "NON_K8S_INSTANCE = new KubernetesHostnames(() -> \"fake-url\")",
"modifier": "private static final",
"original_string": "private static final KubernetesHostnames NON_K8S_INSTANCE = new KubernetesHostnames(() -> \"fake-url\");",
"type": "KubernetesHostnames",
... | {
"body": "@Test\n public void getClusterMembers_k8s() throws Exception {\n assertThat(K8S_INSTANCE.getClusterMembers(3)).containsOnly(\n \"svc-47775-0.svc-47775.namespace\",\n \"svc-47775-1.svc-47775.namespace\",\n \"svc-47775-2.svc-47775.namespace\");\n }",
... | {
"fields": [
{
"declarator": "INSTANCE = new KubernetesHostnames(() -> {\n try {\n return InetAddress.getLocalHost().getCanonicalHostName();\n } catch (UnknownHostException e) {\n throw new RuntimeException(e);\n }\n })",
"modifier": "public static final"... | {
"body": "public List<String> getClusterMembers(int expectedClusterSize) {\n Matcher podTemplateMatcher = getHostnameComponents();\n\n int ourPodId = Integer.parseInt(podTemplateMatcher.group(\"podId\"));\n Preconditions.checkArgument(ourPodId < expectedClusterSize,\n \"Current Po... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_336 | {
"fields": [
{
"declarator": "TABLE_REFERENCE_1 = TableReference.createFromFullyQualifiedName(\"atlas.db\")",
"modifier": "private static final",
"original_string": "private static final TableReference TABLE_REFERENCE_1 = TableReference.createFromFullyQualifiedName(\"atlas.db\");",
"type"... | {
"body": "@Test\n public void columnNamesMarkedSafeOnlyForOtherTablesAreNotSafe() {\n SafeLoggableData safeLoggableData = ImmutableSafeLoggableData.builder()\n .putPermittedColumnNames(TABLE_REFERENCE_1, ImmutableSet.of(COLUMN_NAME_1))\n .putPermittedColumnNames(TABLE_REFERENC... | {
"fields": [],
"file": "atlasdb-client/src/main/java/com/palantir/atlasdb/logging/SafeLoggableData.java",
"identifier": "SafeLoggableData",
"interfaces": "implements KeyValueServiceLogArbitrator",
"methods": [
{
"class_method_signature": "SafeLoggableData.permittedTableReferences()",
"constru... | {
"body": "@Override\n public boolean isRowComponentNameSafe(TableReference tableReference, String rowComponentName) {\n return permittedRowComponents().containsKey(tableReference)\n && permittedRowComponents().get(tableReference).contains(rowComponentName);\n }",
"class_method_signature... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_766 | {
"fields": [
{
"declarator": "CROSS_COLUMN_LIMIT = 3",
"modifier": "private static final",
"original_string": "private static final int CROSS_COLUMN_LIMIT = 3;",
"type": "int",
"var_name": "CROSS_COLUMN_LIMIT"
},
{
"declarator": "SINGLE_QUERY_LIMIT = 10",
"modifi... | {
"body": "@Test\n public void respondsToChangesInSingleQueryLimitBatchParameter() {\n AtomicReference<CassandraCellLoadingConfig> config = new AtomicReference<>(LOADING_CONFIG);\n CellLoadingBatcher reloadingBatcher = new CellLoadingBatcher(config::get, rebatchingCallback);\n updateConfig(con... | {
"fields": [
{
"declarator": "loadingConfigSupplier",
"modifier": "private final",
"original_string": "private final Supplier<CassandraCellLoadingConfig> loadingConfigSupplier;",
"type": "Supplier<CassandraCellLoadingConfig>",
"var_name": "loadingConfigSupplier"
},
{
"... | {
"body": "List<List<Cell>> partitionIntoBatches(\n Collection<Cell> cellsToPartition,\n InetSocketAddress host,\n TableReference tableReference) {\n CassandraCellLoadingConfig config = loadingConfigSupplier.get();\n\n ListMultimap<byte[], Cell> cellsByColumn = indexCell... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_789 | {
"fields": [
{
"declarator": "DEFAULT_PORT = 5000",
"modifier": "private static final",
"original_string": "private static final int DEFAULT_PORT = 5000;",
"type": "int",
"var_name": "DEFAULT_PORT"
},
{
"declarator": "OTHER_PORT = 6000",
"modifier": "private stat... | {
"body": "@Test\n public void shouldReturnAddressForSingleServer() throws UnknownHostException {\n CassandraService cassandra = clientPoolWithServers(ImmutableSet.of(HOST_1));\n\n InetSocketAddress resolvedHost = cassandra.getAddressForHost(HOSTNAME_1);\n\n assertThat(resolvedHost).isEqualTo(... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraClientPool.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraClientPool.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@VisibleForTesting\n InetSocketAddress getAddressForHost(String host) throws UnknownHostException {\n if (config.addressTranslation().containsKey(host)) {\n return config.addressTranslation().get(host);\n }\n\n InetAddress resolvedHost = InetAddress.getByName(host);\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_273 | {
"fields": [
{
"declarator": "testFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder testFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "testFolder"
},
{
"declarator": "CLASS... | {
"body": "@Test\n public void testLongTableNameLengthFailsNamespace() {\n // If namespace is non-empty, internal table name length is |namespace| + |tableName| + 2\n Schema schema = new Schema(\"Table\", TEST_PACKAGE, Namespace.DEFAULT_NAMESPACE);\n String longTableName = String.join(\"\", Co... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Schema.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(Schema.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "name",... | {
"body": "public void addTableDefinition(String tableName, TableDefinition definition) {\n Preconditions.checkArgument(\n !tableDefinitions.containsKey(tableName) && !indexDefinitions.containsKey(tableName),\n \"Table already defined: %s\", tableName);\n Preconditions.chec... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_623 | {
"fields": [
{
"declarator": "SETUP_TASK_METRIC_NAME =\n SnapshotTransactionManager.class.getCanonicalName() + \".setupTask\"",
"modifier": "private static final",
"original_string": "private static final String SETUP_TASK_METRIC_NAME =\n SnapshotTransactionManager.class.g... | {
"body": "@Test\n public void callsStartTransactionForReadOnlyTransactionsIfFlagIsSet() throws InterruptedException {\n TimelockService timelockService =\n spy(new LegacyTimelockService(timestampService, closeableLockService, LockClient.of(\"lock\")));\n when(closeableLockService.lock... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SnapshotTransactionManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SnapshotTransactionManager.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public <T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionReadOnly(\n C condition, ConditionAwareTransactionTask<T, C, E> task) throws E {\n if (transactionConfig.get().lockImmutableTsOnReadOnlyTransactions()) {\n return runTaskWithCondi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_38 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "atlasdb-dbkvs/src/t... | {
"body": "@Test\n public void shouldFailOn_9_5_1() {\n thrown.expectMessage(\"Versions 9.5.0 and 9.5.1 contain a known bug\");\n PostgresVersionCheck.checkDatabaseVersion(\"9.5.1\", mock(Logger.class));\n }",
"class_method_signature": "PostgresVersionCheckTest.shouldFailOn_9_5_1()",
"construc... | {
"fields": [
{
"declarator": "MIN_POSTGRES_VERSION = \"9.6\"",
"modifier": "static final",
"original_string": "static final String MIN_POSTGRES_VERSION = \"9.6\";",
"type": "String",
"var_name": "MIN_POSTGRES_VERSION"
}
],
"file": "atlasdb-dbkvs/src/main/java/com/palantir/at... | {
"body": "public static void checkDatabaseVersion(String version, Logger log) {\n boolean checkPasses = version.matches(\"^[\\\\.0-9]+$\")\n && VersionStrings.compareVersions(version, MIN_POSTGRES_VERSION) >= 0;\n if (VersionStrings.compareVersions(version, \"9.5\") >= 0\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_418 | {
"fields": [
{
"declarator": "metricsManager",
"modifier": "private",
"original_string": "private MetricsManager metricsManager;",
"type": "MetricsManager",
"var_name": "metricsManager"
},
{
"declarator": "legacyMetrics",
"modifier": "private",
"original_st... | {
"body": "@Test\n public void testTargetedSweepMetricsAreCumulative() {\n SweepOutcomeMetrics.TARGETED_OUTCOMES.forEach(outcome ->\n IntStream.range(0, 10).forEach(ignore -> legacyMetrics.registerOccurrenceOf(outcome)));\n SweepOutcomeMetrics.TARGETED_OUTCOMES\n .forEac... | {
"fields": [
{
"declarator": "LEGACY_OUTCOMES = Arrays.asList(SweepOutcome.values())",
"modifier": "public static final",
"original_string": "public static final List<SweepOutcome> LEGACY_OUTCOMES = Arrays.asList(SweepOutcome.values());",
"type": "List<SweepOutcome>",
"var_name": "L... | {
"body": "public void registerOccurrenceOf(SweepOutcome outcome) {\n if (outcome == SweepOutcome.FATAL) {\n metrics.get().fatal().set(true);\n return;\n }\n\n metrics.get().reservoir().update(outcome.ordinal());\n }",
"class_method_signature": "SweepOutcomeMetrics.regi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_731 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/HiddenTablesTest.java",
"identifier": "HiddenTablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldSayPersistedLocksTableIsHidden() {\n assertThat(HiddenTables.isHidden(AtlasDbConstants.PERSISTED_LOCKS_TABLE), is(true));\n }",
"class_method_signature": "HiddenTablesTest.shouldSayPersistedLocksTableIsHidden()",
"constructor": false,
"full_signature": "@Test pu... | {
"fields": [
{
"declarator": "CASSANDRA_TABLES = ImmutableSet.of(\n AtlasDbConstants.TIMESTAMP_TABLE,\n AtlasDbConstants.DEFAULT_METADATA_TABLE,\n AtlasDbConstants.PERSISTED_LOCKS_TABLE)",
"modifier": "private static final",
"original_string": "private static fi... | {
"body": "public static boolean isHidden(TableReference tableReference) {\n return CASSANDRA_TABLES.contains(tableReference)\n || AtlasDbConstants.DEPRECATED_SWEEP_TABLES_WITH_NO_METADATA.contains(tableReference)\n || tableReference.getTablename().startsWith(AtlasDbConstants.LOCK... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_361 | {
"fields": [
{
"declarator": "backoffMechanism\n = mock(StandardPeriodicBackoffStrategy.BackoffMechanism.class)",
"modifier": "private final",
"original_string": "private final StandardPeriodicBackoffStrategy.BackoffMechanism backoffMechanism\n = mock(StandardPeriodicBacko... | {
"body": "@Test\n public void invokesBackoffMultipleTimesIfCalledWithNonZeroTime() throws InterruptedException {\n StreamStoreBackoffStrategy backoffStrategy = createStaticBackoffStrategy(1, 100);\n backoffStrategy.accept(1);\n backoffStrategy.accept(2);\n backoffStrategy.accept(3);\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(StandardPeriodicBackoffStrategy.class)",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(StandardPeriodicBackoffStrategy.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public void accept(long blockNumber) {\n if (persistenceConfiguration.get().writePauseDurationMillis() == 0) {\n return;\n }\n\n if (shouldBackoffBeforeWritingBlockNumber(blockNumber)) {\n try {\n long writePauseDurationMillis = persi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_674 | {
"fields": [
{
"declarator": "STRING_SUPPLIER = mock(Supplier.class)",
"modifier": "private final",
"original_string": "private final Supplier<String> STRING_SUPPLIER = mock(Supplier.class);",
"type": "Supplier<String>",
"var_name": "STRING_SUPPLIER"
},
{
"declarator":... | {
"body": "@Test\n public void throwsIfSupplierThrows() {\n RuntimeException ex = new RuntimeException();\n when(STRING_SUPPLIER.get()).thenThrow(ex);\n assertThatThrownBy(TRANSFORMING_SUPPLIER::get).isEqualTo(ex);\n }",
"class_method_signature": "CachedTransformingSupplierTest.throwsIfSu... | {
"fields": [
{
"declarator": "inputSupplier",
"modifier": "private final",
"original_string": "private final Supplier<T> inputSupplier;",
"type": "Supplier<T>",
"var_name": "inputSupplier"
},
{
"declarator": "outputFunction",
"modifier": "private final",
"o... | {
"body": "@Override\n public synchronized U get() {\n T currentInput = inputSupplier.get();\n\n if (Objects.equals(cachedInput, currentInput)) {\n return cachedOutput;\n }\n\n cachedInput = currentInput;\n cachedOutput = outputFunction.apply(cachedInput);\n ret... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_224 | {
"fields": [
{
"declarator": "CUSTOM_METRIC_NAME = \"foo\"",
"modifier": "private static final",
"original_string": "private static final String CUSTOM_METRIC_NAME = \"foo\";",
"type": "String",
"var_name": "CUSTOM_METRIC_NAME"
},
{
"declarator": "PING_METHOD = \"ping\... | {
"body": "@Test\n public void instrumentWithDefaultNameAll() {\n TestService service = AtlasDbMetrics.instrument(metrics, TestService.class, testService);\n\n assertMethodInstrumented(PING_REQUEST_METRIC, service::ping);\n assertMethodInstrumented(PING_NOT_TIMED_METRIC, service::pingNotTimed)... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AtlasDbMetrics.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AtlasDbMetrics.class);",
"type": "Logger",
"var_name": "log"
}
],
"file": "at... | {
"body": "@Deprecated\n public static <T, U extends T> T instrument(\n MetricRegistry metricRegistry, Class<T> serviceInterface, U service) {\n return instrument(metricRegistry, serviceInterface, service, serviceInterface.getName());\n }",
"class_method_signature": "AtlasDbMetrics.instrumen... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_818 | {
"fields": [
{
"declarator": "KEYSPACE = \"ks\"",
"modifier": "private static final",
"original_string": "private static final String KEYSPACE = \"ks\";",
"type": "String",
"var_name": "KEYSPACE"
},
{
"declarator": "KEYSPACE_2 = \"ks2\"",
"modifier": "private sta... | {
"body": "@Test\n public void throwsWhenPreprocessingConfigWithNoKeyspaceAndNoNamespace() {\n assertThatThrownBy(() -> CassandraAtlasDbFactory.preprocessKvsConfig(CONFIG_WITHOUT_KEYSPACE, Optional::empty,\n Optional.empty()))\n .isInstanceOf(IllegalArgumentException.class);\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraAtlasDbFactory.class)",
"modifier": "private static",
"original_string": "private static Logger log = LoggerFactory.getLogger(CassandraAtlasDbFactory.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@VisibleForTesting\n static CassandraKeyValueServiceConfig preprocessKvsConfig(\n KeyValueServiceConfig config,\n Supplier<Optional<KeyValueServiceRuntimeConfig>> runtimeConfig,\n Optional<String> namespace) {\n Preconditions.checkArgument(config instanceof Cassan... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_377 | {
"fields": [],
"file": "commons-executors/src/test/java/com/palantir/common/concurrent/PTExecutorsTest.java",
"identifier": "PTExecutorsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExecutorName_namedThreadFactory() {\n ThreadFactory factory = new NamedThreadFactory(\"my-prefix\");\n assertThat(PTExecutors.getExecutorName(factory)).isEqualTo(\"my-prefix\");\n }",
"class_method_signature": "PTExecutorsTest.testExecutorName_namedThreadFactor... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PTExecutors.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PTExecutors.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator... | {
"body": "@VisibleForTesting\n static String getExecutorName(ThreadFactory factory) {\n if (factory instanceof NamedThreadFactory) {\n return ((NamedThreadFactory) factory).getPrefix();\n }\n // fall back to create a thread, and capture the name\n // Thread isn't started, al... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_727 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/HiddenTablesTest.java",
"identifier": "HiddenTablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldSayAnOldStyleLocksTableIsHidden() {\n assertThat(HiddenTables.isHidden(TableReference.createWithEmptyNamespace(\"_locks\")), is(true));\n }",
"class_method_signature": "HiddenTablesTest.shouldSayAnOldStyleLocksTableIsHidden()",
"constructor": false,
"full_signat... | {
"fields": [
{
"declarator": "CASSANDRA_TABLES = ImmutableSet.of(\n AtlasDbConstants.TIMESTAMP_TABLE,\n AtlasDbConstants.DEFAULT_METADATA_TABLE,\n AtlasDbConstants.PERSISTED_LOCKS_TABLE)",
"modifier": "private static final",
"original_string": "private static fi... | {
"body": "public static boolean isHidden(TableReference tableReference) {\n return CASSANDRA_TABLES.contains(tableReference)\n || AtlasDbConstants.DEPRECATED_SWEEP_TABLES_WITH_NO_METADATA.contains(tableReference)\n || tableReference.getTablename().startsWith(AtlasDbConstants.LOCK... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_232 | {
"fields": [
{
"declarator": "TAG_KEY_1 = \"tag1\"",
"modifier": "private static final",
"original_string": "private static final String TAG_KEY_1 = \"tag1\";",
"type": "String",
"var_name": "TAG_KEY_1"
},
{
"declarator": "TAG_VALUE_1 = \"tagVal1\"",
"modifier": ... | {
"body": "@Test\n public void shouldThrowIfMetricNameContainsEqualSign() throws Exception {\n assertThatThrownBy(() -> MetricNameUtils.getMetricName(\"metric=Name\",\n ImmutableMap.of(TAG_KEY_1, TAG_VALUE_1, TAG_KEY_2, TAG_VALUE_2)))\n .isInstanceOf(IllegalArgumentException.cl... | {
"fields": [
{
"declarator": "MAX_ALLOWED_TAGS = 10",
"modifier": "private static final",
"original_string": "private static final int MAX_ALLOWED_TAGS = 10;",
"type": "int",
"var_name": "MAX_ALLOWED_TAGS"
},
{
"declarator": "DELIMITER = \";\"",
"modifier": "priv... | {
"body": "public static String getMetricName(String metricName, Map<String, String> tags) {\n Preconditions.checkArgument(tags.size() <= MAX_ALLOWED_TAGS, \"Too many tags set on the metric %s. \"\n + \"Maximum allowed number of tags is %s, found %s.\", metricName, MAX_ALLOWED_TAGS, tags.size())... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_398 | {
"fields": [
{
"declarator": "RECOMPUTE_MILLIS = 10",
"modifier": "private static final",
"original_string": "private static final long RECOMPUTE_MILLIS = 10;",
"type": "long",
"var_name": "RECOMPUTE_MILLIS"
},
{
"declarator": "METRICS_CONFIGURATION\n = Targ... | {
"body": "@Test\n public void enqueuedWritesAccumulatesOverShards() {\n metrics.updateEnqueuedWrites(CONS_ZERO, 1);\n metrics.updateEnqueuedWrites(CONS_ONE, 3);\n metrics.updateEnqueuedWrites(CONS_ZERO, 1);\n\n assertThat(metricsManager).hasEnqueuedWritesConservativeEqualTo(5);\n }"... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweepMetrics.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweepMetrics.class);",
"type": "Logger",
"var_name": "log"
},
{... | {
"body": "public void updateEnqueuedWrites(ShardAndStrategy shardStrategy, long writes) {\n updateMetricsIfPresent(shardStrategy, metrics -> metrics.updateEnqueuedWrites(writes));\n }",
"class_method_signature": "TargetedSweepMetrics.updateEnqueuedWrites(ShardAndStrategy shardStrategy, long writes)",
"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_662 | {
"fields": [
{
"declarator": "EXCEPTION = new RuntimeException(\"test\")",
"modifier": "private static final",
"original_string": "private static final RuntimeException EXCEPTION = new RuntimeException(\"test\");",
"type": "RuntimeException",
"var_name": "EXCEPTION"
},
{
... | {
"body": "@Test\n public void slowTasksTimeOutWithoutThrowing() {\n SafeShutdownRunner runner = new SafeShutdownRunner(Duration.ofMillis(50));\n\n runner.shutdownSafely(blockingUninterruptibleRunnable);\n runner.shutdownSafely(blockingUninterruptibleRunnable);\n\n verify(blockingUninte... | {
"fields": [
{
"declarator": "executor = PTExecutors.newCachedThreadPool(\"safe-shutdown-runner\")",
"modifier": "private final",
"original_string": "private final ExecutorService executor = PTExecutors.newCachedThreadPool(\"safe-shutdown-runner\");",
"type": "ExecutorService",
"var... | {
"body": "public void shutdownSafely(Runnable shutdownCallback) {\n Future<?> future = executor.submit(shutdownCallback);\n try {\n future.get(timeoutDuration.toMillis(), TimeUnit.MILLISECONDS);\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_79 | {
"fields": [
{
"declarator": "NON_K8S_INSTANCE = new KubernetesHostnames(() -> \"fake-url\")",
"modifier": "private static final",
"original_string": "private static final KubernetesHostnames NON_K8S_INSTANCE = new KubernetesHostnames(() -> \"fake-url\");",
"type": "KubernetesHostnames",
... | {
"body": "@Test\n public void getClusterMembers_not_k8s() throws Exception {\n expectedException.expect(RuntimeException.class);\n expectedException.expectMessage(\"Not running in a k8s stateful set.\");\n NON_K8S_INSTANCE.getClusterMembers(4);\n }",
"class_method_signature": "Kubernetes... | {
"fields": [
{
"declarator": "INSTANCE = new KubernetesHostnames(() -> {\n try {\n return InetAddress.getLocalHost().getCanonicalHostName();\n } catch (UnknownHostException e) {\n throw new RuntimeException(e);\n }\n })",
"modifier": "public static final"... | {
"body": "public List<String> getClusterMembers(int expectedClusterSize) {\n Matcher podTemplateMatcher = getHostnameComponents();\n\n int ourPodId = Integer.parseInt(podTemplateMatcher.group(\"podId\"));\n Preconditions.checkArgument(ourPodId < expectedClusterSize,\n \"Current Po... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_96 | {
"fields": [
{
"declarator": "CLIENT1 = Client.of(\"client-1\")",
"modifier": "private static final",
"original_string": "private static final Client CLIENT1 = Client.of(\"client-1\");",
"type": "Client",
"var_name": "CLIENT1"
},
{
"declarator": "CLIENT2 = Client.of(\"... | {
"body": "@Test\n public void shouldBeUnhealthyIfNoNodesPingedSuccessfully() {\n List<HealthCheckPinger> leaders =\n getHealthCheckPingers(ImmutableSet.of(), ImmutableSet.of(), ImmutableSet.of());\n\n SetMultimap<TimeLockStatus, Client> expected = ImmutableSetMultimap.<TimeLockStatus,... | {
"fields": [
{
"declarator": "HEALTH_CHECK_TIME_LIMIT = Duration.ofSeconds(7)",
"modifier": "private static final",
"original_string": "private static final Duration HEALTH_CHECK_TIME_LIMIT = Duration.ofSeconds(7);",
"type": "Duration",
"var_name": "HEALTH_CHECK_TIME_LIMIT"
},
... | {
"body": "public HealthCheckDigest getStatus() {\n Set<Client> namespacesToCheck = namespaceTracker.trackedNamespaces();\n\n PaxosResponses<PaxosContainer<Map<Client, HealthCheckResponse>>> responses =\n PaxosQuorumChecker.collectAsManyResponsesAsPossible(\n Immuta... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_459 | {
"fields": [
{
"declarator": "SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUtils.SWEEP_BATCH_SIZE)",
"modifier": "private static final",
"original_string": "private static final SweepIterationResult SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUti... | {
"body": "@Test\n public void attemptedIncreaseCanPreventReduction() throws Exception {\n when(sweepIteration.call()).thenReturn(\n SUCCESS_LARGE, SUCCESS_LARGE,\n SUCCESS_SMALL);\n\n scheduler.start(2);\n tickClockForHalfCoolDown();\n runSweepIterations(5... | {
"fields": [
{
"declarator": "COOL_DOWN = Duration.ofMinutes(5L)",
"modifier": "private static final",
"original_string": "private static final Duration COOL_DOWN = Duration.ofMinutes(5L);",
"type": "Duration",
"var_name": "COOL_DOWN"
},
{
"declarator": "BATCH_CELLS_LO... | {
"body": "void start(int initialThreads) {\n for (int i = 0; i < initialThreads; i++) {\n increaseNumberOfTasks(INITIAL_DELAY);\n }\n }",
"class_method_signature": "ScalingSweepTaskScheduler.start(int initialThreads)",
"constructor": false,
"full_signature": " void start(int initial... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_770 | {
"fields": [
{
"declarator": "KEY_1 = {120}",
"modifier": "private static final",
"original_string": "private static final byte[] KEY_1 = {120};",
"type": "byte[]",
"var_name": "KEY_1"
},
{
"declarator": "COLUMN_NAME_1 = \"foo\"",
"modifier": "private static fina... | {
"body": "@Test\n public void invalidatedValueIsNotValidTimestampData() {\n assertThat(CassandraTimestampUtils.isValidTimestampData(\n CassandraTimestampUtils.INVALIDATED_VALUE.toByteArray()))\n .isFalse();\n }",
"class_method_signature": "CassandraTimestampUtilsTest.inva... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraTimestampUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraTimestampUtils.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static boolean isValidTimestampData(byte[] data) {\n return data != null && data.length == Long.BYTES;\n }",
"class_method_signature": "CassandraTimestampUtils.isValidTimestampData(byte[] data)",
"constructor": false,
"full_signature": "public static boolean isValidTimestampData(byte... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_320 | {
"fields": [
{
"declarator": "ARG_NAME = \"argName\"",
"modifier": "private static final",
"original_string": "private static final String ARG_NAME = \"argName\";",
"type": "String",
"var_name": "ARG_NAME"
},
{
"declarator": "SAFE_TABLE_REFERENCE = TableReference.creat... | {
"body": "@Test\n public void returnsUnsafeBatchColumnRangeEvenWhenContainsSafeColumns() {\n assertThat(LoggingArgs.batchColumnRangeSelection(SAFE_BATCH_COLUMN_RANGE)).isInstanceOf(UnsafeArg.class);\n }",
"class_method_signature": "LoggingArgsTest.returnsUnsafeBatchColumnRangeEvenWhenContainsSafeColum... | {
"fields": [
{
"declarator": "PLACEHOLDER_TABLE_NAME = \"{table}\"",
"modifier": "private static final",
"original_string": "private static final String PLACEHOLDER_TABLE_NAME = \"{table}\";",
"type": "String",
"var_name": "PLACEHOLDER_TABLE_NAME"
},
{
"declarator": "P... | {
"body": "public static Arg<BatchColumnRangeSelection> batchColumnRangeSelection(\n BatchColumnRangeSelection batchColumnRangeSelection) {\n return getArg(\"batchColumnRangeSelection\", batchColumnRangeSelection, false);\n }",
"class_method_signature": "LoggingArgs.batchColumnRangeSelection(\n... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_635 | {
"fields": [
{
"declarator": "mockScrubber = mock(Scrubber.class)",
"modifier": "private",
"original_string": "private Scrubber mockScrubber = mock(Scrubber.class);",
"type": "Scrubber",
"var_name": "mockScrubber"
},
{
"declarator": "mockPuncher = mock(Puncher.class)",... | {
"body": "@Test\n public void isInitializedWhenPrerequisitesAreInitialized() {\n assertTrue(simpleCleaner.isInitialized());\n }",
"class_method_signature": "SimpleCleanerTest.isInitializedWhenPrerequisitesAreInitialized()",
"constructor": false,
"full_signature": "@Test public void isInitializedWh... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SimpleCleaner.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SimpleCleaner.class);",
"type": "Logger",
"var_name": "log"
},
{
"declar... | {
"body": "@Override\n public boolean isInitialized() {\n return scrubber.isInitialized() && puncher.isInitialized();\n }",
"class_method_signature": "SimpleCleaner.isInitialized()",
"constructor": false,
"full_signature": "@Override public boolean isInitialized()",
"identifier": "isInitialized",... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_265 | {
"fields": [
{
"declarator": "TABLE_REF = TableReference.createWithEmptyNamespace(\"TestTable\")",
"modifier": "private static",
"original_string": "private static TableReference TABLE_REF = TableReference.createWithEmptyNamespace(\"TestTable\");",
"type": "TableReference",
"var_nam... | {
"body": "@Test\n public void testCanRenderJava8Optionals() {\n TableRenderer renderer = new TableRenderer(\"package\", Namespace.DEFAULT_NAMESPACE, OptionalType.JAVA8);\n assertThat(renderer.render(\"table\", getSimpleTableDefinition(TABLE_REF), NO_INDICES))\n .doesNotContain(\"impor... | {
"fields": [
{
"declarator": "packageName",
"modifier": "private final",
"original_string": "private final String packageName;",
"type": "String",
"var_name": "packageName"
},
{
"declarator": "namespace",
"modifier": "private final",
"original_string": "pri... | {
"body": "public String render(String rawTableName, TableDefinition table, SortedSet<IndexMetadata> indices) {\n return new ClassRenderer(rawTableName, table, indices).render();\n }",
"class_method_signature": "TableRenderer.render(String rawTableName, TableDefinition table, SortedSet<IndexMetadata> indi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_588 | {
"fields": [
{
"declarator": "EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L)",
"modifier": "private static final",
"original_string": "private static final Function<Long, Long> EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L);",
"type": "Function<Long, Long>",
"var_name": "EXT... | {
"body": "@Test\n public void delegatesGetBasedOnFunction() {\n when(delegate1.get(1L)).thenReturn(2L);\n when(delegate2.get(2L)).thenReturn(4L);\n assertThat(delegatingTransactionService.get(1L)).isEqualTo(2L);\n assertThat(delegatingTransactionService.get(2L)).isEqualTo(4L);\n ... | {
"fields": [
{
"declarator": "timestampToServiceKey",
"modifier": "private final",
"original_string": "private final Function<Long, T> timestampToServiceKey;",
"type": "Function<Long, T>",
"var_name": "timestampToServiceKey"
},
{
"declarator": "keyedServices",
"m... | {
"body": "@CheckForNull\n @Override\n public Long get(long startTimestamp) {\n return AtlasFutures.getUnchecked(getInternal(keyedSyncServices, startTimestamp));\n }",
"class_method_signature": "SplitKeyDelegatingTransactionService.get(long startTimestamp)",
"constructor": false,
"full_signature... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_422 | {
"fields": [
{
"declarator": "LOW_START_TS = 6L",
"modifier": "private static final",
"original_string": "private static final long LOW_START_TS = 6L;",
"type": "long",
"var_name": "LOW_START_TS"
},
{
"declarator": "LOW_COMMIT_TS = 7L",
"modifier": "private stati... | {
"body": "@Test\n public void conservative_getTimestampsToSweep_twoEntriesBelowSweepTimestamp_returnsLowerOne() {\n long sweepTimestampHigherThanCommitTimestamp = HIGH_COMMIT_TS + 1;\n List<CandidateCellForSweeping> candidates = twoCommittedTimestampsForSingleCell();\n SweepableCellFilter fil... | {
"fields": [
{
"declarator": "commitTsCache",
"modifier": "private final",
"original_string": "private final CommitTsCache commitTsCache;",
"type": "CommitTsCache",
"var_name": "commitTsCache"
},
{
"declarator": "sweeper",
"modifier": "private final",
"orig... | {
"body": "public BatchOfCellsToSweep getCellsToSweep(List<CandidateCellForSweeping> candidates) {\n Map<Long, Long> startToCommitTs = commitTsCache.loadBatch(getAllValidTimestamps(candidates));\n ImmutableBatchOfCellsToSweep.Builder builder = ImmutableBatchOfCellsToSweep.builder();\n long numCel... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_971 | {
"fields": [
{
"declarator": "NAMESPACE = \"namespace\"",
"modifier": "private static final",
"original_string": "private static final String NAMESPACE = \"namespace\";",
"type": "String",
"var_name": "NAMESPACE"
},
{
"declarator": "LOCK_CLIENT_STRING = \"client\"",
... | {
"body": "@Test\n public void lockAndGetHeldLocksHasLongTimeout() throws InterruptedException {\n sensitiveClient.lockAndGetHeldLocks(NAMESPACE, LOCK_CLIENT_STRING, LOCK_REQUEST);\n\n verify(longTimeout).lockAndGetHeldLocks(NAMESPACE, LOCK_CLIENT_STRING, LOCK_REQUEST);\n verify(shortTimeout, ... | {
"fields": [
{
"declarator": "longTimeoutProxy",
"modifier": "private final",
"original_string": "private final LockRpcClient longTimeoutProxy;",
"type": "LockRpcClient",
"var_name": "longTimeoutProxy"
},
{
"declarator": "shortTimeoutProxy",
"modifier": "private ... | {
"body": "@Override\n public Optional<HeldLocksToken> lockAndGetHeldLocks(String namespace, String client, LockRequest request)\n throws InterruptedException {\n return longTimeoutProxy.lockAndGetHeldLocks(namespace, client, request);\n }",
"class_method_signature": "TimeoutSensitiveLockRpc... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_834 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/cassandra/CassandraCellLoadingConfigTest.java",
"identifier": "CassandraCellLoadingConfigTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void cannotCreateConfigWhereCrossColumnBatchLimitExceedsSingleQueryLimit() {\n assertThatThrownBy(() -> CassandraCellLoadingConfig.of(100, 99))\n .isInstanceOf(IllegalStateException.class)\n .hasMessageContaining(\"shouldn't exceed single query load ba... | {
"fields": [],
"file": "atlasdb-cassandra/src/main/java/com/palantir/atlasdb/cassandra/CassandraCellLoadingConfig.java",
"identifier": "CassandraCellLoadingConfig",
"interfaces": "",
"methods": [
{
"class_method_signature": "CassandraCellLoadingConfig.crossColumnLoadBatchLimit()",
"constructo... | {
"body": "static CassandraCellLoadingConfig of(int crossColumnLoadBatchLimit, int singleQueryLoadBatchLimit) {\n return ImmutableCassandraCellLoadingConfig.builder()\n .crossColumnLoadBatchLimit(crossColumnLoadBatchLimit)\n .singleQueryLoadBatchLimit(singleQueryLoadBatchLimit)\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_137 | {
"fields": [
{
"declarator": "kvs",
"modifier": "private",
"original_string": "private KeyValueService kvs;",
"type": "KeyValueService",
"var_name": "kvs"
},
{
"declarator": "scrubStore",
"modifier": "private",
"original_string": "private ScrubberStore scru... | {
"body": "@Test\n public void testScrubQueueMigration() {\n TableReference foo = TableReference.createWithEmptyNamespace(\"foo\");\n TableReference bar = TableReference.createWithEmptyNamespace(\"bar\");\n TableReference baz = TableReference.createWithEmptyNamespace(\"baz\");\n Cell ce... | {
"fields": [
{
"declarator": "DUMMY_CONTENTS = new byte[] {1}",
"modifier": "private static final",
"original_string": "private static final byte[] DUMMY_CONTENTS = new byte[] {1};",
"type": "byte[]",
"var_name": "DUMMY_CONTENTS"
},
{
"declarator": "truncateOldQueue",
... | {
"body": "public static void run(KeyValueService kvs,\n PrintWriter output,\n int batchSize) {\n Context context = new Context(kvs, output, batchSize);\n\n // This potentially needs to iterate multiple times because getRange\n // only grabs the... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_567 | {
"fields": [
{
"declarator": "TIMESTAMP_1 = 12345",
"modifier": "private static final",
"original_string": "private static final long TIMESTAMP_1 = 12345;",
"type": "long",
"var_name": "TIMESTAMP_1"
},
{
"declarator": "TIMESTAMP_2 = 34567L",
"modifier": "private ... | {
"body": "@Test\n public void getRangeAtBoundThresholdWorksOnSingleRanges() {\n assertThat(manager.getRangeAtBoundThreshold(\n ValueAndBound.of(InternalSchemaMetadata.defaultValue(), TIMESTAMP_1)).getValue())\n .isEqualTo(TransactionConstants.DIRECT_ENCODING_TRANSACTIONS_SCHEM... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TransactionSchemaManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TransactionSchemaManager.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@VisibleForTesting\n Map.Entry<Range<Long>, Integer> getRangeAtBoundThreshold(ValueAndBound<InternalSchemaMetadata> valueAndBound) {\n return valueAndBound.value()\n .orElseThrow(() -> new SafeIllegalStateException(\"Unexpectedly found no value in store\"))\n .timest... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_926 | {
"fields": [
{
"declarator": "binaryOperator = mock(BinaryOperator.class)",
"modifier": "private final",
"original_string": "private final BinaryOperator<Integer> binaryOperator = mock(BinaryOperator.class);",
"type": "BinaryOperator<Integer>",
"var_name": "binaryOperator"
},
... | {
"body": "@Test\n public void retryableExceptionWithAlternativeCauseIsNotCausedByRetryOther() {\n RetryableException retryableException = createRetryableException(QosException.throttle());\n assertThat(FastFailoverProxy.isCausedByRetryOther(retryableException)).isFalse();\n }",
"class_method_si... | {
"fields": [
{
"declarator": "TIME_LIMIT = Duration.ofSeconds(10)",
"modifier": "private static final",
"original_string": "private static final Duration TIME_LIMIT = Duration.ofSeconds(10);",
"type": "Duration",
"var_name": "TIME_LIMIT"
},
{
"declarator": "delegate",
... | {
"body": "@VisibleForTesting\n static boolean isCausedByRetryOther(Throwable throwable) {\n Throwable cause = throwable;\n while (cause != null) {\n if (cause instanceof QosException.RetryOther) {\n return true;\n }\n if (cause instanceof UnknownRemote... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_475 | {
"fields": [
{
"declarator": "LOW_TS = 10L",
"modifier": "private static final",
"original_string": "private static final long LOW_TS = 10L;",
"type": "long",
"var_name": "LOW_TS"
},
{
"declarator": "LOW_TS2 = 2 * LOW_TS",
"modifier": "private static final",
... | {
"body": "@Test\n public void thoroughSweepDoesNotAddSentinelAndLeavesSingleValue() {\n enqueueWriteCommitted(TABLE_THOR, LOW_TS);\n assertReadAtTimestampReturnsNothing(TABLE_THOR, LOW_TS);\n\n sweepNextBatch(ShardAndStrategy.thorough(THOR_SHARD));\n assertReadAtTimestampReturnsNothing... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_55 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldThrowAnInterruptedExceptionIfTheThreadIsInterrupted() {\n try {\n exception.expect(PalantirInterruptedException.class);\n\n Thread.currentThread().interrupt();\n\n store.storeUpperLimit(1_000);\n } finally {\n // Clear t... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final TimestampBoundStore delegate;",
"type": "TimestampBoundStore",
"var_name": "delegate"
},
{
"declarator": "failures",
"modifier": "private final",
"origin... | {
"body": "@Override\n public synchronized void storeUpperLimit(long limit) {\n failures.verifyWeShouldIssueMoreTimestamps();\n throwIfInterrupted();\n\n try {\n delegate.storeUpperLimit(limit);\n } catch (Throwable t) {\n throw failures.responseTo(t);\n }\n... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_530 | {
"fields": [
{
"declarator": "FIRST_LOCK_ID = PersistentLockId.fromString(\"2-4-6-0-1\")",
"modifier": "private static final",
"original_string": "private static final PersistentLockId FIRST_LOCK_ID = PersistentLockId.fromString(\"2-4-6-0-1\");",
"type": "PersistentLockId",
"var_nam... | {
"body": "@Test\n public void releaseWithoutAcquireIsNoOp() {\n manager.releasePersistentLock();\n\n verifyZeroInteractions(mockPls);\n }",
"class_method_signature": "PersistentLockManagerTest.releaseWithoutAcquireIsNoOp()",
"constructor": false,
"full_signature": "@Test public void release... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PersistentLockManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PersistentLockManager.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "public synchronized void releasePersistentLock() {\n if (lockId == null) {\n log.info(\"Called releasePersistentLock, but no lock has been taken! Returning.\");\n return;\n }\n\n referenceCount--;\n if (referenceCount <= 0) {\n log.info(\"Releasi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_160 | {
"fields": [
{
"declarator": "generator",
"modifier": "private",
"original_string": "private DistributingModulusGenerator generator;",
"type": "DistributingModulusGenerator",
"var_name": "generator"
}
],
"file": "timelock-impl/src/test/java/com/palantir/atlasdb/timelock/tran... | {
"body": "@Test\n public void reassignsUnmarkedResiduesIfTheyAreNowLeastReferenced() {\n setupGeneratorWithModulus(3);\n\n requestResiduesAndAssertEachUsedOnce(3);\n unmarkResidue(1);\n assertThat(requestResidues(1)).containsExactly(1);\n }",
"class_method_signature": "Distributin... | {
"fields": [
{
"declarator": "referenceCounts",
"modifier": "private final",
"original_string": "private final SortedSet<ReferenceCountedResidue> referenceCounts;",
"type": "SortedSet<ReferenceCountedResidue>",
"var_name": "referenceCounts"
}
],
"file": "timelock-impl/src/ma... | {
"body": "public synchronized void unmarkResidue(int residue) {\n // There are usually only 16 elements, so this O(n) algo probably will do, but we can pair this with a HashMap\n // and/or make ReferenceCountedResidue modifiable if we decide to use higher moduli in the future.\n for (ReferenceCo... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_863 | {
"fields": [
{
"declarator": "MAX_ATTEMPTS = 3",
"modifier": "private static final",
"original_string": "private static final int MAX_ATTEMPTS = 3;",
"type": "int",
"var_name": "MAX_ATTEMPTS"
},
{
"declarator": "RETRY_PERIOD = Duration.ofSeconds(1)",
"modifier": ... | {
"body": "@Test\n public void retriesIfPredicateFails() throws ExecutionException {\n ListenableFuture<Integer> result = retrier.execute(function);\n future.set(-1);\n scheduler.runUntilIdle();\n verify(function, times(1)).get();\n tick(RETRY_PERIOD.minus(DELTA));\n verif... | {
"fields": [
{
"declarator": "maxAttempts",
"modifier": "private final",
"original_string": "private final int maxAttempts;",
"type": "int",
"var_name": "maxAttempts"
},
{
"declarator": "delayBetweenAttempts",
"modifier": "private final",
"original_string":... | {
"body": "public ListenableFuture<T> execute(Supplier<ListenableFuture<T>> supplier) {\n return execute(supplier, maxAttempts);\n }",
"class_method_signature": "AsyncRetrier.execute(Supplier<ListenableFuture<T>> supplier)",
"constructor": false,
"full_signature": "public ListenableFuture<T> execute(S... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_249 | {
"fields": [
{
"declarator": "SIMPLE_NAME_METADATA_DESCRIPTION = NameMetadataDescription.safe(\n \"string\", ValueType.STRING)",
"modifier": "private static final",
"original_string": "private static final NameMetadataDescription SIMPLE_NAME_METADATA_DESCRIPTION = NameMetadataDescrip... | {
"body": "@Test\n public void throwsOnRawJsonString() {\n String jsonString = \"\\\"string\\\"\";\n\n assertThatThrownBy(() -> SIMPLE_NAME_METADATA_DESCRIPTION.parseFromJson(jsonString, false))\n .isInstanceOf(IllegalStateException.class)\n .hasMessageContaining(\"Only ... | {
"fields": [
{
"declarator": "HASH_ROW_COMPONENT_NAME = \"hashOfRowComponents\"",
"modifier": "public static final",
"original_string": "public static final String HASH_ROW_COMPONENT_NAME = \"hashOfRowComponents\";",
"type": "String",
"var_name": "HASH_ROW_COMPONENT_NAME"
},
... | {
"body": "public byte[] parseFromJson(String json, boolean allowPrefix) {\n try {\n JsonNode jsonNode = OBJECT_MAPPER.readTree(json);\n Preconditions.checkState(jsonNode.isObject(),\n \"Only JSON objects can be deserialized into parsed byte arrays. Passed json was: %s... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_619 | {
"fields": [
{
"declarator": "SETUP_TASK_METRIC_NAME =\n SnapshotTransactionManager.class.getCanonicalName() + \".setupTask\"",
"modifier": "private static final",
"original_string": "private static final String SETUP_TASK_METRIC_NAME =\n SnapshotTransactionManager.class.g... | {
"body": "@Test\n public void closesDeleteExecutorOnClosingTransactionManager() {\n snapshotTransactionManager.close();\n assertThat(deleteExecutor.isTerminated()).isTrue();\n }",
"class_method_signature": "SnapshotTransactionManagerTest.closesDeleteExecutorOnClosingTransactionManager()",
"co... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SnapshotTransactionManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SnapshotTransactionManager.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public void close() {\n log.info(\"Calling close on snapshot transaction manager\");\n if (!isClosed.compareAndSet(false, true)) {\n log.info(\"Snapshot transaction manager has already been closed, performing no action\");\n return;\n }\n\n t... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_199 | {
"fields": [
{
"declarator": "LOG_ID = UUID.randomUUID()",
"modifier": "private static final",
"original_string": "private static final UUID LOG_ID = UUID.randomUUID();",
"type": "UUID",
"var_name": "LOG_ID"
},
{
"declarator": "TABLE = TableReference.createFromFullyQua... | {
"body": "@Test\n public void registeringWatchWithOverlappingScopeLogsAlreadyWatchedLocksInScopeAgain() {\n LockDescriptor ab = AtlasRowLockDescriptor.of(TABLE.getQualifiedName(), PtBytes.toBytes(\"ab\"));\n LockDescriptor bc = AtlasRowLockDescriptor.of(TABLE.getQualifiedName(), PtBytes.toBytes(\"bc... | {
"fields": [
{
"declarator": "lockEventLog",
"modifier": "private final",
"original_string": "private final LockEventLog lockEventLog;",
"type": "LockEventLog",
"var_name": "lockEventLog"
},
{
"declarator": "watches = new AtomicReference<>(LockWatches.create())",
... | {
"body": "@Override\n public void startWatching(LockWatchRequest locksToWatch) {\n Optional<LockWatches> changes = addToWatches(locksToWatch);\n changes.ifPresent(this::logLockWatchEvent);\n }",
"class_method_signature": "LockWatchingServiceImpl.startWatching(LockWatchRequest locksToWatch)",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_463 | {
"fields": [
{
"declarator": "SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUtils.SWEEP_BATCH_SIZE)",
"modifier": "private static final",
"original_string": "private static final SweepIterationResult SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUti... | {
"body": "@Test\n public void whenUnableToAcquireShardOnLastTaskRescheduleAfterMaxPause() throws Exception {\n when(sweepIteration.call()).thenReturn(SweepIterationResults.unableToAcquireShard());\n\n schedulerWithDelay.start(10);\n runSweepIterations(1 + 9, SweepDelay.DEFAULT_MAX_PAUSE_MILLI... | {
"fields": [
{
"declarator": "COOL_DOWN = Duration.ofMinutes(5L)",
"modifier": "private static final",
"original_string": "private static final Duration COOL_DOWN = Duration.ofMinutes(5L);",
"type": "Duration",
"var_name": "COOL_DOWN"
},
{
"declarator": "BATCH_CELLS_LO... | {
"body": "void start(int initialThreads) {\n for (int i = 0; i < initialThreads; i++) {\n increaseNumberOfTasks(INITIAL_DELAY);\n }\n }",
"class_method_signature": "ScalingSweepTaskScheduler.start(int initialThreads)",
"constructor": false,
"full_signature": " void start(int initial... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_930 | {
"fields": [
{
"declarator": "USER_AGENT = UserAgent.of(UserAgent.Agent.of(\"tom\", \"1.2.3\"))",
"modifier": "private static final",
"original_string": "private static final UserAgent USER_AGENT = UserAgent.of(UserAgent.Agent.of(\"tom\", \"1.2.3\"));",
"type": "UserAgent",
"var_nam... | {
"body": "@Test\n public void minimallySpecifiedNonRetryingParametersShouldMatchLegacyBehaviour() {\n ClientOptions clientOptions = ClientOptions.fromRemotingParameters(AuxiliaryRemotingParameters.builder()\n .shouldLimitPayload(true)\n .shouldRetry(false)\n .us... | {
"fields": [
{
"declarator": "FAST_RETRYING_FOR_TEST = ImmutableClientOptions.builder()\n .connectTimeout(Duration.ofMillis(100))\n .readTimeout(Duration.ofSeconds(65))\n .backoffSlotSize(Duration.ofMillis(5))\n .failedUrlCooldown(Duration.ofMillis(1))\n ... | {
"body": "static ClientOptions fromRemotingParameters(AuxiliaryRemotingParameters parameters) {\n ImmutableClientOptions.Builder builder = ImmutableClientOptions.builder();\n\n setupTimeouts(builder, parameters);\n setupRetrying(builder, parameters);\n\n return builder.clientQoS(ClientCon... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_875 | {
"fields": [
{
"declarator": "LOCK_TOKEN = LockToken.of(UUID.randomUUID())",
"modifier": "private static final",
"original_string": "private static final LockToken LOCK_TOKEN = LockToken.of(UUID.randomUUID());",
"type": "LockToken",
"var_name": "LOCK_TOKEN"
}
],
"file": "loc... | {
"body": "@Test\n public void allSharedTokensShouldHaveDifferentIds() {\n Stream<LockToken> tokens = LockTokenShare.share(LOCK_TOKEN, 3);\n assertThat(tokens)\n .extracting(LockToken::getRequestId)\n .doesNotHaveDuplicates()\n .hasSize(3);\n }",
"cla... | {
"fields": [
{
"declarator": "requestId",
"modifier": "private final",
"original_string": "private final UUID requestId;",
"type": "UUID",
"var_name": "requestId"
},
{
"declarator": "sharedLockToken",
"modifier": "private final",
"original_string": "private... | {
"body": "static Stream<LockToken> share(LockToken token, int referenceCount) {\n Preconditions.checkArgument(referenceCount > 0, \"Reference count should be more than zero\");\n Preconditions.checkArgument(!(token instanceof LockTokenShare), \"Can not share a shared lock token\");\n ReferenceCo... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_176 | {
"fields": [
{
"declarator": "NUM_NODES = 5",
"modifier": "private static final",
"original_string": "private static final int NUM_NODES = 5;",
"type": "int",
"var_name": "NUM_NODES"
},
{
"declarator": "QUORUM_SIZE = NUM_NODES / 2 + 1",
"modifier": "private stati... | {
"body": "@Test\n public void canGetAgreedInitialState() {\n PaxosTimestampBoundStore.SequenceAndBound sequenceAndBound = store.getAgreedState(0);\n assertThat(sequenceAndBound.getSeqId()).isEqualTo(0);\n assertThat(sequenceAndBound.getBound()).isEqualTo(0);\n }",
"class_method_signature... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PaxosTimestampBoundStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PaxosTimestampBoundStore.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@VisibleForTesting\n SequenceAndBound getAgreedState(long seq) {\n final Optional<SequenceAndBound> state = getLearnedState(seq);\n if (state.isPresent()) {\n return state.get();\n }\n\n // In the common case seq - 1 will be agreed upon before seq is prepared.\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_526 | {
"fields": [
{
"declarator": "VALID_START_ROW = \"0102030A\"",
"modifier": "private static final",
"original_string": "private static final String VALID_START_ROW = \"0102030A\";",
"type": "String",
"var_name": "VALID_START_ROW"
},
{
"declarator": "LOWERCASE_BUT_VALID_... | {
"body": "@Test\n public void runsOneIterationIfRequested() {\n setupTaskRunner(RESULTS_MORE_TO_SWEEP);\n\n sweeperService.sweepTable(TABLE_REF.getQualifiedName(), Optional.empty(), Optional.of(false),\n Optional.empty(), Optional.empty(), Optional.empty());\n\n verify(sweepTas... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SweeperServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SweeperServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@Override\n public SweepTableResponse sweepTable(\n String tableName,\n Optional<String> startRow,\n Optional<Boolean> fullSweep,\n Optional<Integer> maxCellTsPairsToExamine,\n Optional<Integer> candidateBatchSize,\n Optional<Integer> del... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_43 | {
"fields": [
{
"declarator": "TEST_TABLE = TableReference.createFromFullyQualifiedName(\"ns.test_table\")",
"modifier": "private static final",
"original_string": "private static final TableReference TEST_TABLE = TableReference.createFromFullyQualifiedName(\"ns.test_table\");",
"type": "T... | {
"body": "@Test\n public void testCacheHandlesMultipleTableRequests() throws Exception {\n assertThat(valueStyleCache.getTableType(\n connectionSupplier, TEST_TABLE, AtlasDbConstants.DEFAULT_METADATA_TABLE),\n is(TableValueStyle.OVERFLOW));\n assertThat(\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TableValueStyleCache.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TableValueStyleCache.class);",
"type": "Logger",
"var_name": "log"
},
{... | {
"body": "public TableValueStyle getTableType(\n final ConnectionSupplier connectionSupplier,\n final TableReference tableRef,\n TableReference metadataTable) {\n try {\n return valueStyleByTableRef.get(tableRef, () -> {\n SqlConnection conn = connect... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_967 | {
"fields": [
{
"declarator": "adapter = new FreshTimestampSupplierAdapter()",
"modifier": "private final",
"original_string": "private final FreshTimestampSupplierAdapter adapter = new FreshTimestampSupplierAdapter();",
"type": "FreshTimestampSupplierAdapter",
"var_name": "adapter"
... | {
"body": "@Test\n public void throwsNullPointerExceptionIfResettingTimestampServiceToNull() {\n TimestampService timestampService = mock(TimestampService.class);\n adapter.setTimestampService(timestampService);\n assertThatThrownBy(() -> adapter.setTimestampService(null)).isInstanceOf(NullPoi... | {
"fields": [
{
"declarator": "timestampService",
"modifier": "private volatile",
"original_string": "private volatile TimestampService timestampService;",
"type": "TimestampService",
"var_name": "timestampService"
}
],
"file": "atlasdb-config/src/main/java/com/palantir/atlas... | {
"body": "public void setTimestampService(TimestampService timestampService) {\n Preconditions.checkNotNull(timestampService, \"Should not re-set timestamp service in a\"\n + \" FreshTimestampSupplierAdapter to null\");\n this.timestampService = timestampService;\n }",
"class_method... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_434 | {
"fields": [
{
"declarator": "INITIAL_TIMESTAMP = SweepQueueUtils.INITIAL_TIMESTAMP",
"modifier": "private static final",
"original_string": "private static final long INITIAL_TIMESTAMP = SweepQueueUtils.INITIAL_TIMESTAMP;",
"type": "long",
"var_name": "INITIAL_TIMESTAMP"
},
... | {
"body": "@Test\n public void progressivelyFailingCasEventuallySucceeds() {\n KeyValueService mockKvs = mock(KeyValueService.class);\n when(mockKvs.get(any(), anyMap()))\n .thenReturn(ImmutableMap.of())\n .thenReturn(ImmutableMap.of(DUMMY, createValue(5L)))\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ShardProgress.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ShardProgress.class);",
"type": "Logger",
"var_name": "log"
},
{
"declar... | {
"body": "public long updateLastSweptTimestamp(ShardAndStrategy shardAndStrategy, long timestamp) {\n return increaseValueFromToAtLeast(shardAndStrategy, getLastSweptTimestamp(shardAndStrategy), timestamp);\n }",
"class_method_signature": "ShardProgress.updateLastSweptTimestamp(ShardAndStrategy shardAndS... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_571 | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_MAPPING\n = TimestampPartitioningMap.of(ImmutableRangeMap.of(Range.atLeast(1L), 1))",
"modifier": "private static final",
"original_string": "private static final TimestampPartitioningMap<Integer> DEFAULT_INITIAL_MAPPING\n = Ti... | {
"body": "@Test\n public void throwsIfInitialMapHasGapsInRange() {\n assertThatThrownBy(() -> TimestampPartitioningMap.of(\n ImmutableRangeMap.<Long, Integer>builder()\n .put(Range.closed(1L, 6L), 1)\n .put(Range.atLeast(8L), 2)\n ... | {
"fields": [
{
"declarator": "ALL_TIMESTAMPS = Range.atLeast(1L)",
"modifier": "private static final",
"original_string": "private static final Range<Long> ALL_TIMESTAMPS = Range.atLeast(1L);",
"type": "Range<Long>",
"var_name": "ALL_TIMESTAMPS"
}
],
"file": "atlasdb-impl-sh... | {
"body": "public static <T> TimestampPartitioningMap<T> of(RangeMap<Long, T> initialState) {\n return ImmutableTimestampPartitioningMap.of(\n initialState.asMapOfRanges()\n .entrySet()\n .stream()\n .map(entry -> RangeAndValue... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_14 | {
"fields": [
{
"declarator": "ALL_ZERO = new byte[] { 0, 0, 0, 0 }",
"modifier": "private static final",
"original_string": "private static final byte[] ALL_ZERO = new byte[] { 0, 0, 0, 0 };",
"type": "byte[]",
"var_name": "ALL_ZERO"
},
{
"declarator": "EIGHT_ONES = (b... | {
"body": "@Test\n public void persistAndHydrateMax() {\n assertThat(TargetedSweepMetadata.BYTES_HYDRATOR.hydrateFromBytes(ALL_ONE_METADATA.persistToBytes()))\n .isEqualTo(ALL_ONE_METADATA);\n }",
"class_method_signature": "TargetedSweepMetadataTest.persistAndHydrateMax()",
"constructo... | {
"fields": [
{
"declarator": "MAX_SHARDS = 256",
"modifier": "public static final",
"original_string": "public static final int MAX_SHARDS = 256;",
"type": "int",
"var_name": "MAX_SHARDS"
},
{
"declarator": "MAX_DEDICATED_ROWS = 64",
"modifier": "public static fi... | {
"body": "@Override\n public byte[] persistToBytes() {\n byte[] result = new byte[] { 0, 0, 0, 0 };\n result[0] |= (shard() & BYTE_MASK) >> 2;\n if (dedicatedRow()) {\n result[0] |= USE_DEDICATED_ROWS_MASK;\n }\n if (conservative()) {\n result[0] |= SWEEP_S... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_121 | {
"fields": [],
"file": "commons-db/src/test/java/com/palantir/nexus/db/sql/SQLStringTest.java",
"identifier": "SQLStringTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCanonicalizeBlanks() throws Exception {\n List<String> testBatch = ImmutableList.of(\"\",\n \" \",\n \" ;; ; \");\n testBatch.forEach(sql -> assertEquals(\"\", SQLString.canonicalizeString(sql)));\n\n }",
"class_method_signature": ... | {
"fields": [
{
"declarator": "ALL_WORD_CHARS_REGEX = Pattern.compile(\"^[a-zA-Z_0-9\\\\.\\\\-]*$\")",
"modifier": "private static final",
"original_string": "private static final Pattern ALL_WORD_CHARS_REGEX = Pattern.compile(\"^[a-zA-Z_0-9\\\\.\\\\-]*$\");",
"type": "Pattern",
"var... | {
"body": "public static String canonicalizeString(String sql) {\n return canonicalizeString(sql, false);\n }",
"class_method_signature": "SQLString.canonicalizeString(String sql)",
"constructor": false,
"full_signature": "public static String canonicalizeString(String sql)",
"identifier": "canonica... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_988 | {
"fields": [
{
"declarator": "CLIENT = \"client\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT = \"client\";",
"type": "String",
"var_name": "CLIENT"
},
{
"declarator": "SERVERS_LIST_1 = ImmutableServerListConfig.builder(... | {
"body": "@Test\n public void namespacingAddsClientNameToAllServers() {\n ServerListConfig namespacedServersList = ServerListConfigs.namespaceUris(SERVERS_LIST_2, CLIENT);\n assertThat(namespacedServersList.servers()).containsExactlyInAnyOrder(\"one/client\", \"two/client\");\n }",
"class_metho... | {
"fields": [],
"file": "atlasdb-config/src/main/java/com/palantir/atlasdb/config/ServerListConfigs.java",
"identifier": "ServerListConfigs",
"interfaces": "",
"methods": [
{
"class_method_signature": "ServerListConfigs.ServerListConfigs()",
"constructor": true,
"full_signature": "privat... | {
"body": "public static ServerListConfig namespaceUris(ServerListConfig config, String namespace) {\n Set<String> serversWithNamespaces = config\n .servers()\n .stream()\n .map(serverAddress -> serverAddress.replaceAll(\"/$\", \"\") + \"/\" + namespace)\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_822 | {
"fields": [
{
"declarator": "KEYSPACE = \"ks\"",
"modifier": "private static final",
"original_string": "private static final String KEYSPACE = \"ks\";",
"type": "String",
"var_name": "KEYSPACE"
},
{
"declarator": "KEYSPACE_2 = \"ks2\"",
"modifier": "private sta... | {
"body": "@Test\n public void preservesOtherPropertiesOnResolvedConfigWithNamespace() {\n CassandraKeyValueServiceConfig newConfig =\n CassandraAtlasDbFactory.preprocessKvsConfig(CONFIG_WITHOUT_KEYSPACE, Optional::empty,\n Optional.of(KEYSPACE));\n assertThat(ne... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraAtlasDbFactory.class)",
"modifier": "private static",
"original_string": "private static Logger log = LoggerFactory.getLogger(CassandraAtlasDbFactory.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@VisibleForTesting\n static CassandraKeyValueServiceConfig preprocessKvsConfig(\n KeyValueServiceConfig config,\n Supplier<Optional<KeyValueServiceRuntimeConfig>> runtimeConfig,\n Optional<String> namespace) {\n Preconditions.checkArgument(config instanceof Cassan... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_208 | {
"fields": [
{
"declarator": "lockWatches = new AtomicReference<>(LockWatches.create())",
"modifier": "private final",
"original_string": "private final AtomicReference<LockWatches> lockWatches = new AtomicReference<>(LockWatches.create());",
"type": "AtomicReference<LockWatches>",
... | {
"body": "@Test\n public void requestWithStaleLogIdReturnsSnapshot() {\n LockWatchReference entireTable = LockWatchReferenceUtils.entireTable(TABLE_REF);\n lockWatches.set(createWatchesFor(entireTable));\n\n LockWatchStateUpdate update = log.getLogDiff(Optional.of(LockWatchVersion.of(STALE_LO... | {
"fields": [
{
"declarator": "logId",
"modifier": "private final",
"original_string": "private final UUID logId;",
"type": "UUID",
"var_name": "logId"
},
{
"declarator": "slidingWindow = new ArrayLockEventSlidingWindow(1000)",
"modifier": "private final",
"... | {
"body": "@Override\n public synchronized LockWatchStateUpdate getLogDiff(Optional<LockWatchVersion> fromVersion) {\n return tryGetNextEvents(fromVersion).orElseGet(this::calculateSnapshot);\n }",
"class_method_signature": "LockEventLogImpl.getLogDiff(Optional<LockWatchVersion> fromVersion)",
"const... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_658 | {
"fields": [
{
"declarator": "SWEEP_PRIORITY = TableReference.create(\n SweepSchema.INSTANCE.getNamespace(), SweepPriorityTable.getRawTableName())",
"modifier": "private static final",
"original_string": "private static final TableReference SWEEP_PRIORITY = TableReference.create(\n ... | {
"body": "@Test\n public void otherPriorityTableIsValidated() {\n kvs.createTable(OTHER_PRIORITY, AtlasDbConstants.EMPTY_TABLE_METADATA);\n assertThat(KeyValueServiceValidators.getValidatableTableNames(kvs, ImmutableSet.of()))\n .containsExactly(OTHER_PRIORITY);\n }",
"class_meth... | {
"fields": [],
"file": "atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/schema/KeyValueServiceValidators.java",
"identifier": "KeyValueServiceValidators",
"interfaces": "",
"methods": [
{
"class_method_signature": "KeyValueServiceValidators.KeyValueServiceValidators()",
"constructor": ... | {
"body": "public static Set<TableReference> getValidatableTableNames(\n KeyValueService kvs,\n Set<TableReference> unmigratableTables) {\n Set<TableReference> tableNames = KeyValueServiceMigratorUtils\n .getMigratableTableNames(kvs, unmigratableTables, null);\n retu... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_595 | {
"fields": [
{
"declarator": "EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L)",
"modifier": "private static final",
"original_string": "private static final Function<Long, Long> EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L);",
"type": "Function<Long, Long>",
"var_name": "EXT... | {
"body": "@Test\n public void getMultipleThrowsAndDoesNotMakeRequestsIfAnyTimestampsCannotBeMapped() {\n when(delegate1.get(any())).thenReturn(ImmutableMap.of(1L, 8L, 41L, 48L));\n assertThatThrownBy(() -> delegatingTransactionService.get(ImmutableList.of(1L, 7L, 41L)))\n .isInstanceO... | {
"fields": [
{
"declarator": "timestampToServiceKey",
"modifier": "private final",
"original_string": "private final Function<Long, T> timestampToServiceKey;",
"type": "Function<Long, T>",
"var_name": "timestampToServiceKey"
},
{
"declarator": "keyedServices",
"m... | {
"body": "@CheckForNull\n @Override\n public Long get(long startTimestamp) {\n return AtlasFutures.getUnchecked(getInternal(keyedSyncServices, startTimestamp));\n }",
"class_method_signature": "SplitKeyDelegatingTransactionService.get(long startTimestamp)",
"constructor": false,
"full_signature... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_829 | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private CassandraKeyValueServiceConfig config;",
"type": "CassandraKeyValueServiceConfig",
"var_name": "config"
},
{
"declarator": "runtimeConfig",
"modifier": "private",
"ori... | {
"body": "@Test\n public void ifRuntimeConfigIsModified_reloadableConfigIsAlsoModified() {\n CassandraReloadableKvsConfig reloadableConfig = getReloadableConfigWithRuntimeConfig();\n\n int firstValue = 1;\n int secondValue = 2;\n when(runtimeConfig.sweepReadThreads()).thenReturn(firstV... | {
"fields": [
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final CassandraKeyValueServiceConfig config;",
"type": "CassandraKeyValueServiceConfig",
"var_name": "config"
},
{
"declarator": "runtimeConfigSupplier",
"modifier": "... | {
"body": "@Override\n public Integer sweepReadThreads() {\n return chooseConfig(CassandraKeyValueServiceRuntimeConfig::sweepReadThreads,\n config.sweepReadThreads());\n }",
"class_method_signature": "CassandraReloadableKvsConfig.sweepReadThreads()",
"constructor": false,
"full_signa... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_983 | {
"fields": [
{
"declarator": "CLIENT = \"testClient\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT = \"testClient\";",
"type": "String",
"var_name": "CLIENT"
},
{
"declarator": "SERVER_1 = \"http://localhost:8080\"",
... | {
"body": "@Test\n public void preservesSslOnConversionToNamespacedServerListIfPresent() {\n ServerListConfig namespacedConfig = CLIENT_CONFIG.toNamespacedServerList();\n assertThat(namespacedConfig.sslConfiguration(), equalTo(Optional.of(SSL_CONFIGURATION)));\n }",
"class_method_signature": "Ti... | {
"fields": [],
"file": "atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockClientConfig.java",
"identifier": "TimeLockClientConfig",
"interfaces": "",
"methods": [
{
"class_method_signature": "TimeLockClientConfig.client()",
"constructor": false,
"full_signature": "@Deprec... | {
"body": "public ServerListConfig toNamespacedServerList() {\n return ServerListConfigs.namespaceUris(serversList(), getClientOrThrow());\n }",
"class_method_signature": "TimeLockClientConfig.toNamespacedServerList()",
"constructor": false,
"full_signature": "public ServerListConfig toNamespacedServe... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_653 | {
"fields": [
{
"declarator": "kvs",
"modifier": "private",
"original_string": "private KeyValueService kvs;",
"type": "KeyValueService",
"var_name": "kvs"
},
{
"declarator": "transactions",
"modifier": "private",
"original_string": "private TransactionServi... | {
"body": "@Test\n public void isNotInitializedWhenScrubberStoreIsNotInitialized() {\n KeyValueService mockKvs = mock(KeyValueService.class);\n ScrubberStore mockStore = mock(ScrubberStore.class);\n when(mockKvs.isInitialized()).thenReturn(true);\n when(mockStore.isInitialized()).thenRe... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Scrubber.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(Scrubber.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "MA... | {
"body": "public boolean isInitialized() {\n return keyValueService.isInitialized() && scrubberStore.isInitialized();\n }",
"class_method_signature": "Scrubber.isInitialized()",
"constructor": false,
"full_signature": "public boolean isInitialized()",
"identifier": "isInitialized",
"invocations":... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_203 | {
"fields": [
{
"declarator": "WINDOW_SIZE = 10",
"modifier": "private static final",
"original_string": "private static final int WINDOW_SIZE = 10;",
"type": "int",
"var_name": "WINDOW_SIZE"
},
{
"declarator": "slidingWindow = new ArrayLockEventSlidingWindow(WINDOW_SIZ... | {
"body": "@Test\n public void whenLastKnownVersionIsTooOldReturnEmpty() {\n whenLogContainsEvents5to14();\n assertThat(slidingWindow.getNextEvents(3)).isEmpty();\n }",
"class_method_signature": "ArrayLockEventSlidingWindowTest.whenLastKnownVersionIsTooOldReturnEmpty()",
"constructor": false,
... | {
"fields": [
{
"declarator": "buffer",
"modifier": "private final",
"original_string": "private final LockWatchEvent[] buffer;",
"type": "LockWatchEvent[]",
"var_name": "buffer"
},
{
"declarator": "maxSize",
"modifier": "private final",
"original_string": "... | {
"body": "public Optional<List<LockWatchEvent>> getNextEvents(long version) {\n if (versionInTheFuture(version) || versionTooOld(version)) {\n return Optional.empty();\n }\n int startIndex = LongMath.mod(version + 1, maxSize);\n int windowSize = Ints.saturatedCast(lastVersion()... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_716 | {
"fields": [],
"file": "atlasdb-commons/src/test/java/com/palantir/common/base/BatchingVisitablesTest.java",
"identifier": "BatchingVisitablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAnyAndAllForEmptyLists() {\n BatchingVisitable<Long> visitor = BatchingVisitables.emptyBatchingVisitable();\n BatchingVisitableView<Long> bv = BatchingVisitableView.of(visitor);\n assertFalse(\"any(empty-set-of-trues) should be false\", bv.any(Predicates.alwa... | {
"fields": [
{
"declarator": "DEFAULT_BATCH_SIZE = 1000",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_BATCH_SIZE = 1000;",
"type": "int",
"var_name": "DEFAULT_BATCH_SIZE"
},
{
"declarator": "KEEP_ALL_BATCH_SIZE = 100000",
... | {
"body": "public static <T> BatchingVisitableView<T> emptyBatchingVisitable() {\n return BatchingVisitableView.of(new BatchingVisitable<T>() {\n @Override\n public <K extends Exception> boolean batchAccept(int batchSize, AbortingVisitor<? super List<T>, K> v)\n throws ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_346 | {
"fields": [
{
"declarator": "DATA_SIZE = 4",
"modifier": "private static final",
"original_string": "private static final int DATA_SIZE = 4;",
"type": "int",
"var_name": "DATA_SIZE"
},
{
"declarator": "DATA_SIZE_PLUS_ONE = 5",
"modifier": "private static final",... | {
"body": "@Test(expected = IndexOutOfBoundsException.class)\n public void cantReadToNegativePlace() throws IOException {\n dataStream.read(data, -1, 1);\n }",
"class_method_signature": "BlockConsumingInputStreamTest.cantReadToNegativePlace()",
"constructor": false,
"full_signature": "@Test(expecte... | {
"fields": [
{
"declarator": "blockGetter",
"modifier": "private final",
"original_string": "private final BlockGetter blockGetter;",
"type": "BlockGetter",
"var_name": "blockGetter"
},
{
"declarator": "numBlocks",
"modifier": "private final",
"original_str... | {
"body": "@Override\n public int read() throws IOException {\n if (positionInBuffer < buffer.length) {\n return buffer[positionInBuffer++] & 0xff;\n }\n\n if (nextBlockToRead < numBlocks) {\n boolean reloaded = refillBuffer();\n if (!reloaded) {\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_192 | {
"fields": [
{
"declarator": "REQUEST_1 = UUID.randomUUID()",
"modifier": "private static final",
"original_string": "private static final UUID REQUEST_1 = UUID.randomUUID();",
"type": "UUID",
"var_name": "REQUEST_1"
},
{
"declarator": "REQUEST_2 = UUID.randomUUID()",
... | {
"body": "@Test\n public void doesNotCallSupplierForExistingRequest() {\n awaitedLocks.getExistingOrAwait(REQUEST_1, () -> new AsyncResult<>());\n\n Supplier<AsyncResult<Void>> supplier = mock(Supplier.class);\n awaitedLocks.getExistingOrAwait(REQUEST_1, supplier);\n\n verifyNoMoreInte... | {
"fields": [
{
"declarator": "requestsById = Maps.newConcurrentMap()",
"modifier": "@VisibleForTesting\n final",
"original_string": "@VisibleForTesting\n final ConcurrentMap<UUID, AsyncResult<Void>> requestsById = Maps.newConcurrentMap();",
"type": "ConcurrentMap<UUID, AsyncResult<V... | {
"body": "public AsyncResult<Void> getExistingOrAwait(\n UUID requestId,\n Supplier<AsyncResult<Void>> lockAwaiter) {\n AsyncResult<Void> result = requestsById.computeIfAbsent(\n requestId,\n ignored -> lockAwaiter.get());\n\n registerCompletionHandle... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_468 | {
"fields": [
{
"declarator": "SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUtils.SWEEP_BATCH_SIZE)",
"modifier": "private static final",
"original_string": "private static final SweepIterationResult SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUti... | {
"body": "@Test\n public void whenVeryFewEntriesIncreasePause() throws Exception {\n SweepDelay sweepDelay = new SweepDelay(100L);\n ScalingSweepTaskScheduler schedulerWithRealDelay = createScheduler(sweepDelay);\n when(sweepIteration.call()).thenReturn(SUCCESS_TINY);\n\n schedulerWith... | {
"fields": [
{
"declarator": "COOL_DOWN = Duration.ofMinutes(5L)",
"modifier": "private static final",
"original_string": "private static final Duration COOL_DOWN = Duration.ofMinutes(5L);",
"type": "Duration",
"var_name": "COOL_DOWN"
},
{
"declarator": "BATCH_CELLS_LO... | {
"body": "void start(int initialThreads) {\n for (int i = 0; i < initialThreads; i++) {\n increaseNumberOfTasks(INITIAL_DELAY);\n }\n }",
"class_method_signature": "ScalingSweepTaskScheduler.start(int initialThreads)",
"constructor": false,
"full_signature": " void start(int initial... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_891 | {
"fields": [
{
"declarator": "TOKEN_1 = LockToken.of(UUID.randomUUID())",
"modifier": "private static final",
"original_string": "private static final LockToken TOKEN_1 = LockToken.of(UUID.randomUUID());",
"type": "LockToken",
"var_name": "TOKEN_1"
},
{
"declarator": "... | {
"body": "@Test\n public void delegatesInitializationCheck() {\n when(delegate.isInitialized())\n .thenReturn(false)\n .thenReturn(true);\n when(timestampService.isInitialized()).thenReturn(true);\n\n assertFalse(timelock.isInitialized());\n assertTrue(tim... | {
"fields": [
{
"declarator": "refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\")",
"modifier": "private static final",
"original_string": "private static final ScheduledExecutorService refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\");",
"type": "Scheduled... | {
"body": "@Override\n public boolean isInitialized() {\n return delegate.isInitialized() && timestampService.isInitialized();\n }",
"class_method_signature": "TimeLockClient.isInitialized()",
"constructor": false,
"full_signature": "@Override public boolean isInitialized()",
"identifier": "isIni... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_48 | {
"fields": [
{
"declarator": "SEVENTY_THREE = 73L",
"modifier": "private static final",
"original_string": "private static final long SEVENTY_THREE = 73L;",
"type": "long",
"var_name": "SEVENTY_THREE"
},
{
"declarator": "EIGHTY_TWO = 82L",
"modifier": "private st... | {
"body": "@Test\n public void canHandleNegativeResidues() {\n assertThat(getPartitionedTimestamps(SEVENTY_THREE_TO_EIGHTY_TWO, -7, 10))\n .containsExactly(SEVENTY_THREE);\n assertThat(getPartitionedTimestamps(SEVENTY_THREE_TO_EIGHTY_TWO, -5, 10))\n .containsExactly(75L)... | {
"fields": [],
"file": "timestamp-impl/src/main/java/com/palantir/timestamp/TimestampRanges.java",
"identifier": "TimestampRanges",
"interfaces": "",
"methods": [
{
"class_method_signature": "TimestampRanges.TimestampRanges()",
"constructor": true,
"full_signature": "private TimestampR... | {
"body": "public static PartitionedTimestamps getPartitionedTimestamps(TimestampRange range, int residue, int modulus) {\n checkModulusAndResidue(residue, modulus);\n\n long startTimestamp = getLowestTimestampMatchingModulus(range.getLowerBound(), residue, modulus);\n long endTimestamp = range.g... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_487 | {
"fields": [
{
"declarator": "LOW_TS = 10L",
"modifier": "private static final",
"original_string": "private static final long LOW_TS = 10L;",
"type": "long",
"var_name": "LOW_TS"
},
{
"declarator": "LOW_TS2 = 2 * LOW_TS",
"modifier": "private static final",
... | {
"body": "@Test\n public void sweepHandlesSequencesOfDeletesAndReadditionsInOneShot() {\n enqueueWriteCommitted(TABLE_CONS, LOW_TS);\n enqueueTombstone(TABLE_CONS, LOW_TS + 2);\n enqueueWriteCommitted(TABLE_CONS, LOW_TS + 4);\n enqueueTombstone(TABLE_CONS, LOW_TS + 6);\n enqueue... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_254 | {
"fields": [
{
"declarator": "TABLE_NAME = \"testTable\"",
"modifier": "private static final",
"original_string": "private static final String TABLE_NAME = \"testTable\";",
"type": "String",
"var_name": "TABLE_NAME"
},
{
"declarator": "TABLE_REF = TableReference.create... | {
"body": "@Test\n public void testGetFullTableReferenceString() {\n MatcherAssert.assertThat(\n Schemas.getTableReferenceString(TABLE_NAME, NAMESPACE),\n Matchers.equalTo(\"TableReference.createFromFullyQualifiedName(\\\"\"\n + NAMESPACE.getName() + \".\... | {
"fields": [
{
"declarator": "INDEX_SUFFIX = \"idx\"",
"modifier": "private static final",
"original_string": "private static final String INDEX_SUFFIX = \"idx\";",
"type": "String",
"var_name": "INDEX_SUFFIX"
}
],
"file": "atlasdb-client/src/main/java/com/palantir/atlasdb/t... | {
"body": "public static String getTableReferenceString(String tableName, Namespace namespace) {\n Preconditions.checkArgument(isTableNameValid(tableName), \"%s is not a valid table name\", tableName);\n String namespaceName = namespace.getName();\n // Hacks for schemas that were created before n... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_604 | {
"fields": [
{
"declarator": "delegate = mock(TransactionService.class)",
"modifier": "private final",
"original_string": "private final TransactionService delegate = mock(TransactionService.class);",
"type": "TransactionService",
"var_name": "delegate"
},
{
"declarato... | {
"body": "@Test\n public void passesThroughOnlyValidTimestampsToDelegateWhenGettingMultiple() {\n Map<Long, Long> result = preStartHandlingService.get(ONE_VALID_ONE_INVALID_TIMESTAMP);\n assertThat(result).containsOnly(\n Maps.immutableEntry(START_TIMESTAMP, COMMIT_TIMESTAMP),\n ... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final TransactionService delegate;",
"type": "TransactionService",
"var_name": "delegate"
},
{
"declarator": "synchronousAsyncTransactionService",
"modifier": "priva... | {
"body": "@CheckForNull\n @Override\n public Long get(long startTimestamp) {\n return AtlasFutures.getUnchecked(getInternal(startTimestamp, synchronousAsyncTransactionService));\n }",
"class_method_signature": "PreStartHandlingTransactionService.get(long startTimestamp)",
"constructor": false,
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_311 | {
"fields": [
{
"declarator": "ARG_NAME = \"argName\"",
"modifier": "private static final",
"original_string": "private static final String ARG_NAME = \"argName\";",
"type": "String",
"var_name": "ARG_NAME"
},
{
"declarator": "SAFE_TABLE_REFERENCE = TableReference.creat... | {
"body": "@Test\n public void returnsSafeInternalTableNameCorrectly() {\n Arg<String> internalTableNameArg = LoggingArgs.internalTableName(SAFE_TABLE_REFERENCE);\n assertThat(internalTableNameArg.getName()).isEqualTo(\"tableRef\");\n assertThat(internalTableNameArg.getValue()).isEqualTo(\n ... | {
"fields": [
{
"declarator": "PLACEHOLDER_TABLE_NAME = \"{table}\"",
"modifier": "private static final",
"original_string": "private static final String PLACEHOLDER_TABLE_NAME = \"{table}\";",
"type": "String",
"var_name": "PLACEHOLDER_TABLE_NAME"
},
{
"declarator": "P... | {
"body": "public static Arg<String> internalTableName(TableReference tableReference) {\n return safeInternalTableName(AbstractKeyValueService.internalTableName(tableReference));\n }",
"class_method_signature": "LoggingArgs.internalTableName(TableReference tableReference)",
"constructor": false,
"full... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_741 | {
"fields": [
{
"declarator": "BACKUP_TIMESTAMP = 42",
"modifier": "private static final",
"original_string": "private static final long BACKUP_TIMESTAMP = 42;",
"type": "long",
"var_name": "BACKUP_TIMESTAMP"
},
{
"declarator": "backupRunner = mock(CassandraTimestampBac... | {
"body": "@Test\n public void ensuresTablesExistOnRevalidate() {\n invalidator.revalidateFromBackup();\n verify(backupRunner, times(1)).ensureTimestampTableExists();\n }",
"class_method_signature": "CassandraTimestampStoreInvalidatorTest.ensuresTablesExistOnRevalidate()",
"constructor": false... | {
"fields": [
{
"declarator": "backupRunner",
"modifier": "private final",
"original_string": "private final CassandraTimestampBackupRunner backupRunner;",
"type": "CassandraTimestampBackupRunner",
"var_name": "backupRunner"
}
],
"file": "atlasdb-cassandra/src/main/java/com/p... | {
"body": "@Override\n @Idempotent\n public void revalidateFromBackup() {\n backupRunner.ensureTimestampTableExists();\n backupRunner.restoreFromBackup();\n }",
"class_method_signature": "CassandraTimestampStoreInvalidator.revalidateFromBackup()",
"constructor": false,
"full_signature": "... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_887 | {
"fields": [
{
"declarator": "timelock",
"modifier": "@Mock private",
"original_string": "@Mock private NamespacedConjureTimelockService timelock;",
"type": "NamespacedConjureTimelockService",
"var_name": "timelock"
},
{
"declarator": "lockRequest",
"modifier": "... | {
"body": "@Test\n public void unlockShouldCallRemoteServer_invalidLeases() {\n setTime(123);\n LeasedLockToken token = LeasedLockToken.of(LOCK_TOKEN, getLease());\n advance(LEASE_DURATION);\n assertInvalid(token);\n\n lockLeaseService.unlock(ImmutableSet.of(token));\n ver... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final NamespacedConjureTimelockService delegate;",
"type": "NamespacedConjureTimelockService",
"var_name": "delegate"
},
{
"declarator": "clientId",
"modifier": "pri... | {
"body": "Set<LockToken> unlock(Set<LockToken> tokens) {\n Set<LeasedLockToken> leasedLockTokens = leasedTokens(tokens);\n leasedLockTokens.forEach(LeasedLockToken::invalidate);\n\n Set<ConjureLockToken> unlocked =\n delegate.unlock(ConjureUnlockRequest.of(serverTokens(leasedLockT... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_184 | {
"fields": [
{
"declarator": "CLIENT = Client.of(\"alice\")",
"modifier": "private static final",
"original_string": "private static final Client CLIENT = Client.of(\"alice\");",
"type": "Client",
"var_name": "CLIENT"
},
{
"declarator": "PAXOS_ROUND_ONE = 1",
"mo... | {
"body": "@Test\n public void newClientCanBeCreatedIfItAlreadyExistsInTheDirectory() {\n paxosComponents.learner(CLIENT);\n LocalPaxosComponents rejectingComponents = createPaxosComponents(false);\n assertThat(rejectingComponents.learner(CLIENT)).isNotNull();\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(LocalPaxosComponents.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(LocalPaxosComponents.class);",
"type": "Logger",
"var_name": "log"
},
{... | {
"body": "public PaxosLearner learner(Client client) {\n return getOrCreateComponents(client).learner();\n }",
"class_method_signature": "LocalPaxosComponents.learner(Client client)",
"constructor": false,
"full_signature": "public PaxosLearner learner(Client client)",
"identifier": "learner",
"i... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_491 | {
"fields": [
{
"declarator": "LOW_TS = 10L",
"modifier": "private static final",
"original_string": "private static final long LOW_TS = 10L;",
"type": "long",
"var_name": "LOW_TS"
},
{
"declarator": "LOW_TS2 = 2 * LOW_TS",
"modifier": "private static final",
... | {
"body": "@Test\n public void sweepProgressesToJustBeforeSweepTsWhenNothingToSweep() {\n sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD));\n assertProgressUpdatedToTimestamp(getSweepTsCons() - 1L);\n }",
"class_method_signature": "TargetedSweeperTest.sweepProgressesToJustBeforeSweepTsW... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_868 | {
"fields": [
{
"declarator": "TEST_MESSAGE = \"test_message\"",
"modifier": "private static final",
"original_string": "private static final String TEST_MESSAGE = \"test_message\";",
"type": "String",
"var_name": "TEST_MESSAGE"
},
{
"declarator": "executor = Executors.... | {
"body": "@Test\n public void listenableFutureMethodsRetryProxyFailures() throws InterruptedException, ExecutionException {\n ReturnsListenableFutureImpl listenableFuture = new ReturnsListenableFutureImpl();\n ReturnsListenableFuture proxy =\n AwaitingLeadershipProxy.newProxyInstance(... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AwaitingLeadershipProxy.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AwaitingLeadershipProxy.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static <U> U newProxyInstance(Class<U> interfaceClass,\n Supplier<U> delegateSupplier,\n LeaderElectionService leaderElectionService) {\n AwaitingLeadershipProxy<U> proxy = new AwaitingLeadershipProxy<>(\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_612 | {
"fields": [
{
"declarator": "FIVE = 5L",
"modifier": "private static final",
"original_string": "private static final long FIVE = 5L;",
"type": "long",
"var_name": "FIVE"
},
{
"declarator": "value = new AtomicLong(0)",
"modifier": "private final",
"origina... | {
"body": "@Test\n public void initialValueIsReported() {\n value.set(FIVE);\n assertThat(longGauge.getValue()).isEqualTo(FIVE);\n }",
"class_method_signature": "ZeroBasedDeltaGaugeTest.initialValueIsReported()",
"constructor": false,
"full_signature": "@Test public void initialValueIsReport... | {
"fields": [
{
"declarator": "underlying",
"modifier": "private final",
"original_string": "private final LongSupplier underlying;",
"type": "LongSupplier",
"var_name": "underlying"
},
{
"declarator": "previousValue = 0",
"modifier": "private",
"original_st... | {
"body": "@Override\n public synchronized Long getValue() {\n long currentValue = underlying.getAsLong();\n long previous = previousValue;\n previousValue = currentValue;\n return currentValue - previous;\n }",
"class_method_signature": "ZeroBasedDeltaGauge.getValue()",
"constru... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_242 | {
"fields": [],
"file": "atlasdb-client/src/test/java/com/palantir/atlasdb/util/TopNMetricPublicationControllerTest.java",
"identifier": "TopNMetricPublicationControllerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void canSelectivelyPublishMultipleGaugeResults() {\n List<Gauge<Long>> atomicLongs = LongStream.range(0, 100)\n .mapToObj(AtomicLong::new)\n .<Gauge<Long>>map(atomicLong -> atomicLong::get)\n .collect(Collectors.toList());\n\n Top... | {
"fields": [
{
"declarator": "REFRESH_INTERVAL = Duration.ofSeconds(30)",
"modifier": "private static final",
"original_string": "private static final Duration REFRESH_INTERVAL = Duration.ofSeconds(30);",
"type": "Duration",
"var_name": "REFRESH_INTERVAL"
},
{
"declara... | {
"body": "@SuppressWarnings(\"unchecked\") // Guaranteed correct\n public static <T extends Comparable> TopNMetricPublicationController<T> create(int maxPermittedRank) {\n Preconditions.checkState(maxPermittedRank > 0, \"maxPermittedRank must be positive\",\n SafeArg.of(\"maxPermittedRank\",... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_757 | {
"fields": [
{
"declarator": "DC_1 = \"dc1\"",
"modifier": "private static final",
"original_string": "private static final String DC_1 = \"dc1\";",
"type": "String",
"var_name": "DC_1"
},
{
"declarator": "DC_2 = \"dc2\"",
"modifier": "private static final",
... | {
"body": "@Test\n public void noStrategyForDcThrows() {\n KsDef ksDef = new KsDef(\"test\", CassandraConstants.SIMPLE_STRATEGY, ImmutableList.of());\n ksDef.setStrategy_options(ImmutableMap.of(DC_1, \"1\"));\n assertThatThrownBy(() ->\n CassandraVerifier.sanityCheckReplicationF... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraVerifier.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraVerifier.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "static void sanityCheckReplicationFactor(KsDef ks, CassandraKeyValueServiceConfig config, Set<String> dcs) {\n checkRfsSpecified(config, dcs, ks.getStrategy_options());\n checkRfsMatchConfig(ks, config, dcs, ks.getStrategy_options());\n }",
"class_method_signature": "CassandraVerifier.sa... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_0 | {
"fields": [
{
"declarator": "METRIC_NAME_1 = MetricName.builder()\n .safeName(\"com.palantir.atlasdb.metrics.metrics.p99\")\n .build()",
"modifier": "private static final",
"original_string": "private static final MetricName METRIC_NAME_1 = MetricName.builder()\n ... | {
"body": "@Test\n public void reportsAllMetricsIfNotPerformingFiltering() {\n Timer timer = taggedMetricRegistry.timer(METRIC_NAME_1);\n\n FilteredTaggedMetricSet filteredTaggedMetricSet = new FilteredTaggedMetricSet(\n taggedMetricRegistry, $ -> false, Refreshable.only(false));\n ... | {
"fields": [
{
"declarator": "unfiltered",
"modifier": "private final",
"original_string": "private final TaggedMetricSet unfiltered;",
"type": "TaggedMetricSet",
"var_name": "unfiltered"
},
{
"declarator": "metricNameFilter",
"modifier": "private final",
"... | {
"body": "@Override\n public Map<MetricName, Metric> getMetrics() {\n if (performFiltering.get()) {\n return KeyedStream.stream(unfiltered.getMetrics())\n .filterKeys(metricNameFilter)\n .collectToMap();\n }\n return unfiltered.getMetrics();\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.