id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
36960637_591 | {
"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 putUnlessExistsDelegateDecidedByStartTimestamp() {\n delegatingTransactionService.putUnlessExists(3L, 12L);\n verify(delegate3).putUnlessExists(3L, 12L);\n }",
"class_method_signature": "SplitKeyDelegatingTransactionServiceTest.putUnlessExistsDelegateDecidedByStart... | {
"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_986 | {
"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 throwsWhenReadingClientWithoutClientSpecified() {\n TimeLockClientConfig config = ImmutableTimeLockClientConfig.builder()\n .serversList(SERVERS_LIST)\n .build();\n assertThatThrownBy(config::getClientOrThrow).isInstanceOf(IllegalStateExcep... | {
"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": "@Deprecated\n @Value.Default\n public ServerListConfig serversList() {\n return ImmutableServerListConfig.builder().build();\n }",
"class_method_signature": "TimeLockClientConfig.serversList()",
"constructor": false,
"full_signature": "@Deprecated @Value.Default public ServerListConfi... | {
"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_969 | {
"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 lockHasLongTimeout() throws InterruptedException {\n sensitiveClient.lock(NAMESPACE, LOCK_CLIENT_STRING, LOCK_REQUEST);\n\n verify(longTimeout).lock(NAMESPACE, LOCK_CLIENT_STRING, LOCK_REQUEST);\n verify(shortTimeout, never()).lock(NAMESPACE, LOCK_CLIENT_STRING, ... | {
"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<LockRefreshToken> lock(String namespace, String client, LockRequest request)\n throws InterruptedException {\n return longTimeoutProxy.lock(namespace, client, request);\n }",
"class_method_signature": "TimeoutSensitiveLockRpcClient.lock(String namespace... | {
"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_590 | {
"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 rethrowsExceptionsFromMappingFunction() {\n RuntimeException ex = new IllegalStateException(\"bad\");\n TransactionService unusableService = new SplitKeyDelegatingTransactionService<>(\n num -> {\n throw ex;\n },\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_713 | {
"fields": [],
"file": "atlasdb-commons/src/test/java/com/palantir/common/base/BatchingVisitablesTest.java",
"identifier": "BatchingVisitablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUnique() {\n BatchingVisitable<Long> visitor = ListVisitor.create(Lists.newArrayList(\n 0L, 1L, 1L, 2L, 2L, 2L, 3L, 4L, 5L, 5L, 6L, 7L, 7L));\n BatchingVisitableView<Long> bv = BatchingVisitableView.of(visitor);\n assertEquals(\"unexpected resu... | {
"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> unique(final BatchingVisitable<T> visitable) {\n return uniqueOn(visitable, Functions.<T>identity());\n }",
"class_method_signature": "BatchingVisitables.unique(final BatchingVisitable<T> visitable)",
"constructor": false,
"full_signature": "public... | {
"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_343 | {
"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 startLocalTraceWhileNotSampling() throws Exception {\n Tracer.initTrace(Optional.of(false), \"abc\");\n assertFalse(Tracer.isTraceObservable());\n try (CloseableTrace trace = CloseableTrace.startLocalTrace(\"service\", \"method({})\", \"foo\")) {\n ass... | {
"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 startLocalTrace(String serviceName,\n CharSequence operationFormat,\n Object... formatArguments) {\n if (Tracer.isTraceObservable()) {\n return startLocalTrace(\"{}.\" + operationFormat,\n ObjectArrays.concat(serviceNam... | {
"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_656 | {
"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 sweepPriorityTableNotValidated() {\n kvs.createTable(SWEEP_PRIORITY, AtlasDbConstants.EMPTY_TABLE_METADATA);\n assertThat(KeyValueServiceValidators.getValidatableTableNames(kvs, ImmutableSet.of())).isEmpty();\n }",
"class_method_signature": "KeyValueServiceValidato... | {
"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_206 | {
"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 noKnownVersionReturnsSnapshotContainingCurrentMatchingLocks() {\n LockWatchReference entireTable = LockWatchReferenceUtils.entireTable(TABLE_REF);\n lockWatches.set(createWatchesFor(entireTable));\n\n LockWatchStateUpdate update = log.getLogDiff(Optional.empty())... | {
"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_528 | {
"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 acquireLockRetries() {\n when(mockPls.acquireBackupLock(anyString()))\n .thenThrow(mock(CheckAndSetException.class))\n .thenReturn(mockLockId);\n\n manager.acquirePersistentLockWithRetry();\n\n verify(mockPls, times(2)).acquireBackup... | {
"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 void acquirePersistentLockWithRetry() {\n while (!tryAcquirePersistentLock()) {\n waitForRetry();\n }\n }",
"class_method_signature": "PersistentLockManager.acquirePersistentLockWithRetry()",
"constructor": false,
"full_signature": "public void acquirePersistentLock... | {
"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_482 | {
"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 thoroughSweepDeletesAllButLatestWithSingleDeleteAllTimestampsIncludingSentinels() {\n long lastWriteTs = 5000;\n for (long i = 1; i <= lastWriteTs; i++) {\n enqueueWriteCommitted(TABLE_THOR, i);\n }\n sweepNextBatch(ShardAndStrategy.thorough(THO... | {
"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_178 | {
"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 cannotGetAgreedStateFromTheFuture() {\n assertThatThrownBy(() -> store.getAgreedState(Long.MAX_VALUE))\n .isInstanceOf(NullPointerException.class);\n }",
"class_method_signature": "PaxosTimestampBoundStoreTest.cannotGetAgreedStateFromTheFuture()",
"constr... | {
"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_197 | {
"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 watchNewLockWatchLogsHeldLocksInRange() {\n LockWatchRequest request = tableRequest();\n lockWatcher.startWatching(request);\n\n List<LockWatchEvent> expectedEvents = ImmutableList.of(\n createdEvent(request.getReferences(), ImmutableSet.of(ROW_DES... | {
"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_894 | {
"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 unregistersLockBeforeUnlocking() {\n InOrder inOrder = Mockito.inOrder(refresher, delegate);\n\n timelock.unlock(TOKENS);\n\n inOrder.verify(refresher).unregisterLocks(TOKENS);\n inOrder.verify(delegate).unlock(TOKENS);\n }",
"class_method_signature":... | {
"fields": [
{
"declarator": "refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\")",
"modifier": "private static final",
"original_string": "private static final ScheduledExecutorService refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\");",
"type": "Scheduled... | {
"body": "@Override\n public Set<LockToken> unlock(Set<LockToken> tokens) {\n lockRefresher.unregisterLocks(tokens);\n return executeOnTimeLock(() -> delegate.unlock(tokens));\n }",
"class_method_signature": "TimeLockClient.unlock(Set<LockToken> tokens)",
"constructor": false,
"full_signatu... | {
"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_314 | {
"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 canReturnBothSafeAndUnsafeTableReferences() {\n assertThat(LoggingArgs.tableRef(ARG_NAME, SAFE_TABLE_REFERENCE)).isInstanceOf(SafeArg.class);\n assertThat(LoggingArgs.tableRef(ARG_NAME, UNSAFE_TABLE_REFERENCE)).isInstanceOf(UnsafeArg.class);\n }",
"class_method_sig... | {
"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> tableRef(TableReference tableReference) {\n return tableRef(\"tableRef\", tableReference);\n }",
"class_method_signature": "LoggingArgs.tableRef(TableReference tableReference)",
"constructor": false,
"full_signature": "public static Arg<String> tableRef(TableRefere... | {
"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_744 | {
"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 unsetTopologyAndRfOneSucceeds() throws TException {\n setTopology(defaultTopology(HOST_1), defaultTopology(HOST_2));\n when(config.replicationFactor()).thenReturn(1);\n\n assertThat(CassandraVerifier.sanityCheckDatacenters(client, config))\n .conta... | {
"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_251 | {
"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 throwsOnNonJsonInput() {\n String gobbledygook = \"]q2!a0v-_13r\";\n\n assertThatThrownBy(() -> SIMPLE_NAME_METADATA_DESCRIPTION.parseFromJson(gobbledygook, false))\n .isInstanceOf(PalantirRuntimeException.class)\n .hasMessageContaining(\"U... | {
"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_601 | {
"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 passesThroughGetsOnValidUncommittedTimestamp() {\n Long timestamp = preStartHandlingService.get(UNCOMMITTED_START_TIMESTAMP);\n assertThat(timestamp).isNull();\n verify(delegate).get(UNCOMMITTED_START_TIMESTAMP);\n }",
"class_method_signature": "PreStartHand... | {
"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_494 | {
"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 sweepableTimestampsGetsScrubbedWhenNoMoreToSweepButSweepTsInNewCoarsePartition() {\n long largestFirstPartitionCoarse = TS_COARSE_GRANULARITY - 1L;\n for (int i = 0; i < 2 * readBatchSize; i++) {\n enqueueWriteCommitted(TABLE_CONS, LOW_TS + TS_FINE_GRANULARIT... | {
"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_928 | {
"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 retryableExceptionWithRetryOtherAsIndirectCauseIsCausedByRetryOther() {\n SafeIoException safeIoException = new SafeIoException(\n \"Some I/O problem\", QosException.retryOther(createUrl()));\n RetryableException retryableException = createRetryableExcept... | {
"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_882 | {
"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 returnedTokenShouldHaveCorrectServerToken() {\n when(timelock.lock(any())).thenReturn(\n ConjureLockResponse.successful(SuccessfulLockResponse.of(LOCK_TOKEN, getLease())));\n\n LockResponse lockResponse = lockLeaseService.lock(lockRequest);\n Lease... | {
"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_181 | {
"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 forceAgreedStateThrowsIfNoStateWasAgreedUpon() {\n assertThatThrownBy(() -> store.forceAgreedState(1, null)).isInstanceOf(NullPointerException.class);\n }",
"class_method_signature": "PaxosTimestampBoundStoreTest.forceAgreedStateThrowsIfNoStateWasAgreedUpon()",
"constru... | {
"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 forceAgreedState(long seq, @Nullable Long oldState) {\n if (seq <= PaxosAcceptor.NO_LOG_ENTRY) {\n return ImmutableSequenceAndBound.of(PaxosAcceptor.NO_LOG_ENTRY, 0L);\n }\n\n Optional<SequenceAndBound> state = getLearnedState(seq);\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_5 | {
"fields": [
{
"declarator": "METRIC_NAME_1 = MetricName.builder()\n .safeName(\"com.palantir.atlasdb.metrics.lockAndGetHeldMetrics.p99\")\n .build()",
"modifier": "private static final",
"original_string": "private static final MetricName METRIC_NAME_1 = MetricName.builde... | {
"body": "@Test\n public void doesNotReplaceIfConflictDetected() {\n Timer timer = registry1.timer(METRIC_NAME_1);\n registry2.timer(METRIC_NAME_1);\n\n assertThat(disjointUnionTaggedMetricSet.getMetrics()).containsExactlyInAnyOrderEntriesOf(\n ImmutableMap.of(METRIC_NAME_1, ti... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DisjointUnionTaggedMetricSet.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(DisjointUnionTaggedMetricSet.class);",
"type": "Logger",
"var_name": "l... | {
"body": "@Override\n public Map<MetricName, Metric> getMetrics() {\n Map<MetricName, Metric> firstMetrics = first.getMetrics();\n Map<MetricName, Metric> secondMetrics = second.getMetrics();\n\n Map<MetricName, Metric> metrics = new HashMap<>(firstMetrics.size() + secondMetrics.size());\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_752 | {
"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 simpleStrategyOneDcOneRfSucceedsAndUpdatesKsDef() throws TException {\n setTopology(createDetails(DC_1, RACK_1, HOST_1));\n when(config.replicationFactor()).thenReturn(1);\n KsDef ksDef = new KsDef(\"test\", CassandraConstants.SIMPLE_STRATEGY, ImmutableList.of())... | {
"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 KsDef checkAndSetReplicationFactor(CassandraClient client, KsDef ksDef,\n CassandraKeyValueServiceConfig config) throws TException {\n KsDef result = ksDef;\n Set<String> datacenters;\n if (Objects.equals(result.getStrategy_class(), CassandraConstants.SIMPLE_STRATEGY)... | {
"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_302 | {
"fields": [
{
"declarator": "NAMESPACE = Namespace.create(\"test\")",
"modifier": "private static final",
"original_string": "private static final Namespace NAMESPACE = Namespace.create(\"test\");",
"type": "Namespace",
"var_name": "NAMESPACE"
},
{
"declarator": "ROW_... | {
"body": "@Test\n public void multiPut() throws Exception {\n Map<TableReference, Map<Cell, byte[]>> values = ImmutableMap.of(TABLE_REF, ImmutableMap.of(CELL, VALUE_BYTES));\n kvs.multiPut(values, TIMESTAMP);\n\n checkSpan(\"atlasdb-kvs.multiPut(1 values, ts 1)\");\n verify(delegate).m... | {
"fields": [
{
"declarator": "SERVICE_NAME = \"atlasdb-kvs\"",
"modifier": "private static final",
"original_string": "private static final String SERVICE_NAME = \"atlasdb-kvs\";",
"type": "String",
"var_name": "SERVICE_NAME"
},
{
"declarator": "delegate",
"modif... | {
"body": "@Override\n public void multiPut(Map<TableReference, ? extends Map<Cell, byte[]>> valuesByTable,\n long timestamp) {\n //noinspection unused - try-with-resources closes trace\n try (CloseableTrace trace = startLocalTrace(\"multiPut({} values, ts {})\",\n valuesByT... | {
"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_617 | {
"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 closesCleanerOnClose() {\n snapshotTransactionManager.close();\n verify(cleaner, times(1)).close();\n }",
"class_method_signature": "SnapshotTransactionManagerTest.closesCleanerOnClose()",
"constructor": false,
"full_signature": "@Test public void closesCleaner... | {
"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_247 | {
"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 // TODO (jkong): Tolerating duplicate fields was permitted, even though it is a bit dubious.\n public void duplicateFieldsAreTolerated() {\n String invalidJson = \"{\\\"string\\\": \\\"tom\\\", \\\"string\\\": \\\"robert\\\"}\";\n byte[] result = SIMPLE_NAME_METADATA_DESCRIPTION... | {
"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_990 | {
"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 namespacingCanDealWithServerListConfigsWithZeroNodes() {\n ServerListConfig namespacedServersList = ServerListConfigs.namespaceUris(SERVERS_LIST_EMPTY, CLIENT);\n assertThat(namespacedServersList.servers()).isEmpty();\n }",
"class_method_signature": "ServerListConf... | {
"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_569 | {
"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 throwsIfInitialMapIsEmpty() {\n assertThatThrownBy(() -> TimestampPartitioningMap.of(ImmutableRangeMap.of()))\n .isInstanceOf(IllegalArgumentException.class)\n .hasMessageContaining(\"its span does not cover precisely all timestamps\");\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_139 | {
"fields": [
{
"declarator": "print = new OutputPrinter(LoggerFactory.getLogger(OutputPrinter.class))",
"modifier": "private static final",
"original_string": "private static final OutputPrinter print = new OutputPrinter(LoggerFactory.getLogger(OutputPrinter.class));",
"type": "OutputPrin... | {
"body": "@Test\n public void testWarnPrintingWorksWithSingleReplacement() {\n String systemOut = StandardStreamUtilities.wrapSystemErr(\n () -> print.warn(\"Test this gets {}\", UnsafeArg.of(\"replaced\", \"replaced\")));\n assertThat(systemOut).contains(\"Test this gets replaced \")... | {
"fields": [
{
"declarator": "logger",
"modifier": "private",
"original_string": "private Logger logger;",
"type": "Logger",
"var_name": "logger"
}
],
"file": "atlasdb-cli/src/main/java/com/palantir/atlasdb/cli/output/OutputPrinter.java",
"identifier": "OutputPrinter",
"... | {
"body": "@Override\n public void warn(String message, Arg... args) {\n String warnMessage = MessageFormatter.arrayFormat(message, args).getMessage();\n logger.warn(message, args);\n System.err.println(warnMessage);\n }",
"class_method_signature": "OutputPrinter.warn(String message, Arg.... | {
"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_586 | {
"fields": [
{
"declarator": "ENCODING_STRATEGY = V1EncodingStrategy.INSTANCE",
"modifier": "private static final",
"original_string": "private static final V1EncodingStrategy ENCODING_STRATEGY = V1EncodingStrategy.INSTANCE;",
"type": "V1EncodingStrategy",
"var_name": "ENCODING_STRA... | {
"body": "@Test\n public void repeatedProcessBatchFiltersOutPartialSuccesses() {\n KeyAlreadyExistsException exception = new KeyAlreadyExistsException(\"boo\",\n ImmutableList.of(ENCODING_STRATEGY.encodeStartTimestampAsCell(5L)),\n ImmutableList.of(ENCODING_STRATEGY.encodeStar... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(WriteBatchingTransactionService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(WriteBatchingTransactionService.class);",
"type": "Logger",
"var_nam... | {
"body": "@VisibleForTesting\n static void processBatch(\n EncodingTransactionService delegate, List<BatchElement<TimestampPair, Void>> batchElements) {\n Multimap<Long, BatchElement<TimestampPair, Void>> startTimestampKeyedBatchElements\n = MultimapBuilder.hashKeys().hashSetValue... | {
"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_355 | {
"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\n public void largerArraysThanDataGetPartiallyFilled() throws IOException {\n byte[] result = new byte[DATA_SIZE_PLUS_ONE];\n int read = dataStream.read(result);\n assertEquals(DATA_SIZE, read);\n assertArrayEquals(data, Arrays.copyOf(result, DATA_SIZE));\n }",
"cl... | {
"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_705 | {
"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 delegatesToDelegate() {\n assertThat(supplier.get()).isEqualTo(DEFAULT_VALUE);\n\n verify(delegate).get();\n verifyNoMoreInteractions(delegate);\n }",
"class_method_signature": "CoalescingSupplierTest.delegatesToDelegate()",
"constructor": false,
"full_s... | {
"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": "@Override\n public T get() {\n Round present = round;\n if (present.isFirstToArrive()) {\n present.execute();\n return present.getResult();\n }\n Round next = present.awaitDone();\n if (next.isFirstToArrive()) {\n next.execute();\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_210 | {
"fields": [
{
"declarator": "BLOCKING_TIME_LIMIT_MILLIS = 10L",
"modifier": "private static final",
"original_string": "private static final long BLOCKING_TIME_LIMIT_MILLIS = 10L;",
"type": "long",
"var_name": "BLOCKING_TIME_LIMIT_MILLIS"
},
{
"declarator": "TEST_CURR... | {
"body": "@Test\n public void throwsBlockingTimeoutExceptionIfInterruptibleOperationTimesOut() {\n assertThatThrownBy(() -> timingOutService.lock(CLIENT, LOCK_REQUEST))\n .isInstanceOf(BlockingTimeoutException.class);\n }",
"class_method_signature": "BlockingTimeLimitedLockServiceTest.t... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BlockingTimeLimitedLockService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BlockingTimeLimitedLockService.class);",
"type": "Logger",
"var_name"... | {
"body": "@Nullable\n @Override\n public LockRefreshToken lock(@PathParam(\"client\") String client, LockRequest request) throws InterruptedException {\n return callWithTimeLimit(\n () -> delegate.lock(client, request),\n ImmutableLockRequestSpecification.of(\"lock\", clien... | {
"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_640 | {
"fields": [
{
"declarator": "TIMESTAMP_1 = 10L",
"modifier": "private static final",
"original_string": "private static final long TIMESTAMP_1 = 10L;",
"type": "long",
"var_name": "TIMESTAMP_1"
},
{
"declarator": "TIMESTAMP_2 = 20L",
"modifier": "private static ... | {
"body": "@Test\n public void getTimestampForMillisReturnsLastTimestampKnownToOccurBeforeQueriedTime() {\n PUNCHER_HISTORY.forEach((key, value) -> assertThat(puncherStore.get(value + 1)).isEqualTo(key));\n }",
"class_method_signature": "KeyValueServicePuncherStoreTest.getTimestampForMillisReturnsLastT... | {
"fields": [
{
"declarator": "COLUMN = \"t\".getBytes(StandardCharsets.UTF_8)",
"modifier": "private static final",
"original_string": "private static final byte[] COLUMN = \"t\".getBytes(StandardCharsets.UTF_8);",
"type": "byte[]",
"var_name": "COLUMN"
},
{
"declarato... | {
"body": "@Override\n public Long get(Long timeMillis) {\n return get(keyValueService, timeMillis);\n }",
"class_method_signature": "KeyValueServicePuncherStore.get(Long timeMillis)",
"constructor": false,
"full_signature": "@Override public Long get(Long timeMillis)",
"identifier": "get",
"in... | {
"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_457 | {
"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 doNotReduceToZeroTasks() throws Exception {\n when(sweepIteration.call()).thenReturn(SUCCESS_SMALL);\n scheduler.start(1);\n\n tickClock();\n runSweepIterations(5);\n tickClock();\n runSweepIterations(5);\n verify(sweepIteration, times... | {
"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_98 | {
"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 shouldBeUnhealthyIfQuorumNodesAreUpAndNoNodePingedSuccessfully() {\n HealthCheckPinger leader1 = getMockOfPingableLeaderWherePingReturns(ImmutableSet.of());\n HealthCheckPinger leader2 = getMockOfPingableLeaderWherePingReturns(ImmutableSet.of());\n HealthCheckPin... | {
"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_904 | {
"fields": [
{
"declarator": "lockLeaseService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private LockLeaseService lockLeaseService;",
"type": "LockLeaseService",
"var_name": "lockLeaseService"
},
{
"declarator": "lockWatchEventCache = spy(NoOpL... | {
"body": "@Test\n public void shouldDeriveStartTransactionResponseBatchFromBatchedResponse_multipleTransactions() {\n ConjureStartTransactionsResponse batchResponse = getStartTransactionResponse(12, 5);\n\n when(lockLeaseService.startTransactionsWithWatches(version, 5)).thenReturn(batchResponse);\n ... | {
"fields": [
{
"declarator": "autobatcher",
"modifier": "private final",
"original_string": "private final DisruptorAutobatcher<Integer, List<StartIdentifiedAtlasDbTransactionResponse>> autobatcher;",
"type": "DisruptorAutobatcher<Integer, List<StartIdentifiedAtlasDbTransactionResponse>>"... | {
"body": "List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) {\n Preconditions.checkArgument(count > 0, \"Cannot start 0 or fewer transactions\");\n return AtlasFutures.getUnchecked(autobatcher.apply(count));\n }",
"class_method_signature": "Transacti... | {
"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_841 | {
"fields": [
{
"declarator": "FORTY_TWO = 42",
"modifier": "private static final",
"original_string": "private static final int FORTY_TWO = 42;",
"type": "int",
"var_name": "FORTY_TWO"
},
{
"declarator": "LEADING_PI_DIGITS = 314159265358979L",
"modifier": "privat... | {
"body": "@Test\n public void testGetFreshTimestampsDefersToTimestampService() {\n managedTimestampService.getFreshTimestamps(FORTY_TWO);\n\n verify(timestampService, times(1)).getFreshTimestamps(eq(FORTY_TWO));\n }",
"class_method_signature": "DelegatingManagedTimestampServiceTest.testGetFresh... | {
"fields": [
{
"declarator": "timestampService",
"modifier": "private final",
"original_string": "private final TimestampService timestampService;",
"type": "TimestampService",
"var_name": "timestampService"
},
{
"declarator": "timestampManagementService",
"modif... | {
"body": "@Override\n public TimestampRange getFreshTimestamps(@QueryParam(\"number\") int numTimestampsRequested) {\n return timestampService.getFreshTimestamps(numTimestampsRequested);\n }",
"class_method_signature": "DelegatingManagedTimestampService.getFreshTimestamps(@QueryParam(\"number\") int 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_512 | {
"fields": [
{
"declarator": "SUCCESS_TOO_FAST = SweepIterationResults.success(1L)",
"modifier": "private static final",
"original_string": "private static final SweepIterationResult SUCCESS_TOO_FAST = SweepIterationResults.success(1L);",
"type": "SweepIterationResult",
"var_name": ... | {
"body": "@Test\n public void insufficientConsistencyReturnsBackoff() {\n assertThat(delay.getNextPause(SweepIterationResults.insufficientConsistency())).isEqualTo(BACKOFF);\n }",
"class_method_signature": "SweepDelayTest.insufficientConsistencyReturnsBackoff()",
"constructor": false,
"full_signat... | {
"fields": [
{
"declarator": "BATCH_CELLS_LOW_THRESHOLD = 100",
"modifier": "static final",
"original_string": "static final int BATCH_CELLS_LOW_THRESHOLD = 100;",
"type": "int",
"var_name": "BATCH_CELLS_LOW_THRESHOLD"
},
{
"declarator": "MIN_PAUSE_MILLIS = 1",
"... | {
"body": "long getNextPause(SweepIterationResult result) {\n return SweepIterationResults.caseOf(result)\n .success(this::updateCurrentPauseAndGet)\n .unableToAcquireShard_(maxPauseMillis)\n .insufficientConsistency_(BACKOFF)\n .otherError_(maxPauseM... | {
"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_77 | {
"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 getCurrentHostname_not_k8s() throws Exception {\n expectedException.expect(RuntimeException.class);\n expectedException.expectMessage(\"Not running in a k8s stateful set.\");\n NON_K8S_INSTANCE.getCurrentHostname();\n }",
"class_method_signature": "Kubernete... | {
"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 String getCurrentHostname() {\n Matcher matcher = getHostnameComponents();\n return String.format(\n POD_HOSTNAME_TEMPLATE,\n matcher.group(\"service\"),\n Integer.valueOf(matcher.group(\"podId\")),\n matcher.group(\"service\"... | {
"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_142 | {
"fields": [
{
"declarator": "NAMESPACE_1 = Client.of(\"eins\")",
"modifier": "private static final",
"original_string": "private static final Client NAMESPACE_1 = Client.of(\"eins\");",
"type": "Client",
"var_name": "NAMESPACE_1"
},
{
"declarator": "NAMESPACE_2 = Clie... | {
"body": "@Test\n public void canReturnZeroNamespaces() {\n assertThat(namespaceLoader.getAllPersistedNamespaces()).isEmpty();\n }",
"class_method_signature": "SqliteNamespaceLoaderTest.canReturnZeroNamespaces()",
"constructor": false,
"full_signature": "@Test public void canReturnZeroNamespaces()... | {
"fields": [
{
"declarator": "jdbi",
"modifier": "private final",
"original_string": "private final Jdbi jdbi;",
"type": "Jdbi",
"var_name": "jdbi"
}
],
"file": "timelock-impl/src/main/java/com/palantir/atlasdb/timelock/management/SqliteNamespaceLoader.java",
"identifier":... | {
"body": "@Override\n public Set<Client> getAllPersistedNamespaces() {\n return jdbi.withExtension(SqlitePaxosStateLog.Queries.class, SqlitePaxosStateLog.Queries::getAllNamespaces)\n .stream()\n .map(Client::of)\n .collect(Collectors.toSet());\n }",
"class_... | {
"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_791 | {
"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(expected = UnknownHostException.class)\n public void shouldThrowIfPortsAreNotTheSameAddressDoesNotMatch() throws UnknownHostException {\n InetSocketAddress host2 = new InetSocketAddress(HOSTNAME_2, OTHER_PORT);\n\n CassandraService cassandra = clientPoolWithServers(ImmutableSet.of(HO... | {
"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_284 | {
"fields": [
{
"declarator": "NAMESPACE = Namespace.create(\"test\")",
"modifier": "private static final",
"original_string": "private static final Namespace NAMESPACE = Namespace.create(\"test\");",
"type": "Namespace",
"var_name": "NAMESPACE"
},
{
"declarator": "ROW_... | {
"body": "@Test\n public void addGarbageCollectionSentinelValues() throws Exception {\n ImmutableSet<Cell> cells = ImmutableSet.of(CELL);\n kvs.addGarbageCollectionSentinelValues(TABLE_REF, cells);\n\n checkSpan(\"atlasdb-kvs.addGarbageCollectionSentinelValues({table}, 1 cells)\");\n v... | {
"fields": [
{
"declarator": "SERVICE_NAME = \"atlasdb-kvs\"",
"modifier": "private static final",
"original_string": "private static final String SERVICE_NAME = \"atlasdb-kvs\";",
"type": "String",
"var_name": "SERVICE_NAME"
},
{
"declarator": "delegate",
"modif... | {
"body": "@Override\n public void addGarbageCollectionSentinelValues(TableReference tableRef, Iterable<Cell> cells) {\n //noinspection unused - try-with-resources closes trace\n try (CloseableTrace trace = startLocalTrace(\"addGarbageCollectionSentinelValues({}, {} cells)\",\n Logging... | {
"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_953 | {
"fields": [
{
"declarator": "CLIENT = \"testClient\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT = \"testClient\";",
"type": "String",
"var_name": "CLIENT"
},
{
"declarator": "USER_AGENT_NAME = \"user-agent\"",
"m... | {
"body": "@Test\n public void remoteCallsElidedIfTalkingToLocalServer() throws IOException {\n setUpForLocalServices();\n setUpLeaderBlockInConfig();\n\n TransactionManagers.LockAndTimestampServices lockAndTimestamp = getLockAndTimestampServices();\n availableServer.verify(getRequested... | {
"fields": [
{
"declarator": "LOGGING_INTERVAL = 60",
"modifier": "private static final",
"original_string": "private static final int LOGGING_INTERVAL = 60;",
"type": "int",
"var_name": "LOGGING_INTERVAL"
},
{
"declarator": "log = LoggerFactory.getLogger(TransactionMa... | {
"body": "private static LockAndTimestampServices getLockAndTimestampServices(\n MetricsManager metricsManager,\n Refreshable<ServerListConfig> timelockServerListConfig,\n UserAgent userAgent,\n String timelockNamespace,\n Optional<LockDiagnosticComponents> 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_400 | {
"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 numberOfTombstonesAccumulatesOverShards() {\n metrics.updateNumberOfTombstones(CONS_ZERO, 1);\n metrics.updateNumberOfTombstones(CONS_TWO, 1);\n metrics.updateNumberOfTombstones(CONS_ZERO, 1);\n\n assertThat(metricsManager).hasTombstonesPutConservativeEqua... | {
"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 updateNumberOfTombstones(ShardAndStrategy shardStrategy, long tombstones) {\n updateMetricsIfPresent(shardStrategy, metrics -> metrics.updateNumberOfTombstones(tombstones));\n }",
"class_method_signature": "TargetedSweepMetrics.updateNumberOfTombstones(ShardAndStrategy shardStrategy... | {
"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_115 | {
"fields": [
{
"declarator": "SLOW_LOG_TRIGGER_MILLIS = LockServiceImpl.DEBUG_SLOW_LOG_TRIGGER_MILLIS + 10",
"modifier": "public static final",
"original_string": "public static final long SLOW_LOG_TRIGGER_MILLIS = LockServiceImpl.DEBUG_SLOW_LOG_TRIGGER_MILLIS + 10;",
"type": "long",
... | {
"body": "@Test\n public void debugLogShouldBeLoggedIfLockResponseTimeIsBetweenDebugTriggerTimeAndSlowLogTriggerMillis() {\n long lockDurationMillis = SLOW_LOG_TRIGGER_MILLIS - 5;\n lockServiceWithSlowLogEnabled.logSlowLockAcquisition(TEST_LOCKID, LockClient.ANONYMOUS, lockDurationMillis);\n\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(LockServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(LockServiceImpl.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@VisibleForTesting\n protected void logSlowLockAcquisition(String lockId, LockClient currentHolder, long durationMillis) {\n final String slowLockLogMessage = \"Blocked for {} ms to acquire lock {} {}.\";\n\n // Note: The construction of params is pushed into the branches, as it may be exp... | {
"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_545 | {
"fields": [
{
"declarator": "MAPPER = new ObjectMapper()",
"modifier": "private static final",
"original_string": "private static final ObjectMapper MAPPER = new ObjectMapper();",
"type": "ObjectMapper",
"var_name": "MAPPER"
},
{
"declarator": "ROW = \"row\"",
"... | {
"body": "@Test\n public void cellContainsRowAndColumn() {\n Cell cell = LOCK_ENTRY.cell();\n assertArrayEquals(ROW_BYTES, cell.getRowName());\n assertArrayEquals(LOCK_BYTES, cell.getColumnName());\n }",
"class_method_signature": "LockEntryTest.cellContainsRowAndColumn()",
"constructor... | {
"fields": [
{
"declarator": "MAPPER = new ObjectMapper()",
"modifier": "private static final",
"original_string": "private static final ObjectMapper MAPPER = new ObjectMapper();",
"type": "ObjectMapper",
"var_name": "MAPPER"
},
{
"declarator": "LOCK_COLUMN = \"lock\""... | {
"body": "public Cell cell() {\n return Cell.create(asUtf8Bytes(lockName()), asUtf8Bytes(LOCK_COLUMN));\n }",
"class_method_signature": "LockEntry.cell()",
"constructor": false,
"full_signature": "public Cell cell()",
"identifier": "cell",
"invocations": [
"create",
"asUtf8Bytes",
"lo... | {
"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_20 | {
"fields": [
{
"declarator": "RUNTIME = new RuntimeException()",
"modifier": "private static final",
"original_string": "private static final Exception RUNTIME = new RuntimeException();",
"type": "Exception",
"var_name": "RUNTIME"
},
{
"declarator": "ATLAS_DEPENDENCY =... | {
"body": "@Test\n public void exactMatch() {\n RetryLimitReachedException exception = new RetryLimitReachedException(\n ImmutableList.of(RUNTIME, ATLAS_DEPENDENCY, GENERIC));\n Assertions.assertThat(exception.suppressed(RuntimeException.class)).isTrue();\n }",
"class_method_signa... | {
"fields": [
{
"declarator": "MESSAGE = \"Request was retried and failed each time for the request.\"",
"modifier": "private static final",
"original_string": "private static final String MESSAGE = \"Request was retried and failed each time for the request.\";",
"type": "String",
"v... | {
"body": "public <E extends Exception> boolean suppressed(Class<E> type) {\n return Arrays.stream(getSuppressed()).anyMatch(type::isInstance);\n }",
"class_method_signature": "RetryLimitReachedException.suppressed(Class<E> type)",
"constructor": false,
"full_signature": "public boolean suppressed(Cla... | {
"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_816 | {
"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": "HOSTNAME_1 = \"1.0.0.0\"",
"modifier": "priva... | {
"body": "@Test\n public void shouldSeparateRetriesOnDifferentHosts() {\n request.triedOnHost(HOST_1);\n assertNumberOfTotalAttempts(1);\n assertNumberOfAttemptsOnHost(1, HOST_1);\n assertNumberOfAttemptsOnHost(0, HOST_2);\n\n request.triedOnHost(HOST_2);\n assertNumberOf... | {
"fields": [
{
"declarator": "preferredHost",
"modifier": "private final",
"original_string": "private final InetSocketAddress preferredHost;",
"type": "InetSocketAddress",
"var_name": "preferredHost"
},
{
"declarator": "fn",
"modifier": "private final",
"o... | {
"body": "public void triedOnHost(InetSocketAddress host) {\n triedHosts.merge(host, 1, (old, ignore) -> old + 1);\n }",
"class_method_signature": "RetryableCassandraRequest.triedOnHost(InetSocketAddress host)",
"constructor": false,
"full_signature": "public void triedOnHost(InetSocketAddress host)"... | {
"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_396 | {
"fields": [
{
"declarator": "adjustableConfig",
"modifier": "private",
"original_string": "private AdjustableSweepBatchConfigSource adjustableConfig;",
"type": "AdjustableSweepBatchConfigSource",
"var_name": "adjustableConfig"
},
{
"declarator": "previousConfig",
... | {
"body": "@Test\n public void canDecreaseAndIncreaseConfigWithMixOfValues() {\n //Given\n configWithValues(1000, 1, 100);\n\n whenDecreasingTheMultiplier_thenAdjustedConfigValuesDecrease();\n\n whenIncreasingTheMultiplier_thenAdjustedConfigValuesIncrease();\n\n assertThat(Adjust... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BackgroundSweeperImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BackgroundSweeperImpl.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "public static double getBatchSizeMultiplier() {\n return batchSizeMultiplier;\n }",
"class_method_signature": "AdjustableSweepBatchConfigSource.getBatchSizeMultiplier()",
"constructor": false,
"full_signature": "public static double getBatchSizeMultiplier()",
"identifier": "getBatchSizeMu... | {
"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_729 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/HiddenTablesTest.java",
"identifier": "HiddenTablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldSayANamespacedTableIsNotHidden() {\n assertThat(HiddenTables.isHidden(TableReference.createFromFullyQualifiedName(\"namespace.table\")), is(false));\n }",
"class_method_signature": "HiddenTablesTest.shouldSayANamespacedTableIsNotHidden()",
"constructor": false,
... | {
"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_683 | {
"fields": [
{
"declarator": "INIT_FAIL = new RuntimeException(\"Failed during initialization.\")",
"modifier": "private static final",
"original_string": "private static final RuntimeException INIT_FAIL = new RuntimeException(\"Failed during initialization.\");",
"type": "RuntimeExceptio... | {
"body": "@Test\n public void singleAttemptCallbackCallsInitializeOnceAndSkipsCleanupOnSuccess() {\n callback = LambdaCallback.singleAttempt(this::markInit, this::markCleanup);\n\n callback.runWithRetry(initsAndCleanups);\n assertThat(initsAndCleanups.inits()).isEqualTo(1);\n assertTha... | {
"fields": [
{
"declarator": "FAIL = (ignore, throwable) -> {\n throw Throwables.rewrapAndThrowUncheckedException(throwable);\n }",
"modifier": "private static final",
"original_string": "private static final BiConsumer<Object, Throwable> FAIL = (ignore, throwable) -> {\n throw... | {
"body": "public static <R> Callback<R> singleAttempt(Consumer<R> initialize, BiConsumer<R, Throwable> onInitFailureCleanup) {\n return new LambdaCallback<>(initialize, onInitFailureCleanup.andThen(FAIL));\n }",
"class_method_signature": "LambdaCallback.singleAttempt(Consumer<R> initialize, BiConsumer<R,... | {
"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_379 | {
"fields": [],
"file": "commons-executors/src/test/java/com/palantir/common/concurrent/PTExecutorsTest.java",
"identifier": "PTExecutorsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExecutorName_customThreadFactory_fallback() {\n ThreadFactory factory = runnable -> {\n Thread thread = Executors.defaultThreadFactory().newThread(runnable);\n thread.setName(\"1\");\n return thread;\n };\n assertThat(PTExecut... | {
"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_416 | {
"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 testFatalIsBinary() {\n SweepOutcomeMetrics.LEGACY_OUTCOMES.forEach(outcome ->\n IntStream.range(0, 10).forEach(ignore -> legacyMetrics.registerOccurrenceOf(outcome)));\n assertThat(metricsManager).hasLegacyOutcomeEqualTo(SweepOutcome.FATAL, 1L);\n }",... | {
"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_945 | {
"fields": [
{
"declarator": "URL_1 = createUrlUnchecked(\"https\", \"hostage\", 42, \"/request/hourai-branch\")",
"modifier": "private static final",
"original_string": "private static final URL URL_1 = createUrlUnchecked(\"https\", \"hostage\", 42, \"/request/hourai-branch\");",
"type":... | {
"body": "@Test\n public void throwsIfNodeUnrecognized() {\n assertThatThrownBy(() -> RedirectRetryTargeter.create(URL_3, ImmutableList.of(URL_1)))\n .isInstanceOf(IllegalArgumentException.class)\n .hasMessageContaining(\"Local server not found in the list of cluster URLs.\");... | {
"fields": [
{
"declarator": "otherServers",
"modifier": "private final",
"original_string": "private final List<URL> otherServers;",
"type": "List<URL>",
"var_name": "otherServers"
},
{
"declarator": "urlsToHostAndPort",
"modifier": "private final",
"origi... | {
"body": "public static RedirectRetryTargeter create(URL localServer, List<URL> clusterUrls) {\n Preconditions.checkArgument(clusterUrls.contains(localServer),\n \"Local server not found in the list of cluster URLs.\",\n SafeArg.of(\"localServer\", localServer),\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_1001 | {
"fields": [
{
"declarator": "COORDINATION_ROW = PtBytes.toBytes(\"aaaaa\")",
"modifier": "private static final",
"original_string": "private static final byte[] COORDINATION_ROW = PtBytes.toBytes(\"aaaaa\");",
"type": "byte[]",
"var_name": "COORDINATION_ROW"
},
{
"dec... | {
"body": "@Test\n public void retriesOnKeyValueServiceWhenValuesDeletedInTransforms() throws JsonProcessingException {\n KeyValueService mockKvs = mock(KeyValueService.class);\n KeyValueServiceCoordinationStore<String> store = coordinationStoreForKvs(mockKvs);\n setupOnceFailingMockKvs(mockKv... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(KeyValueServiceCoordinationStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(KeyValueServiceCoordinationStore.class);",
"type": "Logger",
"var_n... | {
"body": "@Override\n public CheckAndSetResult<ValueAndBound<T>> transformAgreedValue(Function<ValueAndBound<T>, T> transform) {\n Optional<CoordinationStoreState<T>> storeState = readLatestState();\n\n T targetValue = transform.apply(\n storeState.map(CoordinationStoreState::valueAnd... | {
"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_800 | {
"fields": [
{
"declarator": "MIN_THRESHOLD = 0.1",
"modifier": "private static final",
"original_string": "private static final double MIN_THRESHOLD = 0.1;",
"type": "double",
"var_name": "MIN_THRESHOLD"
},
{
"declarator": "MAX_THRESHOLD = 2.0",
"modifier": "pri... | {
"body": "@Test\n public void returnsNullWhenNoDistributionPresent() {\n assertThat(defaultController.getMeanGauge().getValue()).isEqualTo(null);\n }",
"class_method_signature": "DistributionOutlierControllerTest.returnsNullWhenNoDistributionPresent()",
"constructor": false,
"full_signature": "@Te... | {
"fields": [
{
"declarator": "REFRESH_INTERVAL = Duration.ofSeconds(30)",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final Duration REFRESH_INTERVAL = Duration.ofSeconds(30);",
"type": "Duration",
"var_name": "REFRESH_INTER... | {
"body": "Gauge<Double> getMeanGauge() {\n return meanGauge;\n }",
"class_method_signature": "DistributionOutlierController.getMeanGauge()",
"constructor": false,
"full_signature": " Gauge<Double> getMeanGauge()",
"identifier": "getMeanGauge",
"invocations": [],
"modifiers": "",
"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_36 | {
"fields": [
{
"declarator": "TEST_PREFIX = \"a_\"",
"modifier": "private static final",
"original_string": "private static final String TEST_PREFIX = \"a_\";",
"type": "String",
"var_name": "TEST_PREFIX"
},
{
"declarator": "TEST_NAMESPACE = Namespace.create(\"test_nam... | {
"body": "@Test\n public void cacheIsActuallyUsed() throws TableMappingNotFoundException {\n // do a normal read\n when(resultSet.size()).thenReturn(1);\n\n AgnosticResultRow row = mock(AgnosticResultRow.class);\n when(row.getString(eq(\"short_table_name\"))).thenReturn(SHORT_TABLE_NAM... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(OracleTableNameUnmapper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(OracleTableNameUnmapper.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "@SuppressWarnings(\"checkstyle:NestedTryDepth\")\n public String getShortTableNameFromMappingTable(\n ConnectionSupplier connectionSupplier,\n String tablePrefix,\n TableReference tableRef) throws TableMappingNotFoundException {\n String fullTableName = tablePrefi... | {
"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_553 | {
"fields": [
{
"declarator": "TABLE_1 = \"table1\"",
"modifier": "private static final",
"original_string": "private static final String TABLE_1 = \"table1\";",
"type": "String",
"var_name": "TABLE_1"
},
{
"declarator": "TABLE_2 = \"table2\"",
"modifier": "privat... | {
"body": "@Test\n public void returnsEmptyWhenTablesWereCompactedRecently() {\n // Returns empty when all tables were swept and then compacted, and each compact time is the past hour\n Long currentTime = System.currentTimeMillis();\n when(sweepHistoryProvider.getHistory(mockTx))\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CompactPriorityCalculator.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CompactPriorityCalculator.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@VisibleForTesting\n Optional<String> selectTableToCompactInternal(Transaction tx) {\n Map<String, Long> tableToLastTimeSwept = sweepHistoryProvider.getHistory(tx);\n Map<String, Long> tableToLastTimeCompacted = compactionHistoryProvider.getHistory(tx);\n\n Optional<String> tableToC... | {
"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_103 | {
"fields": [
{
"declarator": "LOCK_CLIENT = LockClient.of(\"foo\")",
"modifier": "private static final",
"original_string": "private static final LockClient LOCK_CLIENT = LockClient.of(\"foo\");",
"type": "LockClient",
"var_name": "LOCK_CLIENT"
},
{
"declarator": "FRES... | {
"body": "@Test\n public void freshTimestampDelegatesToTimestampService() {\n assertThat(timelock.getFreshTimestamp()).isEqualTo(FRESH_TIMESTAMP);\n }",
"class_method_signature": "LegacyTimelockServiceTest.freshTimestampDelegatesToTimestampService()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [
{
"declarator": "timestampService",
"modifier": "private final",
"original_string": "private final TimestampService timestampService;",
"type": "TimestampService",
"var_name": "timestampService"
},
{
"declarator": "lockService",
"modifier": "private ... | {
"body": "@Override\n public long getFreshTimestamp() {\n return timestampService.getFreshTimestamp();\n }",
"class_method_signature": "LegacyTimelockService.getFreshTimestamp()",
"constructor": false,
"full_signature": "@Override public long getFreshTimestamp()",
"identifier": "getFreshTimestam... | {
"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_380 | {
"fields": [],
"file": "commons-executors/src/test/java/com/palantir/common/concurrent/PTExecutorsTest.java",
"identifier": "PTExecutorsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @SuppressWarnings(\"deprecation\") // Testing a component that relies on the singleton TaggedMetricRegistry\n public void testCachedExecutorMetricsRecorded() {\n // Metrics are recorded to the global singleton registry, so we generate a random name to avoid\n // clobbering state... | {
"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": "public static ExecutorService newCachedThreadPool() {\n return newCachedThreadPool(computeBaseThreadName());\n }",
"class_method_signature": "PTExecutors.newCachedThreadPool()",
"constructor": false,
"full_signature": "public static ExecutorService newCachedThreadPool()",
"identifier": "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_695 | {
"fields": [
{
"declarator": "delegate",
"modifier": "@Mock private",
"original_string": "@Mock private TestInterface delegate;",
"type": "TestInterface",
"var_name": "delegate"
},
{
"declarator": "supplier",
"modifier": "@Mock private",
"original_string": ... | {
"body": "@Test\n public void testExceptionMatching() {\n RuntimeException exception = new RuntimeException();\n TestInterface iface = ReplaceIfExceptionMatchingProxy.newProxyInstance(\n TestInterface.class, supplier, thrown -> thrown.equals(exception));\n iface.doSomething();\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ReplaceIfExceptionMatchingProxy.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ReplaceIfExceptionMatchingProxy.class);",
"type": "Logger",
"var_nam... | {
"body": "@SuppressWarnings(\"unchecked\")\n @VisibleForTesting\n static <T> T newProxyInstance(\n Class<T> interfaceClass,\n Supplier<T> delegate,\n Predicate<Throwable> shouldReplace) {\n return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(),\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_912 | {
"fields": [
{
"declarator": "REFRESH_INTERVAL_MILLIS = 1234L",
"modifier": "private static final",
"original_string": "private static final long REFRESH_INTERVAL_MILLIS = 1234L;",
"type": "long",
"var_name": "REFRESH_INTERVAL_MILLIS"
},
{
"declarator": "TOKEN_1 = Lock... | {
"body": "@Test\n public void doesNotFailIfDelegateThrows() {\n ImmutableSet<LockToken> lockTokensToRefresh = ImmutableSet.of(TOKEN_1);\n when(timelock.refreshLockLeases(any()))\n .thenThrow(new RuntimeException(\"test\"))\n .thenReturn(lockTokensToRefresh);\n re... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(LockRefresher.class)",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(LockRefresher.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "execut... | {
"body": "public void registerLocks(Collection<LockToken> tokens) {\n tokensToRefresh.addAll(tokens);\n }",
"class_method_signature": "LockRefresher.registerLocks(Collection<LockToken> tokens)",
"constructor": false,
"full_signature": "public void registerLocks(Collection<LockToken> tokens)",
"iden... | {
"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_441 | {
"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 getStrategyQueriesKvsOnlyOnceForEachTable() {\n for (int i = 0; i < 5; i++) {\n partitioner.getStrategy(getWriteInfoWithFixedCellHash(NOTHING, i));\n partitioner.getStrategy(getWriteInfoWithFixedCellHash(CONSERVATIVE, i));\n }\n verify(mockK... | {
"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_154 | {
"fields": [
{
"declarator": "FEEDBACK = ConjureTimeLockClientFeedback.builder()\n .atlasVersion(\"1.2.3\")\n .serviceName(\"tom\")\n .nodeId(UUID.randomUUID())\n .build()",
"modifier": "private static final",
"original_string": "private static final ... | {
"body": "@Test\n public void liveReloadsPublicationConfig() {\n AtomicBoolean atomicBoolean = new AtomicBoolean(true);\n FeedbackHandler handler = new FeedbackHandler(sink, atomicBoolean::get);\n handler.handle(FEEDBACK);\n verify(sink, times(1)).registerFeedback(FEEDBACK);\n\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(FeedbackHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(FeedbackHandler.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "public void handle(ConjureTimeLockClientFeedback feedback) {\n if (useAdjudication.getAsBoolean()) {\n timeLockClientFeedbackSink.registerFeedback(feedback);\n }\n }",
"class_method_signature": "FeedbackHandler.handle(ConjureTimeLockClientFeedback feedback)",
"constructor": ... | {
"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_61 | {
"fields": [
{
"declarator": "FAILURE = new IllegalStateException()",
"modifier": "private static final",
"original_string": "private static final RuntimeException FAILURE = new IllegalStateException();",
"type": "RuntimeException",
"var_name": "FAILURE"
},
{
"declarat... | {
"body": "@Test public void\n shouldRethrowMultipleRunningTimestampServiceErrorsAsServiceNotAvailableExceptions() {\n RuntimeException response = allocationFailures.responseTo(MULTIPLE_RUNNING_SERVICES_FAILURE);\n\n assertThat(response instanceof ServiceNotAvailableException, is(true));\n ass... | {
"fields": [
{
"declarator": "MULTIPLE_RUNNING_TIMESTAMP_SERVICES_MESSAGE =\n \"This server is no longer usable as there appears to be another timestamp server running.\"",
"modifier": "private static final",
"original_string": "private static final String MULTIPLE_RUNNING_TIMESTAMP_... | {
"body": "public RuntimeException responseTo(Throwable newFailure) {\n synchronized (this) {\n logNewFailure(newFailure);\n previousAllocationFailure = newFailure;\n }\n\n if (newFailure instanceof MultipleRunningTimestampServiceError) {\n encounteredMultipleRunn... | {
"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_504 | {
"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 deletesGetBatched() {\n TargetedSweeper sweeperConservative = getSingleShardSweeper();\n\n int numberOfTimestamps = 5 * BATCH_SIZE_KVS / MAX_CELLS_GENERIC + 1;\n\n commitTransactionsWithWritesIntoUniqueCells(numberOfTimestamps, MAX_CELLS_GENERIC, sweeperConservat... | {
"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_857 | {
"fields": [
{
"declarator": "tempFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "tempFolder"
},
{
"declarator": "NAMES... | {
"body": "@Test\n public void defaultCutoffIsNoLogEntry() {\n assertThat(migrationState.getCutoff()).isEqualTo(PaxosAcceptor.NO_LOG_ENTRY);\n }",
"class_method_signature": "SqlitePaxosStateLogMigrationStateTest.defaultCutoffIsNoLogEntry()",
"constructor": false,
"full_signature": "@Test public voi... | {
"fields": [
{
"declarator": "namespace",
"modifier": "private final",
"original_string": "private final Client namespace;",
"type": "Client",
"var_name": "namespace"
},
{
"declarator": "useCase",
"modifier": "private final",
"original_string": "private fin... | {
"body": "public long getCutoff() {\n return execute(dao -> dao.getCutoff(namespace, useCase)).orElse(PaxosAcceptor.NO_LOG_ENTRY);\n }",
"class_method_signature": "SqlitePaxosStateLogMigrationState.getCutoff()",
"constructor": false,
"full_signature": "public long getCutoff()",
"identifier": "getCu... | {
"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_787 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/pool/WeightedHostsTest.java",
"identifier": "WeightedHostsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWeightedHostsWithNonZeroWeights() {\n Map<InetSocketAddress, CassandraClientPoolingContainer> pools = ImmutableMap.of(\n new InetSocketAddress(0), createMockClientPoolingContainerWithUtilization(5),\n new InetSocketAddress(1), createMockClient... | {
"fields": [
{
"declarator": "hosts",
"modifier": "final",
"original_string": "final NavigableMap<Integer, InetSocketAddress> hosts;",
"type": "NavigableMap<Integer, InetSocketAddress>",
"var_name": "hosts"
}
],
"file": "atlasdb-cassandra/src/main/java/com/palantir/atlasdb/k... | {
"body": "public static WeightedHosts create(Map<InetSocketAddress, CassandraClientPoolingContainer> pools) {\n Preconditions.checkArgument(!pools.isEmpty(), \"pools should be non-empty\");\n return new WeightedHosts(buildHostsWeightedByActiveConnections(pools));\n }",
"class_method_signature": "W... | {
"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_292 | {
"fields": [
{
"declarator": "NAMESPACE = Namespace.create(\"test\")",
"modifier": "private static final",
"original_string": "private static final Namespace NAMESPACE = Namespace.create(\"test\");",
"type": "Namespace",
"var_name": "NAMESPACE"
},
{
"declarator": "ROW_... | {
"body": "@Test\n public void dropTables() throws Exception {\n kvs.dropTables(ImmutableSet.of(TABLE_REF));\n\n checkSpan(\"atlasdb-kvs.dropTables([{table}])\");\n verify(delegate).dropTables(ImmutableSet.of(TABLE_REF));\n verifyNoMoreInteractions(delegate);\n }",
"class_method_si... | {
"fields": [
{
"declarator": "SERVICE_NAME = \"atlasdb-kvs\"",
"modifier": "private static final",
"original_string": "private static final String SERVICE_NAME = \"atlasdb-kvs\";",
"type": "String",
"var_name": "SERVICE_NAME"
},
{
"declarator": "delegate",
"modif... | {
"body": "@Override\n public void dropTables(Set<TableReference> tableRefs) {\n //noinspection unused - try-with-resources closes trace\n try (CloseableTrace trace = startLocalTrace(\"dropTables({})\",\n LoggingArgs.safeTablesOrPlaceholder(tableRefs))) {\n delegate().dropTa... | {
"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_768 | {
"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 canGetSelectQuery() {\n CqlQuery query = CassandraTimestampUtils.constructSelectFromTimestampTableQuery();\n assertThat(query.toString()).isEqualTo(\"SELECT column1, value FROM \\\"_timestamp\\\" WHERE key=0x7473;\");\n }",
"class_method_signature": "CassandraTimes... | {
"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 CqlQuery constructSelectFromTimestampTableQuery() {\n // Timestamps are safe.\n return ImmutableCqlQuery.builder()\n .safeQueryFormat(\"SELECT %s, %s FROM %s WHERE key=%s;\")\n .addArgs(\n SafeArg.of(\"columnName\", COLUMN_NAM... | {
"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_338 | {
"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 columnNamesMarkedAsSafeRowComponentNamesAreNotSafe() {\n SafeLoggableData safeLoggableData = ImmutableSafeLoggableData.builder()\n .putPermittedRowComponents(TABLE_REFERENCE_1, ImmutableSet.of(ROW_COMPONENT_1))\n .build();\n\n assertThat(sa... | {
"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 isColumnNameSafe(TableReference tableReference, String columnName) {\n return permittedColumnNames().containsKey(tableReference)\n && permittedColumnNames().get(tableReference).contains(columnName);\n }",
"class_method_signature": "SafeLoggableData.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_820 | {
"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 resolvesConfigWithOriginalKeyspaceIfNoNamespaceProvided() {\n CassandraKeyValueServiceConfig newConfig =\n CassandraAtlasDbFactory.preprocessKvsConfig(CONFIG_WITH_KEYSPACE, Optional::empty, Optional.empty());\n assertThat(newConfig.getKeyspaceOrThrow()).i... | {
"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_16 | {
"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 testIllegalDedicatedRowNumber() {\n ImmutableTargetedSweepMetadata.Builder builder = ImmutableTargetedSweepMetadata.builder().from(\n ALL_ZERO_METADATA);\n assertThatThrownBy(() -> builder.dedicatedRowNumber(-1).build()).isInstanceOf(IllegalArgumentExcept... | {
"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": "public abstract long dedicatedRowNumber();",
"class_method_signature": "TargetedSweepMetadata.dedicatedRowNumber()",
"constructor": false,
"full_signature": "public abstract long dedicatedRowNumber()",
"identifier": "dedicatedRowNumber",
"invocations": [],
"modifiers": "public abstract",
"par... | {
"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_573 | {
"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 getsVersionForTimestamp() {\n assertThat(DEFAULT_INITIAL_MAPPING.getValueForTimestamp(68)).isEqualTo(1);\n }",
"class_method_signature": "TimestampPartitioningMapTest.getsVersionForTimestamp()",
"constructor": false,
"full_signature": "@Test public void getsVersionFor... | {
"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 T getValueForTimestamp(long timestamp) {\n return rangeMapView().get(timestamp);\n }",
"class_method_signature": "TimestampPartitioningMap.getValueForTimestamp(long timestamp)",
"constructor": false,
"full_signature": "public T getValueForTimestamp(long timestamp)",
"identifier": "... | {
"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_123 | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ThreadConfinedProxyTest.class)",
"modifier": "",
"original_string": "Logger log = LoggerFactory.getLogger(ThreadConfinedProxyTest.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "testString = ... | {
"body": "@Test\n public void testExplicitThreadCanCreateAndUseSubject() throws InterruptedException {\n\n final AtomicReference<List<String>> inputReference = new AtomicReference<List<String>>(null);\n final AtomicBoolean outputReference = new AtomicBoolean(false);\n\n Thread childThread = n... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ThreadConfinedProxy.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ThreadConfinedProxy.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "public static <T> T newProxyInstance(Class<T> interfaceClass, T delegate, Strictness strictness) {\n return newProxyInstance(interfaceClass, delegate, strictness, Thread.currentThread());\n }",
"class_method_signature": "ThreadConfinedProxy.newProxyInstance(Class<T> interfaceClass, T delegate, ... | {
"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_436 | {
"fields": [
{
"declarator": "SMALL_SWEEP_TS = TS + 200L",
"modifier": "private static final",
"original_string": "private static final long SMALL_SWEEP_TS = TS + 200L;",
"type": "long",
"var_name": "SMALL_SWEEP_TS"
},
{
"declarator": "SWEEP_QUEUE_TABLE = TargetedSweep... | {
"body": "@Test\n public void cleanupNonDedicatedRow() {\n useSingleShard();\n writeCommittedConservativeRowForTimestamp(TS + 1, MAX_CELLS_GENERIC);\n writeCommittedConservativeRowForTimestamp(TS + 3, MAX_CELLS_GENERIC);\n writeCommittedConservativeRowForTimestamp(TS + 5, MAX_CELLS_GEN... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SweepableCells.class)",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(SweepableCells.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "comm... | {
"body": "void deleteNonDedicatedRows(ShardAndStrategy shardAndStrategy, Iterable<Long> partitionsFine) {\n List<byte[]> rows = Streams.stream(partitionsFine)\n .map(partitionFine -> computeRow(partitionFine, shardAndStrategy))\n .map(SweepableCellsRow::persistToBytes)\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_965 | {
"fields": [
{
"declarator": "kvsConfig = () -> AutoServiceAnnotatedAtlasDbFactory.TYPE",
"modifier": "private final",
"original_string": "private final KeyValueServiceConfigHelper kvsConfig = () -> AutoServiceAnnotatedAtlasDbFactory.TYPE;",
"type": "KeyValueServiceConfigHelper",
"v... | {
"body": "@Test\n public void alwaysSaveThreadDumpsToTheSameFile() throws IOException {\n ServiceDiscoveringAtlasSupplier supplier = createAtlasSupplier(kvsConfig);\n\n String firstPath = ServiceDiscoveringAtlasSupplier.saveThreadDumps();\n String secondPath = ServiceDiscoveringAtlasSupplier.... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ServiceDiscoveringAtlasSupplier.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ServiceDiscoveringAtlasSupplier.class);",
"type": "Logger",
"var_nam... | {
"body": "@VisibleForTesting\n static String saveThreadDumps() throws IOException {\n File file = getTempFile();\n return saveThreadDumpsToFile(file);\n }",
"class_method_signature": "ServiceDiscoveringAtlasSupplier.saveThreadDumps()",
"constructor": false,
"full_signature": "@VisibleForTes... | {
"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_748 | {
"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 oneDcMoreRacksThanRfAndMoreHostsThanRfSucceeds() throws TException {\n setTopology(defaultDcDetails(RACK_1, HOST_1),\n defaultDcDetails(RACK_2, HOST_2),\n defaultDcDetails(RACK_1, HOST_3),\n defaultDcDetails(RACK_3, 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_318 | {
"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 returnsUnsafeRangeEvenWhenContainsSafeColumns() {\n assertThat(LoggingArgs.range(SAFE_TABLE_REFERENCE, MIXED_RANGE_REQUEST))\n .isInstanceOf(UnsafeArg.class);\n }",
"class_method_signature": "LoggingArgsTest.returnsUnsafeRangeEvenWhenContainsSafeColumns()",... | {
"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_174 | {
"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 throwsIfCannotObtainQuorum() {\n failureToggles.get(1).set(true);\n failureToggles.get(2).set(true);\n failureToggles.get(3).set(true);\n assertThatThrownBy(() -> store.getUpperLimit()).isInstanceOf(ServiceNotAvailableException.class);\n }",
"class_me... | {
"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": "@Override\n public synchronized long getUpperLimit() {\n List<PaxosLong> responses = getLatestSequenceNumbersFromAcceptors();\n PaxosLong max = Ordering.natural().onResultOf(PaxosLong::getValue).max(responses);\n agreedState = getAgreedState(max.getValue());\n return agreedSt... | {
"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_41 | {
"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 testGetTableSizeOneTimeHasCacheMiss() throws Exception {\n assertThat(valueStyleCache.getTableType(\n connectionSupplier, TEST_TABLE, AtlasDbConstants.DEFAULT_METADATA_TABLE),\n is(TableValueStyle.OVERFLOW));\n verify(connectionSupplier, ti... | {
"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_524 | {
"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 sweepTableFromStartRowWithBatchConfigWithNullStartRowShouldBeSuccessful() {\n sweeperService.sweepTable(TABLE_REF.getQualifiedName(), Optional.empty(), Optional.empty(), Optional.of(1000),\n Optional.of(1000), Optional.of(500));\n }",
"class_method_signatur... | {
"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_877 | {
"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 shouldThrowIfCreatedWithLessThanOneReference() {\n assertThatThrownBy(() -> LockTokenShare.share(LOCK_TOKEN, 0))\n .hasMessage(\"Reference count should be more than zero\");\n }",
"class_method_signature": "LockTokenShareTest.shouldThrowIfCreatedWithLessTha... | {
"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_932 | {
"fields": [
{
"declarator": "SERVICE_NAME = \"service\"",
"modifier": "private static final",
"original_string": "private static final String SERVICE_NAME = \"service\";",
"type": "String",
"var_name": "SERVICE_NAME"
},
{
"declarator": "USER_AGENT = UserAgent.of(UserA... | {
"body": "@Test\n public void differentlyKeyedServicesTreatedDifferently() {\n String otherServiceName = \"tom\";\n ServicesConfigBlock servicesConfigBlock = DialogueClientOptions.toServicesConfigBlock(\n ImmutableMap.of(\n SERVICE_NAME, REMOTE_SERVICE_CONFIGURA... | {
"fields": [],
"file": "atlasdb-conjure/src/main/java/com/palantir/atlasdb/http/v2/DialogueClientOptions.java",
"identifier": "DialogueClientOptions",
"interfaces": "",
"methods": [
{
"class_method_signature": "DialogueClientOptions.DialogueClientOptions()",
"constructor": true,
"full_s... | {
"body": "public static ServicesConfigBlock toServicesConfigBlock(\n Map<String, RemoteServiceConfiguration> serviceNameToRemoteConfiguration) {\n Map<String, PartialServiceConfiguration> configMap = KeyedStream.stream(serviceNameToRemoteConfiguration)\n .map(remoteServiceConfigurati... | {
"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_898 | {
"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 getTimestampsDelegates() {\n int numTimestamps = 5;\n TimestampRange timestamps = TimestampRange.createInclusiveRange(1L, numTimestamps);\n when(timestampService.getFreshTimestamps(numTimestamps)).thenReturn(timestamps);\n\n assertThat(timelock.getFreshTim... | {
"fields": [
{
"declarator": "refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\")",
"modifier": "private static final",
"original_string": "private static final ScheduledExecutorService refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\");",
"type": "Scheduled... | {
"body": "@Override\n public TimestampRange getFreshTimestamps(int numTimestampsRequested) {\n return timestampService.getFreshTimestamps(numTimestampsRequested);\n }",
"class_method_signature": "TimeLockClient.getFreshTimestamps(int numTimestampsRequested)",
"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_461 | {
"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 attemptedReductionDoesNotPreventIncrease() throws Exception {\n when(sweepIteration.call()).thenReturn(\n SUCCESS_SMALL, SUCCESS_SMALL,\n SUCCESS_LARGE);\n\n scheduler.start(2);\n tickClockForHalfCoolDown();\n runSweepIteratio... | {
"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_9 | {
"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 metricsWithMultipleFiltersAreAcceptedOnlyIfAllFiltersPermit() {\n MetricPublicationArbiter arbiter = createArbiter(ImmutableMap.of(\n METRIC_NAME_1, ImmutableSet.of(TRUE_RETURNING_FILTER, FALSE_RETURNING_FILTER, TRUE_RETURNING_FILTER),\n METRIC_NA... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(MetricPublicationArbiter.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(MetricPublicationArbiter.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public boolean test(MetricName metricName) {\n return Optional.ofNullable(singleMetricFilters.get(metricName))\n .map(filters -> allFiltersMatch(metricName, filters))\n .orElse(true);\n }",
"class_method_signature": "MetricPublicationArbiter.test(Met... | {
"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_861 | {
"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 failsFutureIfSupplierThrows() {\n RuntimeException exception = new RuntimeException();\n replaceableFunction = () -> {\n throw exception;\n };\n ListenableFuture<Integer> hopefullyFailedFuture = retrier.execute(function);\n scheduler.runU... | {
"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_532 | {
"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(timeout = 10_000)\n @SuppressWarnings(\"FutureReturnValueIgnored\") // for acquirePersistentLockWithRetry\n public void doesNotDeadlockOnShutdownIfLockCannotBeAcquired() throws InterruptedException {\n CountDownLatch acquireStarted = new CountDownLatch(1);\n when(mockPls.acquireBa... | {
"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 shutdown() {\n log.info(\"Shutting down...\");\n\n try {\n isShutDown = true;\n while (lockId != null) {\n releasePersistentLock();\n }\n log.info(\"Shutdown completed!\");\n } catch (Exception e) {\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_57 | {
"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 shouldStartWithTheCurrentStoredLimit() {\n when(boundStore.getUpperLimit()).thenReturn(TIMESTAMP);\n\n PersistentUpperLimit brandNewUpperLimit = new PersistentUpperLimit(boundStore);\n\n assertThat(brandNewUpperLimit.get(), is(TIMESTAMP));\n }",
"class_metho... | {
"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 long get() {\n return currentLimit;\n }",
"class_method_signature": "PersistentUpperLimit.get()",
"constructor": false,
"full_signature": "public long get()",
"identifier": "get",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "long",
"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_498 | {
"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 testSweepTimestampMetric() {\n unreadableTs = 17;\n immutableTs = 40;\n sweepNextBatch(ShardAndStrategy.conservative(0));\n sweepNextBatch(ShardAndStrategy.thorough(0));\n\n assertThat(metricsManager).hasSweepTimestampConservativeEqualTo(17L);\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_162 | {
"fields": [
{
"declarator": "KEY = \"foo\"",
"modifier": "private static final",
"original_string": "private static final String KEY = \"foo\";",
"type": "String",
"var_name": "KEY"
},
{
"declarator": "scheduler = new DeterministicScheduler()",
"modifier": "priv... | {
"body": "@Test\n public void cachesResults() {\n List<Integer> firstResponse = allocator.getRelevantModuli(KEY);\n List<Integer> secondResponse = allocator.getRelevantModuli(KEY);\n List<Integer> thirdResponse = allocator.getRelevantModuli(KEY);\n\n verify(generator, times(1)).getAndM... | {
"fields": [
{
"declarator": "loadingCache",
"modifier": "private final",
"original_string": "private final LoadingCache<T, Integer> loadingCache;",
"type": "LoadingCache<T, Integer>",
"var_name": "loadingCache"
}
],
"file": "timelock-impl/src/main/java/com/palantir/atlasdb/... | {
"body": "@Override\n public List<Integer> getRelevantModuli(T object) {\n return ImmutableList.of(loadingCache.get(object));\n }",
"class_method_signature": "CachingPartitionAllocator.getRelevantModuli(T object)",
"constructor": false,
"full_signature": "@Override public List<Integer> getRelevant... | {
"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_477 | {
"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 conservativeSweepDeletesLowerValue() {\n enqueueWriteCommitted(TABLE_CONS, LOW_TS);\n enqueueWriteCommitted(TABLE_CONS, LOW_TS2);\n assertTestValueEnqueuedAtGivenTimestampStillPresent(TABLE_CONS, LOW_TS);\n assertTestValueEnqueuedAtGivenTimestampStillPrese... | {
"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_924 | {
"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 canInvokeVoidReturningMethodsSafely() {\n LongConsumer longConsumer = mock(LongConsumer.class);\n RetryableException retryableException = createRetryableException(QosException.retryOther(createUrl()));\n doThrow(retryableException).doNothing().when(longConsumer).... | {
"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": "public static <U> U newProxyInstance(Class<U> interfaceClass, Supplier<U> delegate) {\n return newProxyInstance(interfaceClass, delegate, Clock.systemUTC());\n }",
"class_method_signature": "FastFailoverProxy.newProxyInstance(Class<U> interfaceClass, Supplier<U> delegate)",
"constructor": fal... | {
"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_709 | {
"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 exceptionsArePropagated() {\n RuntimeException expected = new RuntimeException(\"foo\");\n when(delegate.get()).thenThrow(expected);\n\n assertThatThrownBy(() -> supplier.get()).hasMessage(expected.getMessage());\n }",
"class_method_signature": "CoalescingSu... | {
"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": "@Override\n public T get() {\n Round present = round;\n if (present.isFirstToArrive()) {\n present.execute();\n return present.getResult();\n }\n Round next = present.awaitDone();\n if (next.isFirstToArrive()) {\n next.execute();\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_359 | {
"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 doesNotInvokeBackoffIfCalledWithZeroTime() {\n StreamStoreBackoffStrategy backoffStrategy = createStaticBackoffStrategy(1, 0);\n backoffStrategy.accept(1);\n verifyNoMoreInteractions(backoffMechanism);\n }",
"class_method_signature": "StandardPeriodicBackoff... | {
"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_135 | {
"fields": [
{
"declarator": "FUTURE_TIMESTAMP = 3141592653589L",
"modifier": "private static final",
"original_string": "private static final long FUTURE_TIMESTAMP = 3141592653589L;",
"type": "long",
"var_name": "FUTURE_TIMESTAMP"
},
{
"declarator": "TEST_TABLE = Tabl... | {
"body": "@Test\n public void tablesDelegatedToSourceKvsGetDroppedFromSourceKvsIfMigratable() {\n fromKvs.createTable(FAKE_ATOMIC_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA);\n fromKvs.putUnlessExists(FAKE_ATOMIC_TABLE, ImmutableMap.of(TEST_CELL, TEST_VALUE1));\n\n KeyValueService toTable... | {
"fields": [
{
"declarator": "printer\n = new OutputPrinter(LoggerFactory.getLogger(KeyValueServiceMigrator.class))",
"modifier": "private static final",
"original_string": "private static final OutputPrinter printer\n = new OutputPrinter(LoggerFactory.getLogger(KeyValueSe... | {
"body": "public static KeyValueServiceMigrator setupMigrator(MigratorSpec migratorSpec) {\n AtlasDbServices fromServices = migratorSpec.fromServices();\n AtlasDbServices toServices = migratorSpec.toServices();\n TimestampManagementService toTimestampManagementService = toServices.getManagedTime... | {
"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_565 | {
"fields": [
{
"declarator": "TIMESTAMP_1 = 1111L",
"modifier": "private static final",
"original_string": "private static final long TIMESTAMP_1 = 1111L;",
"type": "long",
"var_name": "TIMESTAMP_1"
},
{
"declarator": "TIMESTAMP_2 = 2222L",
"modifier": "private s... | {
"body": "@Test\n public void handlesMultitenancyCorrectly() {\n CoordinationService<InternalSchemaMetadata> otherService = mock(CoordinationService.class);\n MetricsManager otherManager = MetricsManagers.createForTests();\n TimestampService otherTimestampService = mock(TimestampService.class... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(MetadataCoordinationServiceMetrics.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(MetadataCoordinationServiceMetrics.class);",
"type": "Logger",
"v... | {
"body": "public static void registerMetrics(\n MetricsManager metricsManager,\n CoordinationService<InternalSchemaMetadata> metadataCoordinationService,\n TimestampService timestamp) {\n registerValidityBoundMetric(metricsManager, metadataCoordinationService);\n regist... | {
"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_836 | {
"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 canAddKeyspace() {\n CassandraKeyValueServiceConfig newConfig = CassandraKeyValueServiceConfigs.copyWithKeyspace(\n CONFIG_WITHOUT_KEYSPACE, KEYSPACE);\n assertThat(newConfig.getKeyspaceOrThrow()).isEqualTo(KEYSPACE);\n }",
"class_method_signature": ... | {
"fields": [],
"file": "atlasdb-cassandra/src/main/java/com/palantir/atlasdb/cassandra/CassandraKeyValueServiceConfigs.java",
"identifier": "CassandraKeyValueServiceConfigs",
"interfaces": "",
"methods": [
{
"class_method_signature": "CassandraKeyValueServiceConfigs.CassandraKeyValueServiceConfigs(... | {
"body": "public static CassandraKeyValueServiceConfig copyWithKeyspace(\n CassandraKeyValueServiceConfig cassandraConfig,\n String recommendedKeyspace) {\n return ImmutableCassandraKeyValueServiceConfig.builder()\n .from(cassandraConfig)\n .keyspace(recomme... | {
"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.