id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
36960637_134 | {
"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 cleanupDropsCheckpointTable() {\n fromKvs.createTables(TEST_AND_CHECKPOINT_TABLES);\n fromTxManager.runTaskWithRetry(tx -> {\n tx.put(TEST_TABLE, ImmutableMap.of(TEST_CELL, TEST_VALUE1));\n return tx.getTimestamp();\n });\n\n KeyValue... | {
"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_564 | {
"fields": [
{
"declarator": "TABLE_STRING = \"ns.table\"",
"modifier": "private static final",
"original_string": "private static final String TABLE_STRING = \"ns.table\";",
"type": "String",
"var_name": "TABLE_STRING"
},
{
"declarator": "TABLE = TableReference.create... | {
"body": "@Test\n public void sleepsForLongerDurationIfCompactFails() {\n assertThat(BackgroundCompactor.getSleepTime(\n () -> COMPACTOR_CONFIG,\n BackgroundCompactor.CompactionOutcome.FAILED_TO_COMPACT))\n .isEqualTo(COMPACT_PAUSE_ON_FAILURE_MILLIS);\n a... | {
"fields": [
{
"declarator": "SLEEP_TIME_WHEN_NOTHING_TO_COMPACT_MIN_MILLIS = TimeUnit.SECONDS.toMillis(5)",
"modifier": "public static final",
"original_string": "public static final long SLEEP_TIME_WHEN_NOTHING_TO_COMPACT_MIN_MILLIS = TimeUnit.SECONDS.toMillis(5);",
"type": "long",
... | {
"body": "@VisibleForTesting\n static long getSleepTime(\n Supplier<CompactorConfig> compactorConfigSupplier,\n CompactionOutcome outcome) {\n switch (outcome) {\n case SUCCESS:\n case COMPACTED_BUT_NOT_REGISTERED:\n case SHUTDOWN:\n ret... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_837 | {
"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 otherPropertiesConservedWhenAddingKeyspace() {\n CassandraKeyValueServiceConfig newConfig = CassandraKeyValueServiceConfigs.copyWithKeyspace(\n CONFIG_WITHOUT_KEYSPACE, KEYSPACE);\n assertThat(newConfig.replicationFactor()).isEqualTo(1);\n assertTh... | {
"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... |
36960637_972 | {
"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 currentTimeMillisHasShortTimeout() {\n sensitiveClient.currentTimeMillis(NAMESPACE);\n\n verify(shortTimeout).currentTimeMillis(NAMESPACE);\n verify(longTimeout, never()).currentTimeMillis(NAMESPACE);\n\n }",
"class_method_signature": "TimeoutSensitiveLockRp... | {
"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 long currentTimeMillis(String namespace) {\n return shortTimeoutProxy.currentTimeMillis(namespace);\n }",
"class_method_signature": "TimeoutSensitiveLockRpcClient.currentTimeMillis(String namespace)",
"constructor": false,
"full_signature": "@Override public long curre... | {
"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_421 | {
"fields": [
{
"declarator": "EXAMINED = 15L",
"modifier": "private static final",
"original_string": "private static final long EXAMINED = 15L;",
"type": "long",
"var_name": "EXAMINED"
},
{
"declarator": "DELETED = 10L",
"modifier": "private static final",
... | {
"body": "@Test\n public void testSweepError() {\n sweepMetrics.sweepError();\n sweepMetrics.sweepError();\n\n assertThat(getCounter(AtlasDbMetricNames.SWEEP_ERROR).getCount()).isEqualTo(2L);\n }",
"class_method_signature": "LegacySweepMetricsTest.testSweepError()",
"constructor": fals... | {
"fields": [
{
"declarator": "METRIC_BASE_NAME = LegacySweepMetrics.class.getName()",
"modifier": "static final",
"original_string": "static final String METRIC_BASE_NAME = LegacySweepMetrics.class.getName();",
"type": "String",
"var_name": "METRIC_BASE_NAME"
},
{
"dec... | {
"body": "public void sweepError() {\n metrics.get().sweepErrors().inc();\n }",
"class_method_signature": "LegacySweepMetrics.sweepError()",
"constructor": false,
"full_signature": "public void sweepError()",
"identifier": "sweepError",
"invocations": [
"inc",
"sweepErrors",
"get"
]... | {
"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_708 | {
"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 requestsDoNotRecieveOldResults() {\n assertThat(supplier.get()).isEqualTo(DEFAULT_VALUE);\n\n int value2 = 2;\n when(delegate.get()).thenReturn(value2);\n assertThat(supplier.get()).isEqualTo(value2);\n }",
"class_method_signature": "CoalescingSupplie... | {
"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_358 | {
"fields": [
{
"declarator": "DATA_SIZE = 4",
"modifier": "private static final",
"original_string": "private static final int DATA_SIZE = 4;",
"type": "int",
"var_name": "DATA_SIZE"
},
{
"declarator": "DATA_SIZE_PLUS_ONE = 5",
"modifier": "private static final",... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void bufferLengthShouldNotExceedMaxArrayLength() throws IOException {\n BlockGetter tooBigGetter = new BlockGetter() {\n @Override\n public void get(long firstBlock, long numBlocks, OutputStream destination) {\n ... | {
"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": "public static BlockConsumingInputStream create(\n BlockGetter blockGetter,\n long numBlocks,\n int blocksInMemory) throws IOException {\n ensureExpectedArraySizeDoesNotOverflow(blockGetter, blocksInMemory);\n return new BlockConsumingInputStream(blockGetter, 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_860 | {
"fields": [
{
"declarator": "tempFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "tempFolder"
},
{
"declarator": "legac... | {
"body": "@Test\n public void currentLogCanBeEmptyIffCutoffIsNoLogEntryValue() {\n assertThatCode(() -> SplittingPaxosStateLog.create(parametersWithCutoff(PaxosAcceptor.NO_LOG_ENTRY)))\n .doesNotThrowAnyException();\n assertThatThrownBy(() -> SplittingPaxosStateLog.create(parametersWi... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SplittingPaxosStateLog.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SplittingPaxosStateLog.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "public static <V extends Persistable & Versionable> PaxosStateLog<V> create(SplittingParameters<V> parameters) {\n Preconditions.checkState(parameters.cutoffInclusive() == PaxosAcceptor.NO_LOG_ENTRY\n || parameters.currentLog().getGreatestLogEntry() >= parameters.cutoffInclusi... | {
"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_56 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldNotTryToPersistANewLimitIfInterrupted() {\n try {\n Thread.currentThread().interrupt();\n store.storeUpperLimit(1_000);\n } catch (Exception e) {\n // Ingnore expected exception\n } finally {\n // Clear the interr... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final TimestampBoundStore delegate;",
"type": "TimestampBoundStore",
"var_name": "delegate"
},
{
"declarator": "failures",
"modifier": "private final",
"origin... | {
"body": "@Override\n public synchronized void storeUpperLimit(long limit) {\n failures.verifyWeShouldIssueMoreTimestamps();\n throwIfInterrupted();\n\n try {\n delegate.storeUpperLimit(limit);\n } catch (Throwable t) {\n throw failures.responseTo(t);\n }\n... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_533 | {
"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 noOpPersistentLockCanLockTwice() {\n PersistentLockManager noOpManager = new PersistentLockManager(\n metricsManager, new NoOpPersistentLockService(), 0L);\n assertTrue(\"NoOpPersistentLockService should return true when acquiring lock\",\n ... | {
"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": "@VisibleForTesting\n synchronized boolean tryAcquirePersistentLock() {\n Preconditions.checkState(!isShutDown,\n \"This PersistentLockManager is shut down, and cannot be used to acquire locks.\");\n\n try {\n lockId = persistentLockService.acquireBackupLock(\"Swee... | {
"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_499 | {
"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 doNotSweepAnythingAfterEntryWithCommitTsAfterSweepTs() {\n immutableTs = 1000L;\n // put 4 writes committed at the same timestamp as start timestamp, and put one committed at sweep timestamp\n enqueueWriteCommitted(TABLE_CONS, 900);\n enqueueWriteCommitted... | {
"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_163 | {
"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 unmarksResidueIfClientGoesAway() {\n List<Integer> firstResponse = allocator.getRelevantModuli(KEY);\n\n time.addAndGet(5_000_000L);\n\n allocator.getRelevantModuli(KEY);\n scheduler.runUntilIdle();\n verify(generator, times(2)).getAndMarkResidue();... | {
"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_476 | {
"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 thoroughSweepDeletesExistingSentinel() {\n spiedKvs.addGarbageCollectionSentinelValues(TABLE_THOR, ImmutableList.of(DEFAULT_CELL));\n assertReadAtTimestampReturnsSentinel(TABLE_THOR, 0L);\n enqueueWriteCommitted(TABLE_THOR, 10L);\n sweepNextBatch(ShardAndS... | {
"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_925 | {
"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 simpleRetryableExceptionIsNotCausedByRetryOther() {\n RetryableException retryableException = new RetryableException(\"foo\", Date.from(Instant.EPOCH));\n assertThat(FastFailoverProxy.isCausedByRetryOther(retryableException)).isFalse();\n }",
"class_method_signatur... | {
"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_8 | {
"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 metricsWithOneFilterAreFiltered() {\n MetricPublicationArbiter arbiter = createArbiter(ImmutableMap.of(\n METRIC_NAME_1, ImmutableSet.of(FALSE_RETURNING_FILTER),\n METRIC_NAME_2, ImmutableSet.of(TRUE_RETURNING_FILTER)));\n assertThat(arbite... | {
"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_175 | {
"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 throwsIfBoundUnexpectedlyChangedUnderUs() {\n PaxosTimestampBoundStore additionalStore = createPaxosTimestampBoundStore(1);\n additionalStore.storeUpperLimit(TIMESTAMP_1);\n assertThatThrownBy(() -> store.storeUpperLimit(TIMESTAMP_2))\n .isInstance... | {
"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 void storeUpperLimit(long limit) throws MultipleRunningTimestampServiceError {\n long newSeq = PaxosAcceptor.NO_LOG_ENTRY + 1;\n if (agreedState != null) {\n Preconditions.checkArgument(limit >= agreedState.getBound(),\n \"Tried... | {
"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_525 | {
"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 sweepTableFromStartRowWithBatchConfigWithExactlyOneNonNullBatchConfigShouldBeSuccessful() {\n sweeperService.sweepTable(TABLE_REF.getQualifiedName(),\n Optional.of(encodeStartRow(new byte[] {1, 2, 3})), Optional.empty(), Optional.of(10), Optional.empty(),\n ... | {
"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_40 | {
"fields": [
{
"declarator": "ROW_NAME = {1, 2, 3 }",
"modifier": "private static final",
"original_string": "private static final byte[] ROW_NAME = {1, 2, 3 };",
"type": "byte[]",
"var_name": "ROW_NAME"
},
{
"declarator": "COL_NAME = { 4, 5, 6 }",
"modifier": "p... | {
"body": "@Test\n public void columnSelection() {\n byte[] colTwo = new byte[] { 7, 8, 9 };\n\n FullQuery.Builder builder = FullQuery.builder();\n RangePredicateHelper.create(false, DBType.ORACLE, builder).columnSelection(ImmutableList.of(COL_NAME, colTwo));\n FullQuery query = builder... | {
"fields": [
{
"declarator": "reverse",
"modifier": "private final",
"original_string": "private final boolean reverse;",
"type": "boolean",
"var_name": "reverse"
},
{
"declarator": "tupleComparisonStrategy",
"modifier": "private final",
"original_string": ... | {
"body": "public RangePredicateHelper columnSelection(Collection<byte[]> columns) {\n if (!columns.isEmpty()) {\n Iterable colnameConditions = Iterables.limit(Iterables.cycle(\"col_name = ?\"), columns.size());\n queryBuilder.append(\" AND (\" + Joiner.on(\" OR \").join(colnameConditions... | {
"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_876 | {
"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 shouldReturnUnderlyingTokenAfterAllReferencesAreUnlocked() {\n List<LockTokenShare> tokens = getSharedLockTokens(LOCK_TOKEN, 2);\n LockTokenShare firstToken = tokens.get(0);\n LockTokenShare secondToken = tokens.get(1);\n\n assertThat(firstToken.unlock())\... | {
"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": "synchronized Optional<LockToken> unlock() {\n if (!unlocked) {\n unlocked = true;\n return referenceCounter.unmark() ? Optional.of(sharedLockToken) : Optional.empty();\n }\n\n return Optional.empty();\n }",
"class_method_signature": "LockTokenShare.unlock()",... | {
"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_933 | {
"fields": [
{
"declarator": "USER_AGENT_1 = createBaseUserAgent(\"Bond\", \"0.0.7\")",
"modifier": "private static final",
"original_string": "private static final UserAgent USER_AGENT_1 = createBaseUserAgent(\"Bond\", \"0.0.7\");",
"type": "UserAgent",
"var_name": "USER_AGENT_1"
... | {
"body": "@Test\n public void detectsAtlasDbHttpClientAgent() {\n assertThat(ProtocolAwareExceptionMapper.parseProtocolVersionFromUserAgentHeader(\n ImmutableList.of(FORMATTED_USER_AGENT_WITH_HTTP_CLIENT)))\n .contains(HTTP_PROTOCOL_VERSION);\n }",
"class_method_signature... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ProtocolAwareExceptionMapper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ProtocolAwareExceptionMapper.class);",
"type": "Logger",
"var_name": "l... | {
"body": "@VisibleForTesting\n static Optional<String> parseProtocolVersionFromUserAgentHeader(@Nonnull List<String> userAgentHeader) {\n return userAgentHeader\n .stream()\n .map(UserAgents::tryParse)\n .map(UserAgent::informational)\n .flatMap(L... | {
"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_899 | {
"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 currentTimeMillisDelegates() {\n long time = 456L;\n when(delegate.currentTimeMillis()).thenReturn(time);\n\n assertThat(timelock.currentTimeMillis()).isEqualTo(time);\n }",
"class_method_signature": "TimeLockClientTest.currentTimeMillisDelegates()",
"cons... | {
"fields": [
{
"declarator": "refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\")",
"modifier": "private static final",
"original_string": "private static final ScheduledExecutorService refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\");",
"type": "Scheduled... | {
"body": "@Override\n public long currentTimeMillis() {\n return executeOnTimeLock(delegate::currentTimeMillis);\n }",
"class_method_signature": "TimeLockClient.currentTimeMillis()",
"constructor": false,
"full_signature": "@Override public long currentTimeMillis()",
"identifier": "currentTimeMi... | {
"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_460 | {
"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 reductionCanPreventIncrease() throws Exception {\n when(sweepIteration.call()).thenReturn(\n SUCCESS_SMALL, SUCCESS_SMALL,\n SUCCESS_LARGE);\n\n scheduler.start(2);\n tickClock();\n runSweepIterations(1 + 4);\n\n tickCl... | {
"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_749 | {
"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 oneDcFewerRacksThanRfAndFewerHostsThanRfSucceeds() throws TException {\n setTopology(defaultDcDetails(RACK_1, HOST_1),\n defaultDcDetails(RACK_2, HOST_2),\n defaultDcDetails(RACK_1, HOST_2),\n defaultDcDetails(RACK_2, HOST_1));\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_319 | {
"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 returnsUnsafeColumnRangeEvenWhenContainsSafeColumns() {\n assertThat(LoggingArgs.columnRangeSelection(SAFE_COLUMN_RANGE)).isInstanceOf(UnsafeArg.class);\n }",
"class_method_signature": "LoggingArgsTest.returnsUnsafeColumnRangeEvenWhenContainsSafeColumns()",
"constructor... | {
"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<ColumnRangeSelection> columnRangeSelection(ColumnRangeSelection columnRangeSelection) {\n return getArg(\"columnRangeSelection\", columnRangeSelection, false);\n }",
"class_method_signature": "LoggingArgs.columnRangeSelection(ColumnRangeSelection columnRangeSelection)",
"con... | {
"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_821 | {
"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 resolvesConfigWithNamespaceIfNoKeyspaceProvided() {\n CassandraKeyValueServiceConfig newConfig =\n CassandraAtlasDbFactory.preprocessKvsConfig(CONFIG_WITHOUT_KEYSPACE, Optional::empty,\n Optional.of(KEYSPACE));\n assertThat(newConfi... | {
"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_572 | {
"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 throwsIfInitialMapExceedsTimestampRange() {\n assertThatThrownBy(() -> TimestampPartitioningMap.of(ImmutableRangeMap.of(Range.atLeast(-42L), 1)))\n .isInstanceOf(IllegalArgumentException.class)\n .hasMessageContaining(\"its span does not cover pre... | {
"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_17 | {
"fields": [
{
"declarator": "RESULTS = SweepResults.builder()\n .nextStartRow(Optional.of(PtBytes.toBytes(\"ABC\")))\n .cellTsPairsExamined(1000L)\n .staleValuesDeleted(100L)\n .minSweptTimestamp(10L)\n .timeInMillis(1L)\n .timeSweepStarted... | {
"body": "@Test\n public void accumulateWithNextRowInOrder() {\n Assert.assertThat(RESULTS.accumulateWith(OTHER_RESULTS), Matchers.equalTo(COMBINED_RESULTS_AND_OTHER));\n }",
"class_method_signature": "SweepResultsTest.accumulateWithNextRowInOrder()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [],
"file": "atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/SweepResults.java",
"identifier": "SweepResults",
"interfaces": "",
"methods": [
{
"class_method_signature": "SweepResults.getPreviousStartRowNullable()",
"constructor": false,
"full_signature": "@Nullab... | {
"body": "public SweepResults accumulateWith(SweepResults other) {\n return SweepResults.builder()\n .nextStartRow(maxRowOptional(getNextStartRow(), other.getNextStartRow()))\n .cellTsPairsExamined(getCellTsPairsExamined() + other.getCellTsPairsExamined())\n .stale... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_122 | {
"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 testCurrentThreadCanCreateAndUseSubject() {\n @SuppressWarnings(\"unchecked\")\n List<String> subject = ThreadConfinedProxy.newProxyInstance(List.class, new ArrayList<String>(),\n ThreadConfinedProxy.Strictness.VALIDATE);\n subject.add(testString);... | {
"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_437 | {
"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 cleanupMultipleDedicatedRows() {\n useSingleShard();\n\n long timestamp = TS + 1;\n DedicatedRows dedicatedRows = DedicatedRows.of(LongStream.range(0, 3)\n .mapToObj(rowNumber -> ImmutableTargetedSweepMetadata.builder()\n .co... | {
"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 deleteDedicatedRows(DedicatedRows dedicatedRows) {\n List<byte[]> rows = dedicatedRows.getDedicatedRows()\n .stream()\n .map(SweepableCellsRow::persistToBytes)\n .collect(Collectors.toList());\n deleteRows(rows);\n }",
"class_method_signa... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_964 | {
"fields": [
{
"declarator": "kvsConfig = () -> AutoServiceAnnotatedAtlasDbFactory.TYPE",
"modifier": "private final",
"original_string": "private final KeyValueServiceConfigHelper kvsConfig = () -> AutoServiceAnnotatedAtlasDbFactory.TYPE;",
"type": "KeyValueServiceConfigHelper",
"v... | {
"body": "@Test\n public void returnDifferentTimestampServicesOnSubsequentCalls() {\n ServiceDiscoveringAtlasSupplier supplier = createAtlasSupplier(kvsConfig);\n AutoServiceAnnotatedAtlasDbFactory.nextTimestampServiceToReturn(\n mock(ManagedTimestampService.class),\n m... | {
"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": "public synchronized ManagedTimestampService getManagedTimestampService() {\n log.info(\"[timestamp-service-creation] Fetching timestamp service from \"\n + \"thread {}. This should only happen once.\", Thread.currentThread().getName());\n\n if (timestampServiceCreationI... | {
"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_786 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/pool/WeightedHostsTest.java",
"identifier": "WeightedHostsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWeightedHostsWithMaxActivityPool() {\n InetSocketAddress highActivityHost = new InetSocketAddress(2);\n Map<InetSocketAddress, CassandraClientPoolingContainer> pools = ImmutableMap.of(\n new InetSocketAddress(0), createMockClientPoolingContainerWithUt... | {
"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_293 | {
"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 get() throws Exception {\n Map<Cell, Value> expectedResult = ImmutableMap.of(CELL, VALUE);\n Map<Cell, Long> cells = ImmutableMap.of(CELL, 1L);\n when(delegate.get(TABLE_REF, cells)).thenReturn(expectedResult);\n\n Map<Cell, Value> result = kvs.get(TABLE_R... | {
"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 Map<Cell, Value> get(TableReference tableRef, Map<Cell, Long> timestampByCell) {\n //noinspection unused - try-with-resources closes trace\n try (CloseableTrace trace = startLocalTrace(\"get({}, {} cells)\",\n LoggingArgs.safeTableOrPlaceholder(tableRef), ... | {
"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_769 | {
"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 longConvertedToBytesIsValidTimestampData() {\n assertThat(CassandraTimestampUtils.isValidTimestampData(PtBytes.toBytes(1234567L))).isTrue();\n assertThat(CassandraTimestampUtils.isValidTimestampData(new byte[Long.BYTES])).isTrue();\n }",
"class_method_signature": "... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraTimestampUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraTimestampUtils.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static boolean isValidTimestampData(byte[] data) {\n return data != null && data.length == Long.BYTES;\n }",
"class_method_signature": "CassandraTimestampUtils.isValidTimestampData(byte[] data)",
"constructor": false,
"full_signature": "public static boolean isValidTimestampData(byte... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_339 | {
"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 rowComponentsDoNotInheritSafetyFromTableReferences() {\n SafeLoggableData safeLoggableData = ImmutableSafeLoggableData.builder()\n .addPermittedTableReferences(TABLE_REFERENCE_1)\n .build();\n\n assertThat(safeLoggableData.isRowComponentNam... | {
"fields": [],
"file": "atlasdb-client/src/main/java/com/palantir/atlasdb/logging/SafeLoggableData.java",
"identifier": "SafeLoggableData",
"interfaces": "implements KeyValueServiceLogArbitrator",
"methods": [
{
"class_method_signature": "SafeLoggableData.permittedTableReferences()",
"constru... | {
"body": "@Override\n public boolean isRowComponentNameSafe(TableReference tableReference, String rowComponentName) {\n return permittedRowComponents().containsKey(tableReference)\n && permittedRowComponents().get(tableReference).contains(rowComponentName);\n }",
"class_method_signature... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_913 | {
"fields": [
{
"declarator": "SHORT_DURATION = ProfilingTimelockService.SLOW_THRESHOLD.dividedBy(5)",
"modifier": "private static final",
"original_string": "private static final Duration SHORT_DURATION = ProfilingTimelockService.SLOW_THRESHOLD.dividedBy(5);",
"type": "Duration",
"v... | {
"body": "@Test\n public void delegatesInitializationCheck() {\n when(delegate.isInitialized())\n .thenReturn(false)\n .thenReturn(true);\n\n assertThat(profilingTimelockService.isInitialized()).isFalse();\n assertThat(profilingTimelockService.isInitialized()).is... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ProfilingTimelockService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ProfilingTimelockService.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public boolean isInitialized() {\n return delegate.isInitialized();\n }",
"class_method_signature": "ProfilingTimelockService.isInitialized()",
"constructor": false,
"full_signature": "@Override public boolean isInitialized()",
"identifier": "isInitialized",
"invocations"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_440 | {
"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 getStrategyReturnsCorrectStrategy() {\n assertThat(partitioner.getStrategy(getWriteInfoWithFixedCellHash(NOTHING, 0))).isEmpty();\n assertThat(partitioner.getStrategy(getWriteInfoWithFixedCellHash(CONSERVATIVE, 10)))\n .contains(SweeperStrategy.CONSERVATI... | {
"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_155 | {
"fields": [],
"file": "timelock-impl/src/test/java/com/palantir/atlasdb/timelock/AsyncTimelockServiceImplTest.java",
"identifier": "AsyncTimelockServiceImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void delegatesInitializationCheck() {\n ManagedTimestampService mockMts = mock(ManagedTimestampService.class);\n AsyncTimelockServiceImpl service = new AsyncTimelockServiceImpl(\n mock(AsyncLockService.class),\n mockMts,\n mock(Lo... | {
"fields": [
{
"declarator": "lockService",
"modifier": "private final",
"original_string": "private final AsyncLockService lockService;",
"type": "AsyncLockService",
"var_name": "lockService"
},
{
"declarator": "timestampService",
"modifier": "private final",
... | {
"body": "@Override\n public boolean isInitialized() {\n return timestampService.isInitialized();\n }",
"class_method_signature": "AsyncTimelockServiceImpl.isInitialized()",
"constructor": false,
"full_signature": "@Override public boolean isInitialized()",
"identifier": "isInitialized",
"invo... | {
"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_505 | {
"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 doesNotLeaveSentinelsIfTableDestroyed() {\n enqueueWriteCommitted(TABLE_CONS, 10);\n immutableTs = 11;\n unreadableTs = 11;\n spiedKvs.truncateTable(TABLE_CONS);\n assertThat(spiedKvs.getRange(TABLE_CONS, RangeRequest.all(), Long.MAX_VALUE)).isExhau... | {
"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_60 | {
"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 shouldRethrowExceptions() {\n RuntimeException response = allocationFailures.responseTo(FAILURE);\n\n assertThat(response.getCause(), is(FAILURE));\n assertThat(response, isA(RuntimeException.class));\n assertThat(response.getMessage(), containsString(\"Co... | {
"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_856 | {
"fields": [
{
"declarator": "START_SEQUENCE = 123",
"modifier": "private static final",
"original_string": "private static final int START_SEQUENCE = 123;",
"type": "int",
"var_name": "START_SEQUENCE"
},
{
"declarator": "BATCH_SIZE = 250",
"modifier": "private s... | {
"body": "@Test\n public void executionsGetBatched() throws IOException {\n when(mockLog.readRound(anyLong())).thenAnswer(invocation -> {\n Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);\n return valueForRound((long) invocation.getArguments()[0]).persistToBytes();\... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final PaxosStateLog<V> delegate;",
"type": "PaxosStateLog<V>",
"var_name": "delegate"
},
{
"declarator": "hydrator",
"modifier": "private final",
"original_str... | {
"body": "public List<PaxosRound<V>> readBatch(long startSequence, int numEntries) {\n return AtlasFutures.getUnchecked(\n Futures.allAsList(\n LongStream.range(startSequence, startSequence + numEntries)\n .mapToObj(sequence -> executor.subm... | {
"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_381 | {
"fields": [
{
"declarator": "CONFIG_1 = new InMemoryAtlasDbConfig()",
"modifier": "private static final",
"original_string": "private static final InMemoryAtlasDbConfig CONFIG_1 = new InMemoryAtlasDbConfig();",
"type": "InMemoryAtlasDbConfig",
"var_name": "CONFIG_1"
},
{
... | {
"body": "@Test\n public void twoInstancesOfInMemoryConfigsHaveEqualHashCodes() {\n assertThat(CONFIG_1.hashCode()).isEqualTo(CONFIG_2.hashCode());\n }",
"class_method_signature": "InMemoryAtlasDbConfigTest.twoInstancesOfInMemoryConfigsHaveEqualHashCodes()",
"constructor": false,
"full_signature":... | {
"fields": [
{
"declarator": "TYPE = \"memory\"",
"modifier": "public static final",
"original_string": "public static final String TYPE = \"memory\";",
"type": "String",
"var_name": "TYPE"
}
],
"file": "atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/memory/InMemoryA... | {
"body": "@Override\n public int hashCode() {\n return InMemoryAtlasDbConfig.class.hashCode();\n }",
"class_method_signature": "InMemoryAtlasDbConfig.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "hashCode",
"invocations": [
"hashCode... | {
"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_694 | {
"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 lazilyInitialized() {\n TestInterface iface = ReplaceIfExceptionMatchingProxy.newProxyInstance(\n TestInterface.class, supplier, _thrown -> true);\n verify(supplier, never()).get();\n iface.doSomething();\n verify(supplier, times(1)).get();\... | {
"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_417 | {
"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 testOtherMetricsAreCumulative() {\n SweepOutcomeMetrics.LEGACY_OUTCOMES.forEach(outcome ->\n IntStream.range(0, 10).forEach(ignore -> legacyMetrics.registerOccurrenceOf(outcome)));\n SweepOutcomeMetrics.LEGACY_OUTCOMES.stream()\n .filter(ou... | {
"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_944 | {
"fields": [
{
"declarator": "LOCALHOST = \"localhost\"",
"modifier": "private static final",
"original_string": "private static final String LOCALHOST = \"localhost\";",
"type": "String",
"var_name": "LOCALHOST"
},
{
"declarator": "GET_ENDPOINT = \"/number\"",
"... | {
"body": "@Test\n public void testIsPossiblyOkHttpTimeoutBug() {\n assertThat(AtlasDbHttpClients.isPossiblyOkHttpTimeoutBug(\n new RuntimeException(new UncheckedExecutionException(new SocketTimeoutException())))).isTrue();\n assertThat(AtlasDbHttpClients.isPossiblyOkHttpTimeoutBug(new... | {
"fields": [],
"file": "atlasdb-config/src/main/java/com/palantir/atlasdb/http/AtlasDbHttpClients.java",
"identifier": "AtlasDbHttpClients",
"interfaces": "",
"methods": [
{
"class_method_signature": "AtlasDbHttpClients.AtlasDbHttpClients()",
"constructor": true,
"full_signature": "priv... | {
"body": "@VisibleForTesting\n static boolean isPossiblyOkHttpTimeoutBug(Throwable throwable) {\n if (throwable instanceof SocketTimeoutException) {\n return true;\n }\n Throwable cause = throwable.getCause();\n return cause != null && isPossiblyOkHttpTimeoutBug(cause);\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_1000 | {
"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 retriesOnKeyValueServiceWhenValuesDeletedInGets() throws JsonProcessingException {\n KeyValueService mockKvs = mock(KeyValueService.class);\n KeyValueServiceCoordinationStore<String> store = coordinationStoreForKvs(mockKvs);\n setupOnceFailingMockKvs(mockKvs, sto... | {
"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 Optional<ValueAndBound<T>> getAgreedValue() {\n return readLatestState().map(CoordinationStoreState::valueAndBound);\n }",
"class_method_signature": "KeyValueServiceCoordinationStore.getAgreedValue()",
"constructor": false,
"full_signature": "@Override public Optional<... | {
"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_801 | {
"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 @SuppressWarnings(\"unchecked\") // Mocks\n public void gaugePublicationDecisions() {\n AtomicLong valueOne = new AtomicLong(1L);\n AtomicLong valueTwo = new AtomicLong(100L);\n AtomicLong valueThree = new AtomicLong(100L);\n\n Gauge<Long> gaugeOne = valueOne::get;... | {
"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_552 | {
"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 canReturnTableEvenIfItWasCompactedAfterTheLastSweep() {\n // TABLE_1 was compacted too recently, chooses randomly one compacted over one hour ago\n when(sweepHistoryProvider.getHistory(mockTx)).thenReturn(ImmutableMap.of(TABLE_1, 4L, TABLE_2, 3L));\n when(compact... | {
"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_37 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "atlasdb-dbkvs/src/t... | {
"body": "@Test\n public void shouldFailOn_9_5_0() {\n thrown.expectMessage(\"Versions 9.5.0 and 9.5.1 contain a known bug\");\n PostgresVersionCheck.checkDatabaseVersion(\"9.5.0\", mock(Logger.class));\n }",
"class_method_signature": "PostgresVersionCheckTest.shouldFailOn_9_5_0()",
"construc... | {
"fields": [
{
"declarator": "MIN_POSTGRES_VERSION = \"9.6\"",
"modifier": "static final",
"original_string": "static final String MIN_POSTGRES_VERSION = \"9.6\";",
"type": "String",
"var_name": "MIN_POSTGRES_VERSION"
}
],
"file": "atlasdb-dbkvs/src/main/java/com/palantir/at... | {
"body": "public static void checkDatabaseVersion(String version, Logger log) {\n boolean checkPasses = version.matches(\"^[\\\\.0-9]+$\")\n && VersionStrings.compareVersions(version, MIN_POSTGRES_VERSION) >= 0;\n if (VersionStrings.compareVersions(version, \"9.5\") >= 0\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_102 | {
"fields": [
{
"declarator": "RANDOM = new Random(123)",
"modifier": "private static final",
"original_string": "private static final Random RANDOM = new Random(123);",
"type": "Random",
"var_name": "RANDOM"
}
],
"file": "lock-impl/src/test/java/com/palantir/lock/impl/LockTo... | {
"body": "@Test\n public void throwsIfBigIntegerHasMoreThan127Bits() {\n BigInteger bigInt = BigInteger.valueOf(2).pow(127);\n\n LockRefreshToken token = new LockRefreshToken(bigInt, 0L);\n\n assertThatThrownBy(() -> LockTokenConverter.toTokenV2(token))\n .isInstanceOf(IllegalA... | {
"fields": [],
"file": "lock-impl/src/main/java/com/palantir/lock/impl/LockTokenConverter.java",
"identifier": "LockTokenConverter",
"interfaces": "",
"methods": [
{
"class_method_signature": "LockTokenConverter.LockTokenConverter()",
"constructor": true,
"full_signature": "private Loc... | {
"body": "static LockToken toTokenV2(LockRefreshToken legacyToken) {\n return LockToken.of(toUuid(legacyToken.getTokenId()));\n }",
"class_method_signature": "LockTokenConverter.toTokenV2(LockRefreshToken legacyToken)",
"constructor": false,
"full_signature": "static LockToken toTokenV2(LockRefreshTo... | {
"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_397 | {
"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 metricsAreNotRegisteredIfSweepStrategyNotTracked() {\n MetricsManager anotherManager = MetricsManagers.createForTests();\n TargetedSweepMetrics.createWithClock(anotherManager, kvs, () -> clockTime,\n TargetedSweepMetrics.MetricsConfiguration.builder()\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweepMetrics.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweepMetrics.class);",
"type": "Logger",
"var_name": "log"
},
{... | {
"body": "public static TargetedSweepMetrics createWithClock(\n MetricsManager metricsManager,\n KeyValueService kvs,\n Clock clock,\n MetricsConfiguration metricsConfiguration) {\n return new TargetedSweepMetrics(\n metricsManager,\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_728 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/HiddenTablesTest.java",
"identifier": "HiddenTablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldSayANewStyleLocksTableIsHidden() {\n assertThat(HiddenTables.isHidden(TableReference.createWithEmptyNamespace(\"_locks_aaaa_123\")), is(true));\n }",
"class_method_signature": "HiddenTablesTest.shouldSayANewStyleLocksTableIsHidden()",
"constructor": false,
"full... | {
"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_682 | {
"fields": [
{
"declarator": "STRING_1 = \"a\"",
"modifier": "private static final",
"original_string": "private static final String STRING_1 = \"a\";",
"type": "String",
"var_name": "STRING_1"
},
{
"declarator": "STRING_2 = \"b\"",
"modifier": "private static fi... | {
"body": "@Test\n public void throwsOnTwoUnequalOptionals() {\n assertThatThrownBy(() -> OptionalResolver.resolve(PRESENT_OPTIONAL_1, PRESENT_OPTIONAL_2))\n .isInstanceOf(IllegalArgumentException.class);\n }",
"class_method_signature": "OptionalResolverTest.throwsOnTwoUnequalOptionals()... | {
"fields": [],
"file": "atlasdb-commons/src/main/java/com/palantir/util/OptionalResolver.java",
"identifier": "OptionalResolver",
"interfaces": "",
"methods": [
{
"class_method_signature": "OptionalResolver.OptionalResolver()",
"constructor": true,
"full_signature": "private OptionalRe... | {
"body": "@SuppressWarnings(\"OptionalUsedAsFieldOrParameterType\") // Used to process existing configuration files.\n public static <T> T resolve(Optional<T> optional1, Optional<T> optional2) {\n Set<T> values = Stream.of(optional1, optional2)\n .filter(Objects::nonNull)\n .f... | {
"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_378 | {
"fields": [],
"file": "commons-executors/src/test/java/com/palantir/common/concurrent/PTExecutorsTest.java",
"identifier": "PTExecutorsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExecutorName_customThreadFactory() {\n ThreadFactory factory = runnable -> {\n Thread thread = Executors.defaultThreadFactory().newThread(runnable);\n thread.setName(\"foo-3\");\n return thread;\n };\n assertThat(PTExecutors.g... | {
"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_952 | {
"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 remoteCallsStillMadeIfPingableLeader404s() throws IOException {\n setUpForRemoteServices();\n setUpLeaderBlockInConfig();\n\n TransactionManagers.LockAndTimestampServices lockAndTimestamp = getLockAndTimestampServices();\n availableServer.verify(getRequest... | {
"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_401 | {
"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 abortedWritesDeletedAccumulatesOverShards() {\n metrics.updateAbortedWritesDeleted(CONS_ZERO, 1);\n metrics.updateAbortedWritesDeleted(CONS_ONE, 2);\n metrics.updateAbortedWritesDeleted(CONS_ZERO, 1);\n\n assertThat(metricsManager).hasAbortedWritesDeletedC... | {
"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 updateAbortedWritesDeleted(ShardAndStrategy shardStrategy, long deletes) {\n updateMetricsIfPresent(shardStrategy, metrics -> metrics.updateAbortedWritesDeleted(deletes));\n }",
"class_method_signature": "TargetedSweepMetrics.updateAbortedWritesDeleted(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_114 | {
"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 debugLogShouldBeLoggedWhenLockResponseIsSlowButSlowLogIsDisabled() {\n long lockDurationMillis = SLOW_LOG_TRIGGER_MILLIS + 5;\n lockServiceWithSlowLogDisabled.logSlowLockAcquisition(TEST_LOCKID, LockClient.ANONYMOUS, lockDurationMillis);\n\n assertThat(testLockSe... | {
"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_21 | {
"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 superMatch() {\n RetryLimitReachedException exception = new RetryLimitReachedException(\n ImmutableList.of(ATLAS_DEPENDENCY, GENERIC));\n Assertions.assertThat(exception.suppressed(RuntimeException.class)).isTrue();\n }",
"class_method_signature": "R... | {
"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_544 | {
"fields": [
{
"declarator": "ONE = 1L",
"modifier": "private static final",
"original_string": "private static final long ONE = 1L;",
"type": "long",
"var_name": "ONE"
},
{
"declarator": "TEN = 10L",
"modifier": "private static final",
"original_string": "... | {
"body": "@Test\n public void doesNotThrowIfMetricsAreAccidentallyRegisteredMultipleTimes() {\n TimestampTracker.registerTimestampForTracking(mockClock, metricsManager, FAKE_METRIC, () -> 1L);\n TimestampTracker.registerTimestampForTracking(mockClock, metricsManager, FAKE_METRIC, () -> 2L); // OK\n\... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TimestampTracker.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TimestampTracker.class);",
"type": "Logger",
"var_name": "log"
}
],
"file":... | {
"body": "@VisibleForTesting\n static void registerTimestampForTracking(\n Clock clock, MetricsManager metricsManager, String shortName, Supplier<Long> supplier) {\n metricsManager.registerMetric(\n TimestampTracker.class,\n shortName,\n TrackerUtils.... | {
"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_817 | {
"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 throwsWhenPreprocessingNonCassandraKvsConfig() {\n assertThatThrownBy(() -> {\n KeyValueServiceConfigHelper keyValueServiceConfig = () -> \"Fake KVS\";\n CassandraAtlasDbFactory.preprocessKvsConfig(keyValueServiceConfig, Optional::empty, Optional.empty())... | {
"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_790 | {
"fields": [
{
"declarator": "DEFAULT_PORT = 5000",
"modifier": "private static final",
"original_string": "private static final int DEFAULT_PORT = 5000;",
"type": "int",
"var_name": "DEFAULT_PORT"
},
{
"declarator": "OTHER_PORT = 6000",
"modifier": "private stat... | {
"body": "@Test\n public void shouldUseCommonPortIfThereIsOnlyOneAndNoAddressMatches() throws UnknownHostException {\n CassandraService cassandra = clientPoolWithServers(ImmutableSet.of(HOST_1, HOST_2));\n\n InetSocketAddress resolvedHost = cassandra.getAddressForHost(HOSTNAME_3);\n\n assertT... | {
"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_285 | {
"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 checkAndSet() throws Exception {\n CheckAndSetRequest request = CheckAndSetRequest.singleCell(TABLE_REF, CELL, ROW_NAME, ROW_NAME);\n kvs.checkAndSet(request);\n\n checkSpan(\"atlasdb-kvs.checkAndSet({table})\");\n verify(delegate).checkAndSet(request);\n ... | {
"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 checkAndSet(CheckAndSetRequest checkAndSetRequest) throws CheckAndSetException {\n //noinspection unused - try-with-resources closes trace\n try (CloseableTrace trace = startLocalTrace(\"checkAndSet({})\",\n LoggingArgs.safeTableOrPlaceholder(checkAnd... | {
"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_456 | {
"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 withFewEntriesReduceByOneTaskEachTimeCoolDownPasses() throws Exception {\n when(sweepIteration.call()).thenReturn(SUCCESS_SMALL);\n scheduler.start(10);\n\n tickClock();\n runSweepIterations(1 + 4);\n\n tickClockForHalfCoolDown();\n runSweepI... | {
"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_99 | {
"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 shouldBeUnhealthyIfQuorumNodesAreNotUpAndOnePingedSuccessfully() {\n HealthCheckPinger leader1 = getMockOfPingableLeaderWherePingReturns(ALL_CLIENTS);\n HealthCheckPinger leader2 = getMockOfPingableLeaderWherePingThrows();\n HealthCheckPinger leader3 = getMockOfP... | {
"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_905 | {
"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 shouldThrowWhenTryingToStartIllegalNumberOfTransactions() {\n assertThatThrownBy(() -> transactionStarter.startIdentifiedAtlasDbTransactionBatch(0))\n .isInstanceOf(SafeIllegalArgumentException.class)\n .hasMessage(\"Cannot start 0 or fewer transa... | {
"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_840 | {
"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 testGetFreshTimestampDefersToTimestampService() {\n managedTimestampService.getFreshTimestamp();\n\n verify(timestampService, times(1)).getFreshTimestamp();\n }",
"class_method_signature": "DelegatingManagedTimestampServiceTest.testGetFreshTimestampDefersToTimestam... | {
"fields": [
{
"declarator": "timestampService",
"modifier": "private final",
"original_string": "private final TimestampService timestampService;",
"type": "TimestampService",
"var_name": "timestampService"
},
{
"declarator": "timestampManagementService",
"modif... | {
"body": "@Override\n public long getFreshTimestamp() {\n return timestampService.getFreshTimestamp();\n }",
"class_method_signature": "DelegatingManagedTimestampService.getFreshTimestamp()",
"constructor": false,
"full_signature": "@Override public long getFreshTimestamp()",
"identifier": "getF... | {
"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_76 | {
"fields": [],
"file": "timelock-agent/src/test/java/com/palantir/timelock/config/TimeLockRuntimeConfigurationTest.java",
"identifier": "TimeLockRuntimeConfigurationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void throwOnNegativeLeaderPingResponseWait() {\n assertThatThrownBy(() -> ImmutableTimeLockRuntimeConfiguration.builder()\n .slowLockLogTriggerMillis(-1L)\n .build()).isInstanceOf(IllegalStateException.class);\n }",
"class_method_signature": "Time... | {
"fields": [],
"file": "timelock-agent/src/main/java/com/palantir/timelock/config/TimeLockRuntimeConfiguration.java",
"identifier": "TimeLockRuntimeConfiguration",
"interfaces": "",
"methods": [
{
"class_method_signature": "TimeLockRuntimeConfiguration.paxos()",
"constructor": false,
"f... | {
"body": "@JsonProperty(\"slow-lock-log-trigger-in-ms\")\n @Value.Default\n public long slowLockLogTriggerMillis() {\n return 10000;\n }",
"class_method_signature": "TimeLockRuntimeConfiguration.slowLockLogTriggerMillis()",
"constructor": false,
"full_signature": "@JsonProperty(\"slow-lock-log-... | {
"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_513 | {
"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 otherErrorReturnsMaxPause() {\n assertThat(delay.getNextPause(SweepIterationResults.otherError())).isEqualTo(DEFAULT_MAX_PAUSE_MILLIS);\n }",
"class_method_signature": "SweepDelayTest.otherErrorReturnsMaxPause()",
"constructor": false,
"full_signature": "@Test public ... | {
"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_143 | {
"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 returnsOneNamespaceEvenIfMultipleSequencesPresent() {\n initializeLog(NAMESPACE_1, SEQUENCE_ID_1);\n initializeLog(NAMESPACE_1, SEQUENCE_ID_2);\n assertThat(namespaceLoader.getAllPersistedNamespaces()).containsExactlyInAnyOrder(NAMESPACE_1);\n }",
"class_met... | {
"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_354 | {
"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 readWhenStreamExhaustedReturnsMinusOne() throws IOException {\n byte[] result = new byte[DATA_SIZE];\n dataStream.read(result);\n\n int read = dataStream.read(result);\n assertEquals(-1, read);\n }",
"class_method_signature": "BlockConsumingInputStrea... | {
"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_704 | {
"fields": [
{
"declarator": "DO_NOTHING = () -> {}",
"modifier": "private static final",
"original_string": "private static final Runnable DO_NOTHING = () -> {};",
"type": "Runnable",
"var_name": "DO_NOTHING"
},
{
"declarator": "RETURN_ONE = () -> 1",
"modifier"... | {
"body": "@Test\n @SuppressWarnings(\"unchecked\") // Mocks\n public void propagatesRejectionThroughSubmit() {\n doThrow(REJECTED_EXECUTION_EXCEPTION).when(delegate).submit(any(Callable.class));\n assertThatThrownBy(() -> checkedRejectionExecutor.submit(RETURN_ONE))\n .isInstanceOf... | {
"fields": [
{
"declarator": "underlying",
"modifier": "private final",
"original_string": "private final ExecutorService underlying;",
"type": "ExecutorService",
"var_name": "underlying"
}
],
"file": "atlasdb-commons/src/main/java/com/palantir/common/concurrent/CheckedRejec... | {
"body": "public <T> Future<T> submit(Callable<T> callable) throws CheckedRejectedExecutionException {\n try {\n return underlying.submit(callable);\n } catch (RejectedExecutionException ex) {\n throw new CheckedRejectedExecutionException(ex);\n }\n }",
"class_method_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_211 | {
"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 rethrowsInterruptedExceptionIfInterruptibleOperationIsInterrupted() {\n assertThatThrownBy(() -> interruptingService.lockAndGetHeldLocks(CLIENT, LOCK_REQUEST))\n .isInstanceOf(InterruptedException.class);\n }",
"class_method_signature": "BlockingTimeLimited... | {
"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": "@Override\n public HeldLocksToken lockAndGetHeldLocks(@PathParam(\"client\") String client, LockRequest request)\n throws InterruptedException {\n return callWithTimeLimit(\n () -> delegate.lockAndGetHeldLocks(client, request),\n ImmutableLockRequestSpecif... | {
"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_641 | {
"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 getMillisForTimestampReturnsZeroIfQueryingTimestampBeforeFirstPunch() {\n assertThat(puncherStore.getMillisForTimestamp(Long.MIN_VALUE)).isEqualTo(0L);\n assertThat(puncherStore.getMillisForTimestamp(TIMESTAMP_1 - 1)).isEqualTo(0L);\n }",
"class_method_signature": ... | {
"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 getMillisForTimestamp(long timestamp) {\n return getMillisForTimestamp(keyValueService, timestamp);\n }",
"class_method_signature": "KeyValueServicePuncherStore.getMillisForTimestamp(long timestamp)",
"constructor": false,
"full_signature": "@Override public long ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_991 | {
"fields": [
{
"declarator": "KVS_CONFIG_WITHOUT_NAMESPACE = mock(KeyValueServiceConfig.class)",
"modifier": "private static final",
"original_string": "private static final KeyValueServiceConfig KVS_CONFIG_WITHOUT_NAMESPACE = mock(KeyValueServiceConfig.class);",
"type": "KeyValueServiceC... | {
"body": "@Test\n public void configWithNoLeaderOrLockIsValid() {\n AtlasDbConfig config = ImmutableAtlasDbConfig.builder()\n .keyValueService(KVS_CONFIG_WITH_NAMESPACE)\n .build();\n assertThat(config, not(nullValue()));\n }",
"class_method_signature": "AtlasDbCon... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AtlasDbConfig.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AtlasDbConfig.class);",
"type": "Logger",
"var_name": "log"
},
{
"declar... | {
"body": "public abstract KeyValueServiceConfig keyValueService();",
"class_method_signature": "AtlasDbConfig.keyValueService()",
"constructor": false,
"full_signature": "public abstract KeyValueServiceConfig keyValueService()",
"identifier": "keyValueService",
"invocations": [],
"modifiers": "public abs... | {
"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_568 | {
"fields": [
{
"declarator": "TIMESTAMP_1 = 12345",
"modifier": "private static final",
"original_string": "private static final long TIMESTAMP_1 = 12345;",
"type": "long",
"var_name": "TIMESTAMP_1"
},
{
"declarator": "TIMESTAMP_2 = 34567L",
"modifier": "private ... | {
"body": "@Test\n public void getRangeAtBoundThresholdIdentifiesTheCorrectRange() {\n InternalSchemaMetadata internalSchemaMetadata = InternalSchemaMetadata.builder()\n .timestampToTransactionsTableSchemaVersion(\n TimestampPartitioningMap.of(\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TransactionSchemaManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TransactionSchemaManager.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@VisibleForTesting\n Map.Entry<Range<Long>, Integer> getRangeAtBoundThreshold(ValueAndBound<InternalSchemaMetadata> valueAndBound) {\n return valueAndBound.value()\n .orElseThrow(() -> new SafeIllegalStateException(\"Unexpectedly found no value in store\"))\n .timest... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_138 | {
"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 testInfoPrintingWorksWithSingleReplacement() {\n String systemOut = StandardStreamUtilities.wrapSystemOut(\n () -> print.info(\"Test this gets {}\", SafeArg.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 info(String message, Arg... args) {\n String infoMessage = MessageFormatter.arrayFormat(message, args).getMessage();\n logger.info(message, args);\n System.out.println(infoMessage);\n }",
"class_method_signature": "OutputPrinter.info(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_587 | {
"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 canCallGetOnDelegate() {\n when(delegate1.get(1L)).thenReturn(2L);\n assertThat(delegatingTransactionService.get(1L)).isEqualTo(2L);\n verify(delegate1).get(1L);\n }",
"class_method_signature": "SplitKeyDelegatingTransactionServiceTest.canCallGetOnDelegate()... | {
"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_4 | {
"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 deregisteringMetricsIsReflectedInUnion() {\n registry1.timer(METRIC_NAME_1);\n Histogram histogram = registry2.histogram(METRIC_NAME_2);\n Meter meter = registry1.meter(METRIC_NAME_3);\n registry1.remove(METRIC_NAME_1);\n\n assertThat(disjointUnionT... | {
"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_753 | {
"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 simpleStrategyOneDcHighRfThrows() throws TException {\n KsDef ksDef = new KsDef(\"test\", CassandraConstants.SIMPLE_STRATEGY, ImmutableList.of());\n ksDef.setStrategy_options(ImmutableMap.of(CassandraConstants.REPLICATION_FACTOR_OPTION, \"3\"));\n\n assertThatThr... | {
"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_303 | {
"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 put() throws Exception {\n Map<Cell, byte[]> values = ImmutableMap.of(CELL, VALUE_BYTES);\n kvs.put(TABLE_REF, values, TIMESTAMP);\n\n checkSpan(\"atlasdb-kvs.put({table}, 1 values, ts 1)\");\n verify(delegate).put(TABLE_REF, values, TIMESTAMP);\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 put(TableReference tableRef, Map<Cell, byte[]> values, long timestamp) {\n //noinspection unused - try-with-resources closes trace\n try (CloseableTrace trace = startLocalTrace(\"put({}, {} values, ts {})\",\n LoggingArgs.safeTableOrPlaceholder(tableR... | {
"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_616 | {
"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 closesKeyValueServiceOnClose() {\n snapshotTransactionManager.close();\n verify(keyValueService, times(1)).close();\n }",
"class_method_signature": "SnapshotTransactionManagerTest.closesKeyValueServiceOnClose()",
"constructor": false,
"full_signature": "@Test p... | {
"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_246 | {
"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 extraFieldsAreTolerated() {\n String extraFieldJson = \"{\\\"string\\\": \\\"tom\\\", \\\"extraneous\\\": \\\"another\\\"}\";\n byte[] result = SIMPLE_NAME_METADATA_DESCRIPTION.parseFromJson(extraFieldJson, false);\n assertThat(result).containsExactly(PtBytes.toB... | {
"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_495 | {
"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 sweepableTimestampsGetsScrubbedWhenLastSweptProgressesInNewCoarsePartition() {\n for (int i = 0; i < 2 * readBatchSize; i++) {\n enqueueWriteCommitted(TABLE_CONS, LOW_TS + TS_FINE_GRANULARITY * i);\n }\n enqueueWriteCommitted(TABLE_CONS, TS_COARSE_GRAN... | {
"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_929 | {
"fields": [
{
"declarator": "USER_AGENT = UserAgent.of(UserAgent.Agent.of(\"tom\", \"1.2.3\"))",
"modifier": "private static final",
"original_string": "private static final UserAgent USER_AGENT = UserAgent.of(UserAgent.Agent.of(\"tom\", \"1.2.3\"));",
"type": "UserAgent",
"var_nam... | {
"body": "@Test\n public void minimallySpecifiedRetryingParametersShouldMatchLegacyBehaviour() {\n ClientOptions clientOptions = ClientOptions.fromRemotingParameters(AuxiliaryRemotingParameters.builder()\n .shouldLimitPayload(true)\n .shouldRetry(true)\n .userAg... | {
"fields": [
{
"declarator": "FAST_RETRYING_FOR_TEST = ImmutableClientOptions.builder()\n .connectTimeout(Duration.ofMillis(100))\n .readTimeout(Duration.ofSeconds(65))\n .backoffSlotSize(Duration.ofMillis(5))\n .failedUrlCooldown(Duration.ofMillis(1))\n ... | {
"body": "static ClientOptions fromRemotingParameters(AuxiliaryRemotingParameters parameters) {\n ImmutableClientOptions.Builder builder = ImmutableClientOptions.builder();\n\n setupTimeouts(builder, parameters);\n setupRetrying(builder, parameters);\n\n return builder.clientQoS(ClientCon... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_883 | {
"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 leasedTokenShouldHaveValidLeaseForTheLeasePeriod() {\n when(timelock.lock(any())).thenReturn(\n ConjureLockResponse.successful(SuccessfulLockResponse.of(LOCK_TOKEN, getLease())));\n\n LockResponse lockResponse = lockLeaseService.lock(lockRequest);\n ... | {
"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_180 | {
"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 forceAgreedStateCanBeUsedToGainKnowledge() {\n assertThat(store.forceAgreedState(1, FORTY_TWO)).isEqualTo(ONE_AND_FORTY_TWO);\n\n PaxosTimestampBoundStore additionalStore = createPaxosTimestampBoundStore(1);\n assertThat(additionalStore.forceAgreedState(1, null))... | {
"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_315 | {
"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 @SuppressWarnings(\"CheckReturnValue\") // We test that returnedArgs will contain both a safe and unsafe references.\n public void canReturnListOfSafeTableReferences() {\n LoggingArgs.SafeAndUnsafeTableReferences returnedArgs =\n LoggingArgs.tableRefs(LIST_OF_SAFE_AND_UN... | {
"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 SafeAndUnsafeTableReferences tableRefs(Collection<TableReference> tableReferences) {\n List<TableReference> safeTableRefs = new ArrayList<>();\n List<TableReference> unsafeTableRefs = new ArrayList<>();\n\n for (TableReference tableRef : tableReferences) {\n if... | {
"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_745 | {
"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 nonDefaultDcAndHighRfSucceeds() throws TException {\n setTopology(createDetails(DC_1, RACK_1, HOST_1));\n when(config.replicationFactor()).thenReturn(3);\n\n assertThat(CassandraVerifier.sanityCheckDatacenters(client, config))\n .containsExactly(DC... | {
"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_250 | {
"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 throwsOnArrays() {\n String jsonString = \"[\\\"string\\\"]\";\n\n assertThatThrownBy(() -> SIMPLE_NAME_METADATA_DESCRIPTION.parseFromJson(jsonString, false))\n .isInstanceOf(IllegalStateException.class)\n .hasMessageContaining(\"Only JSON ... | {
"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_600 | {
"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 passesThroughGetsOnValidCommittedTimestamp() {\n Long timestamp = preStartHandlingService.get(START_TIMESTAMP);\n assertThat(timestamp).isEqualTo(COMMIT_TIMESTAMP);\n verify(delegate).get(START_TIMESTAMP);\n }",
"class_method_signature": "PreStartHandlingTra... | {
"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_529 | {
"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 @GuardedBy(\"manager\")\n public void callingAcquireTwiceGivesUsTheSameLock() {\n whenWeGetTheLockFirstTimeAndThenHoldItForever();\n\n manager.acquirePersistentLockWithRetry();\n assertThat(manager.lockId, is(FIRST_LOCK_ID));\n\n manager.acquirePersistentLockWithRe... | {
"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_483 | {
"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 sweepsOnlyThePrescribedNumberOfBatchesAtATime() {\n for (int partition = 0; partition <= readBatchSize; partition++) {\n enqueueWriteCommitted(TABLE_CONS, LOW_TS + SweepQueueUtils.minTsForFinePartition(partition));\n enqueueWriteCommitted(TABLE_CONS, LOW_... | {
"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_179 | {
"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 canSafelyForceAgreedStateFromPrehistory() {\n assertThat(store.forceAgreedState(Long.MIN_VALUE, Long.MIN_VALUE).getBound()).isEqualTo(0);\n }",
"class_method_signature": "PaxosTimestampBoundStoreTest.canSafelyForceAgreedStateFromPrehistory()",
"constructor": false,
"f... | {
"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_196 | {
"fields": [
{
"declarator": "REQUEST_1 = UUID.randomUUID()",
"modifier": "private static final",
"original_string": "private static final UUID REQUEST_1 = UUID.randomUUID();",
"type": "UUID",
"var_name": "REQUEST_1"
},
{
"declarator": "REQUEST_2 = UUID.randomUUID()",
... | {
"body": "@Test\n public void removesRequestWhenFailedOrTimesOut() {\n AsyncResult<Void> result1 = new AsyncResult<>();\n AsyncResult<Void> result2 = new AsyncResult<>();\n awaitedLocks.getExistingOrAwait(REQUEST_1, () -> result1);\n awaitedLocks.getExistingOrAwait(REQUEST_1, () -> res... | {
"fields": [
{
"declarator": "requestsById = Maps.newConcurrentMap()",
"modifier": "@VisibleForTesting\n final",
"original_string": "@VisibleForTesting\n final ConcurrentMap<UUID, AsyncResult<Void>> requestsById = Maps.newConcurrentMap();",
"type": "ConcurrentMap<UUID, AsyncResult<V... | {
"body": "public AsyncResult<Void> getExistingOrAwait(\n UUID requestId,\n Supplier<AsyncResult<Void>> lockAwaiter) {\n AsyncResult<Void> result = requestsById.computeIfAbsent(\n requestId,\n ignored -> lockAwaiter.get());\n\n registerCompletionHandle... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_895 | {
"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 refreshDelegates() {\n timelock.refreshLockLeases(TOKENS);\n\n verify(delegate).refreshLockLeases(TOKENS);\n verifyNoMoreInteractions(refresher);\n }",
"class_method_signature": "TimeLockClientTest.refreshDelegates()",
"constructor": false,
"full_signatu... | {
"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> refreshLockLeases(Set<LockToken> tokens) {\n return executeOnTimeLock(() -> delegate.refreshLockLeases(tokens));\n }",
"class_method_signature": "TimeLockClient.refreshLockLeases(Set<LockToken> tokens)",
"constructor": false,
"full_signature": "@Override... | {
"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_712 | {
"fields": [],
"file": "atlasdb-commons/src/test/java/com/palantir/common/base/BatchingVisitablesTest.java",
"identifier": "BatchingVisitablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetFirstPage() {\n BatchingVisitable<Long> visitor = ListVisitor.create(Lists.newArrayList(0L, 1L, 2L, 3L));\n\n TokenBackedBasicResultsPage<Long, Long> page = BatchingVisitables.getFirstPage(visitor, 0);\n assertEquals(\"page results had wrong size!\", 0, pa... | {
"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, TOKEN> TokenBackedBasicResultsPage<T, TOKEN> getFirstPage(BatchingVisitable<T> v,\n int numToVisitArg,\n Function<T, TOKEN> tokenEx... | {
"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_342 | {
"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 startLocalTrace() throws Exception {\n try (CloseableTrace trace = CloseableTrace.startLocalTrace(\"service\", \"method({})\", \"foo\")) {\n assertNotNull(trace);\n }\n List<Span> spans = observer.spans();\n assertThat(spans, hasSize(1));\n ... | {
"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_657 | {
"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 transactionTablesNotValidated() {\n TransactionTables.createTables(kvs);\n assertThat(KeyValueServiceValidators.getValidatableTableNames(kvs, ImmutableSet.of())).isEmpty();\n }",
"class_method_signature": "KeyValueServiceValidatorsTest.transactionTablesNotValidated... | {
"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_207 | {
"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 requestForTheFutureReturnsSnapshot() {\n LockWatchReference entireTable = LockWatchReferenceUtils.entireTable(TABLE_REF);\n lockWatches.set(createWatchesFor(entireTable));\n\n LockWatchStateUpdate update = log.getLogDiff(FUTURE_VERSION_CURRENT_LOG_ID);\n\n ... | {
"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_987 | {
"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 namespacingAddsClientNameCorrectly() {\n ServerListConfig namespacedServersList = ServerListConfigs.namespaceUris(SERVERS_LIST_1, CLIENT);\n assertThat(namespacedServersList.servers()).containsExactly(\"one/client\");\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_968 | {
"fields": [
{
"declarator": "adapter = new FreshTimestampSupplierAdapter()",
"modifier": "private final",
"original_string": "private final FreshTimestampSupplierAdapter adapter = new FreshTimestampSupplierAdapter();",
"type": "FreshTimestampSupplierAdapter",
"var_name": "adapter"
... | {
"body": "@Test\n public void propagatesExceptionsThrownByTimestampService() {\n TimestampService timestampService = mock(TimestampService.class);\n when(timestampService.getFreshTimestamp()).thenThrow(new IllegalStateException());\n\n adapter.setTimestampService(timestampService);\n a... | {
"fields": [
{
"declarator": "timestampService",
"modifier": "private volatile",
"original_string": "private volatile TimestampService timestampService;",
"type": "TimestampService",
"var_name": "timestampService"
}
],
"file": "atlasdb-config/src/main/java/com/palantir/atlas... | {
"body": "public void setTimestampService(TimestampService timestampService) {\n Preconditions.checkNotNull(timestampService, \"Should not re-set timestamp service in a\"\n + \" FreshTimestampSupplierAdapter to null\");\n this.timestampService = timestampService;\n }",
"class_method... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.