id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
36960637_763 | {
"fields": [
{
"declarator": "DATA = PtBytes.toBytes(\"data\")",
"modifier": "private static final",
"original_string": "private static final byte[] DATA = PtBytes.toBytes(\"data\");",
"type": "byte[]",
"var_name": "DATA"
},
{
"declarator": "CELL = Cell.create(DATA, DA... | {
"body": "@Test\n public void createColumnForDeleteCreatesItWithSpecifiedCassandraTimestamp() {\n assertThat(CassandraKeyValueServices.createColumnForDelete(\n CELL,\n Value.create(PtBytes.EMPTY_BYTE_ARRAY, 1000),\n 2000)\n .getTimestamp())\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraKeyValueService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraKeyValueService.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "static Column createColumnForDelete(Cell cell, Value value, long cassandraTimestamp) {\n Preconditions.checkState(\n Arrays.equals(value.getContents(), PtBytes.EMPTY_BYTE_ARRAY),\n \"Attempted to createColumnForDelete on a non-delete value, for cell %s and value %s\",\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_108 | {
"fields": [
{
"declarator": "LOCK_CLIENT = LockClient.of(\"foo\")",
"modifier": "private static final",
"original_string": "private static final LockClient LOCK_CLIENT = LockClient.of(\"foo\");",
"type": "LockClient",
"var_name": "LOCK_CLIENT"
},
{
"declarator": "FRES... | {
"body": "@Test\n public void unlockDelegatesToLockService() {\n timelock.unlock(ImmutableSet.of(LOCK_TOKEN_V2));\n\n verify(lockService).unlock(LOCK_REFRESH_TOKEN);\n }",
"class_method_signature": "LegacyTimelockServiceTest.unlockDelegatesToLockService()",
"constructor": false,
"full_signa... | {
"fields": [
{
"declarator": "timestampService",
"modifier": "private final",
"original_string": "private final TimestampService timestampService;",
"type": "TimestampService",
"var_name": "timestampService"
},
{
"declarator": "lockService",
"modifier": "private ... | {
"body": "@Override\n public Set<LockToken> unlock(Set<LockToken> tokens) {\n Set<LockToken> unlocked = Sets.newHashSet();\n for (LockToken tokenV2 : tokens) {\n LockRefreshToken legacyToken = LockTokenConverter.toLegacyToken(tokenV2);\n if (lockService.unlock(legacyToken)) {\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_558 | {
"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 canReturnRegistrationFailure() throws InterruptedException {\n doThrow(new RuntimeException()).when(txManager).runTaskWithRetry(any());\n\n BackgroundCompactor.CompactionOutcome outcome = compactor.grabLockAndRunOnce(lockService);\n assertThat(outcome).isEqualTo(... | {
"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 CompactionOutcome grabLockAndRunOnce(SingleLockService compactorLock)\n throws InterruptedException {\n CompactorConfig config = compactorConfigSupplier.get();\n if (!config.enableCompaction()) {\n log.debug(\"Skipping compaction because it is cur... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_671 | {
"fields": [
{
"declarator": "REFRESH_MILLIS = 1L",
"modifier": "private static final",
"original_string": "private static final long REFRESH_MILLIS = 1L;",
"type": "long",
"var_name": "REFRESH_MILLIS"
},
{
"declarator": "supplier",
"modifier": "private",
"... | {
"body": "@Test\n public void versionDoesNotUpdateUntilGetIsCalled() throws InterruptedException {\n assertThat(supplier.get()).isEqualTo(VersionedType.of(0L, UNINITIALIZED_VERSION + 1L));\n\n waitForUpdate();\n waitForUpdate();\n waitForUpdate();\n assertThat(supplier.get()).is... | {
"fields": [
{
"declarator": "UNINITIALIZED_VERSION = 0L",
"modifier": "public static final",
"original_string": "public static final long UNINITIALIZED_VERSION = 0L;",
"type": "long",
"var_name": "UNINITIALIZED_VERSION"
},
{
"declarator": "aggregator",
"modifier... | {
"body": "@Override\n public VersionedType<T> get() {\n return memoizedValue.get();\n }",
"class_method_signature": "AggregatingVersionedSupplier.get()",
"constructor": false,
"full_signature": "@Override public VersionedType<T> get()",
"identifier": "get",
"invocations": [
"get"
],
"m... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_221 | {
"fields": [
{
"declarator": "THREAD_NAME = AnnotatedCallableTest.class.getSimpleName()",
"modifier": "private static final",
"original_string": "private static final String THREAD_NAME = AnnotatedCallableTest.class.getSimpleName();",
"type": "String",
"var_name": "THREAD_NAME"
... | {
"body": "@Test\n public void replaceThreadNameWith() throws Exception {\n Callable<String> callable = AnnotatedCallable.replaceThreadNameWith(\n \"test\", () -> {\n assertThat(Thread.currentThread().getName(), is(\"test\"));\n return \"Hello, world!\";\... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final Callable<T> delegate;",
"type": "Callable<T>",
"var_name": "delegate"
},
{
"declarator": "name",
"modifier": "private final",
"original_string": "private... | {
"body": "public static <T> Callable<T> replaceThreadNameWith(String threadName, Callable<T> delegate) {\n return wrapWithThreadName(AnnotationType.REPLACE, threadName, delegate);\n }",
"class_method_signature": "AnnotatedCallable.replaceThreadNameWith(String threadName, Callable<T> delegate)",
"constr... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_734 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraApiVersionTest.java",
"identifier": "CassandraApiVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void\n version_19_38_0_supports_cas() {\n CassandraApiVersion version = new CassandraApiVersion(\"19.38.0\");\n assertThat(version.supportsCheckAndSet(), is(true));\n }",
"class_method_signature": "CassandraApiVersionTest.version_19_38_0_supports_cas()",
"constructor": ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(CassandraApiVersion.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CassandraApiVersion.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "public boolean supportsCheckAndSet() {\n boolean supportsCheckAndSet = majorVersion > 19 || (majorVersion == 19 && minorVersion >= 37);\n\n if (supportsCheckAndSet) {\n LOGGER.info(\"Your cassandra api version ({}) supports check and set.\",\n SafeArg.of(\"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_364 | {
"fields": [
{
"declarator": "SUITE_NAME = \"PerformanceResults\"",
"modifier": "private static final",
"original_string": "private static final String SUITE_NAME = \"PerformanceResults\";",
"type": "String",
"var_name": "SUITE_NAME"
},
{
"declarator": "BENCHMARK_NAME ... | {
"body": "@Test\n public void canGenerateBenchmarkNameForTestWithoutKeyValueService() {\n BenchmarkParams params = createBenchmarkParams(FULL_BENCHMARK_NAME, \"foo\", \"bar\");\n\n assertThat(PerformanceResults.getBenchmarkName(params)).isEqualTo(FORMATTED_BENCHMARK_NAME_AGNOSTIC);\n }",
"class... | {
"fields": [
{
"declarator": "KVS_AGNOSTIC_SUFFIX = \"N/A\"",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final String KVS_AGNOSTIC_SUFFIX = \"N/A\";",
"type": "String",
"var_name": "KVS_AGNOSTIC_SUFFIX"
},
{
"... | {
"body": "@VisibleForTesting\n static String getBenchmarkName(BenchmarkParams params) {\n Optional<String> benchmarkUriSuffix = Optional.ofNullable(params.getParam(BenchmarkParam.URI.getKey()))\n .map(DockerizedDatabaseUri::fromUriString)\n .map(uri -> uri.getKeyValueServiceIn... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_958 | {
"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 timeLockMigrationReportsNotReadyIfMigrationNotDone() {\n when(migrator.isInitialized()).thenReturn(false);\n when(lockAndTimestampServices.migrator()).thenReturn(Optional.of(migrator));\n\n assertFalse(TransactionManagers.timeLockMigrationCompleteIfNeeded(lockAnd... | {
"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": "@VisibleForTesting\n static boolean timeLockMigrationCompleteIfNeeded(LockAndTimestampServices lockAndTimestampServices) {\n return lockAndTimestampServices.migrator().map(AsyncInitializer::isInitialized).orElse(true);\n }",
"class_method_signature": "TransactionManagers.timeLockMigrationCom... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_237 | {
"fields": [
{
"declarator": "TAG_KEY_1 = \"tag1\"",
"modifier": "private static final",
"original_string": "private static final String TAG_KEY_1 = \"tag1\";",
"type": "String",
"var_name": "TAG_KEY_1"
},
{
"declarator": "TAG_VALUE_1 = \"tagVal1\"",
"modifier": ... | {
"body": "@Test\n public void shouldThrowIfSecondMetricTagValueContainsEquals() throws Exception {\n assertThatThrownBy(() -> MetricNameUtils.getMetricName(METRIC_NAME,\n ImmutableMap.of(TAG_KEY_1, TAG_VALUE_1, TAG_KEY_2, \"tagVal=2\")))\n .isInstanceOf(IllegalArgumentExceptio... | {
"fields": [
{
"declarator": "MAX_ALLOWED_TAGS = 10",
"modifier": "private static final",
"original_string": "private static final int MAX_ALLOWED_TAGS = 10;",
"type": "int",
"var_name": "MAX_ALLOWED_TAGS"
},
{
"declarator": "DELIMITER = \";\"",
"modifier": "priv... | {
"body": "public static String getMetricName(String metricName, Map<String, String> tags) {\n Preconditions.checkArgument(tags.size() <= MAX_ALLOWED_TAGS, \"Too many tags set on the metric %s. \"\n + \"Maximum allowed number of tags is %s, found %s.\", metricName, MAX_ALLOWED_TAGS, tags.size())... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_667 | {
"fields": [
{
"declarator": "counter",
"modifier": "private",
"original_string": "private long counter;",
"type": "long",
"var_name": "counter"
},
{
"declarator": "supplierCounter",
"modifier": "private",
"original_string": "private long supplierCounter;",... | {
"body": "@Test\n public void doesNotApplyFunctionIfGetIsInvokedAndSuppliedVersionConstant() {\n when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(null, 0));\n assertThat(testSupplier.get()).isNull();\n assertThat(counter).isEqualTo(1);\n\n when(mockVersionedSupplier.get())... | {
"fields": [
{
"declarator": "function",
"modifier": "private final",
"original_string": "private final Function<T, R> function;",
"type": "Function<T, R>",
"var_name": "function"
},
{
"declarator": "supplier",
"modifier": "private final",
"original_string"... | {
"body": "@Override\n public R get() {\n if (!Objects.equals(supplier.get().version(), lastSuppliedVersion)\n || lastComputedTime + maxTimeBetweenRecomputes < clock.getTimeMillis()) {\n recompute();\n }\n return cached;\n }",
"class_method_signature": "CachedCom... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_688 | {
"fields": [
{
"declarator": "INIT_FAIL = new RuntimeException(\"Failed during initialization.\")",
"modifier": "private static final",
"original_string": "private static final RuntimeException INIT_FAIL = new RuntimeException(\"Failed during initialization.\");",
"type": "RuntimeExceptio... | {
"body": "@Test\n public void retryingCallbackStopsRetryingWhenCleanupThrows() {\n callback = LambdaCallback.retrying(this::markInitAndFail, this::markCleanupThenFailIfMoreThatTenInits);\n\n assertThatThrownBy(() -> callback.runWithRetry(initsAndCleanups)).isEqualToComparingFieldByField(CLEANUP_FAIL... | {
"fields": [
{
"declarator": "FAIL = (ignore, throwable) -> {\n throw Throwables.rewrapAndThrowUncheckedException(throwable);\n }",
"modifier": "private static final",
"original_string": "private static final BiConsumer<Object, Throwable> FAIL = (ignore, throwable) -> {\n throw... | {
"body": "public static <R> Callback<R> retrying(Consumer<R> initialize, BiConsumer<R, Throwable> onInitFailureCleanup) {\n return new LambdaCallback<>(initialize, onInitFailureCleanup);\n }",
"class_method_signature": "LambdaCallback.retrying(Consumer<R> initialize, BiConsumer<R, Throwable> onInitFailur... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_372 | {
"fields": [
{
"declarator": "IMAGE = new byte[] {0, 1, 2, 3}",
"modifier": "private static final",
"original_string": "private static final byte[] IMAGE = new byte[] {0, 1, 2, 3};",
"type": "byte[]",
"var_name": "IMAGE"
},
{
"declarator": "USER = UserProfile.newBuilde... | {
"body": "@Test\n public void testStore() {\n final UUID userId = storeUser();\n runWithRetry(store -> {\n UserProfile storedData = store.getUserData(userId);\n Assert.assertEquals(USER, storedData);\n return userId;\n });\n }",
"class_method_signature": ... | {
"fields": [
{
"declarator": "txnMgr",
"modifier": "final",
"original_string": "final TransactionManager txnMgr;",
"type": "TransactionManager",
"var_name": "txnMgr"
},
{
"declarator": "tx",
"modifier": "final",
"original_string": "final Transaction tx;",
... | {
"body": "public UserProfile getUserData(UUID userId) {\n UserProfileTable table = tables.getUserProfileTable(tx);\n Map<UserProfileRow, UserProfile> result = table.getMetadatas(ImmutableSet.of(UserProfileRow.of(userId)));\n if (result.isEmpty()) {\n return null;\n } else {\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_722 | {
"fields": [
{
"declarator": "TABLE_REFERENCE = TableReference.createFromFullyQualifiedName(\"ns.table\")",
"modifier": "private static final",
"original_string": "private static final TableReference TABLE_REFERENCE = TableReference.createFromFullyQualifiedName(\"ns.table\");",
"type": "T... | {
"body": "@Test\n public void valuesCreatedAtCorrectLogSafetyLevelsForNewCells() {\n CqlQuery query = CheckAndSetQueries.getQueryForRequest(NEW_CELL_REQUEST);\n AtomicReference<Object[]> objects = new AtomicReference<>();\n query.logSlowResult((format, args) -> objects.set(args), Stopwatch.cr... | {
"fields": [
{
"declarator": "CASSANDRA_TIMESTAMP = -1L",
"modifier": "private static final",
"original_string": "private static final long CASSANDRA_TIMESTAMP = -1L;",
"type": "long",
"var_name": "CASSANDRA_TIMESTAMP"
},
{
"declarator": "CASSANDRA_PREFIX = \"0x\"",
... | {
"body": "static CqlQuery getQueryForRequest(CheckAndSetRequest request) {\n return request.oldValue().map(unused -> updateIfMatching(request)).orElseGet(() -> insertIfNotExists(request));\n }",
"class_method_signature": "CheckAndSetQueries.getQueryForRequest(CheckAndSetRequest request)",
"constructor"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_93 | {
"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 shouldBeUnhealthyIfAllNodesPingedSuccessfully() {\n List<HealthCheckPinger> leaders = getHealthCheckPingers(ALL_CLIENTS, ALL_CLIENTS, ALL_CLIENTS);\n\n SetMultimap<TimeLockStatus, Client> expected = ImmutableSetMultimap.<TimeLockStatus, Client>builder()\n ... | {
"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_149 | {
"fields": [
{
"declarator": "CLIENT_A = \"a-client\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT_A = \"a-client\";",
"type": "String",
"var_name": "CLIENT_A"
},
{
"declarator": "CLIENT_B = \"b-client\"",
"modifier... | {
"body": "@Test\n public void canDynamicallyIncreaseMaxAllowedClients() {\n createMaximumNumberOfClients();\n\n when(maxNumberOfClientsSupplier.get()).thenReturn(DEFAULT_MAX_NUMBER_OF_CLIENTS + 1);\n\n namespaces.get(uniqueClient());\n }",
"class_method_signature": "TimelockNamespacesTes... | {
"fields": [
{
"declarator": "ACTIVE_CLIENTS = \"activeClients\"",
"modifier": "@VisibleForTesting static final",
"original_string": "@VisibleForTesting static final String ACTIVE_CLIENTS = \"activeClients\";",
"type": "String",
"var_name": "ACTIVE_CLIENTS"
},
{
"decla... | {
"body": "public TimeLockServices get(String namespace) {\n return services.computeIfAbsent(namespace, this::createNewClient);\n }",
"class_method_signature": "TimelockNamespaces.get(String namespace)",
"constructor": false,
"full_signature": "public TimeLockServices get(String namespace)",
"identi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_519 | {
"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 consistentNormalBatchesAfterFullBatchesGravitatesTowardsInitialPause() {\n sweepTwentyIterationsWithResult(SUCCESS_TOO_SLOW);\n sweepTwentyIterationsWithResult(SUCCESS);\n long nextPause = delay.getNextPause(SUCCESS);\n assertThat(nextPause).isGreaterThanO... | {
"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_630 | {
"fields": [
{
"declarator": "timelockService = mock(TimelockService.class)",
"modifier": "private final",
"original_string": "private final TimelockService timelockService = mock(TimelockService.class);",
"type": "TimelockService",
"var_name": "timelockService"
},
{
"... | {
"body": "@Test\n public void shouldRethrowExceptionIfLockIsValid() throws Exception {\n Exception exception = new IllegalStateException();\n when(delegate.execute(transaction)).thenThrow(exception);\n assertThatThrownBy(() -> wrappingTask.execute(transaction)).isEqualTo(exception);\n }",
... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final TransactionTask<T, E> delegate;",
"type": "TransactionTask<T, E>",
"var_name": "delegate"
},
{
"declarator": "timelockService",
"modifier": "private final",
... | {
"body": "@Override public T execute(Transaction transaction) throws E {\n try {\n return delegate.execute(transaction);\n } catch (Exception ex) {\n if (shouldRethrowWithoutLockValidation(ex) || immutableTsLockIsValid()) {\n throw ex;\n }\n th... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_260 | {
"fields": [
{
"declarator": "SHORT_NAME = \"shortName\"",
"modifier": "private static final",
"original_string": "private static final String SHORT_NAME = \"shortName\";",
"type": "String",
"var_name": "SHORT_NAME"
},
{
"declarator": "LONG_NAME = \"longName\"",
... | {
"body": "@Test\n public void nameIsNotLoggableByDefault() {\n assertThat(LOGGABILITY_UNSPECIFIED_DESCRIPTION.getLogSafety()).isEqualTo(LogSafety.UNSAFE);\n }",
"class_method_signature": "NamedColumnDescriptionTest.nameIsNotLoggableByDefault()",
"constructor": false,
"full_signature": "@Test publi... | {
"fields": [
{
"declarator": "shortName",
"modifier": "final",
"original_string": "final String shortName;",
"type": "String",
"var_name": "shortName"
},
{
"declarator": "longName",
"modifier": "final",
"original_string": "final String longName;",
"ty... | {
"body": "public LogSafety getLogSafety() {\n return logSafety;\n }",
"class_method_signature": "NamedColumnDescription.getLogSafety()",
"constructor": false,
"full_signature": "public LogSafety getLogSafety()",
"identifier": "getLogSafety",
"invocations": [],
"modifiers": "public",
"paramete... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_775 | {
"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 checkAndSetIsUpdateIfEqualIfExpectedIsNotNull() {\n CqlQuery query = CassandraTimestampUtils.constructCheckAndSetMultipleQuery(\n ImmutableMap.of(COLUMN_NAME_1, Pair.create(VALUE_1, VALUE_2)));\n assertThat(query.toString()).contains(\"UPDATE\").contains(... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraTimestampUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraTimestampUtils.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static CqlQuery constructCheckAndSetMultipleQuery(Map<String, Pair<byte[], byte[]>> checkAndSetRequest) {\n ImmutableCqlSinglePartitionBatchQuery.Builder batchQueryBuilder = CqlSinglePartitionBatchQuery.builder();\n checkAndSetRequest.forEach((columnName, value) ->\n bat... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_325 | {
"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 canSpecifyItemsAsLoggable() {\n ImmutableSafeLoggableData.Builder builder = ImmutableSafeLoggableData.builder();\n SafeLoggableDataUtils.addLoggableNamesToBuilder(builder, TABLE_REFERENCE_1, TABLE_METADATA_2);\n SafeLoggableData safeLoggableData = builder.build()... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SafeLoggableDataUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SafeLoggableDataUtils.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@VisibleForTesting\n static void addLoggableNamesToBuilder(\n ImmutableSafeLoggableData.Builder builder,\n TableReference ref,\n TableMetadata tableMetadata) {\n if (IS_SAFE.test(tableMetadata.getNameLogSafety())) {\n builder.addPermittedTableReferences... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_831 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/cassandra/CassandraCellLoadingConfigTest.java",
"identifier": "CassandraCellLoadingConfigTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void cannotCreateConfigWithNonPositiveCrossColumnLoadBatchLimit() {\n assertThatThrownBy(() -> CassandraCellLoadingConfig.of(-31, 4159))\n .isInstanceOf(IllegalStateException.class)\n .hasMessageContaining(\"crossColumnLoadBatchLimit should be positive... | {
"fields": [],
"file": "atlasdb-cassandra/src/main/java/com/palantir/atlasdb/cassandra/CassandraCellLoadingConfig.java",
"identifier": "CassandraCellLoadingConfig",
"interfaces": "",
"methods": [
{
"class_method_signature": "CassandraCellLoadingConfig.crossColumnLoadBatchLimit()",
"constructo... | {
"body": "static CassandraCellLoadingConfig of(int crossColumnLoadBatchLimit, int singleQueryLoadBatchLimit) {\n return ImmutableCassandraCellLoadingConfig.builder()\n .crossColumnLoadBatchLimit(crossColumnLoadBatchLimit)\n .singleQueryLoadBatchLimit(singleQueryLoadBatchLimit)\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_132 | {
"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 migrateOnlyMigratesMostRecentVersions() {\n fromKvs.createTables(TEST_AND_CHECKPOINT_TABLES);\n fromTxManager.runTaskWithRetry(tx -> {\n tx.put(TEST_TABLE, ImmutableMap.of(TEST_CELL, TEST_VALUE1));\n tx.put(TEST_TABLE, ImmutableMap.of(TEST_CELL2, T... | {
"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_562 | {
"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 sleepsForCompactDurationIfGreaterThanMinimumAndNothingToCompact() {\n assertThat(BackgroundCompactor.getSleepTime(\n () -> ImmutableCompactorConfig.builder()\n .from(COMPACTOR_CONFIG)\n .compactPauseMillis(COMPACT_MI... | {
"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_427 | {
"fields": [
{
"declarator": "LOW_START_TS = 6L",
"modifier": "private static final",
"original_string": "private static final long LOW_START_TS = 6L;",
"type": "long",
"var_name": "LOW_START_TS"
},
{
"declarator": "LOW_COMMIT_TS = 7L",
"modifier": "private stati... | {
"body": "@Test\n public void thorough_getTimestampsToSweep_oneTransaction_emptyValue_returnsIt() {\n List<CandidateCellForSweeping> candidate = ImmutableList.of(\n ImmutableCandidateCellForSweeping.builder()\n .cell(SINGLE_CELL)\n .sortedTimestamps(Immu... | {
"fields": [
{
"declarator": "commitTsCache",
"modifier": "private final",
"original_string": "private final CommitTsCache commitTsCache;",
"type": "CommitTsCache",
"var_name": "commitTsCache"
},
{
"declarator": "sweeper",
"modifier": "private final",
"orig... | {
"body": "public BatchOfCellsToSweep getCellsToSweep(List<CandidateCellForSweeping> candidates) {\n Map<Long, Long> startToCommitTs = commitTsCache.loadBatch(getAllValidTimestamps(candidates));\n ImmutableBatchOfCellsToSweep.Builder builder = ImmutableBatchOfCellsToSweep.builder();\n long numCel... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_974 | {
"fields": [
{
"declarator": "LOCK_IMMUTABLE_TIMESTAMP_RESPONSE =\n LockImmutableTimestampResponse.of(1L, LockToken.of(UUID.randomUUID()))",
"modifier": "private static final",
"original_string": "private static final LockImmutableTimestampResponse LOCK_IMMUTABLE_TIMESTAMP_RESPONSE =... | {
"body": "@Test\n public void getFreshTimestampsShouldFail() {\n TimestampRange timestampRange = TimestampRange.createInclusiveRange(1, 2);\n when(rawTimelockService.getFreshTimestamps(anyInt())).thenReturn(timestampRange);\n\n assertThrowsOnSecondCall(() -> timelockService.getFreshTimestamps... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TimestampCorroboratingTimelockService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TimestampCorroboratingTimelockService.class);",
"type": "Logger",
... | {
"body": "@Override\n public TimestampRange getFreshTimestamps(int numTimestampsRequested) {\n return checkAndUpdateLowerBound(() -> delegate.getFreshTimestamps(numTimestampsRequested),\n TimestampRange::getLowerBound,\n TimestampRange::getUpperBound,\n Operatio... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_50 | {
"fields": [
{
"declarator": "SEVENTY_THREE = 73L",
"modifier": "private static final",
"original_string": "private static final long SEVENTY_THREE = 73L;",
"type": "long",
"var_name": "SEVENTY_THREE"
},
{
"declarator": "EIGHTY_TWO = 82L",
"modifier": "private st... | {
"body": "@Test\n public void throwsIfModulusIsZero() {\n assertThatThrownBy(() -> getPartitionedTimestamps(SEVENTY_THREE_TO_EIGHTY_TWO, 0, 0))\n .isInstanceOf(IllegalArgumentException.class)\n .hasMessage(\"Modulus should be positive, but found 0.\");\n }",
"class_method... | {
"fields": [],
"file": "timestamp-impl/src/main/java/com/palantir/timestamp/TimestampRanges.java",
"identifier": "TimestampRanges",
"interfaces": "",
"methods": [
{
"class_method_signature": "TimestampRanges.TimestampRanges()",
"constructor": true,
"full_signature": "private TimestampR... | {
"body": "public static PartitionedTimestamps getPartitionedTimestamps(TimestampRange range, int residue, int modulus) {\n checkModulusAndResidue(residue, modulus);\n\n long startTimestamp = getLowestTimestampMatchingModulus(range.getLowerBound(), residue, modulus);\n long endTimestamp = range.g... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_535 | {
"fields": [
{
"declarator": "VALID_START_TIMESTAMP = 100L",
"modifier": "private static final",
"original_string": "private static final Long VALID_START_TIMESTAMP = 100L;",
"type": "Long",
"var_name": "VALID_START_TIMESTAMP"
},
{
"declarator": "VALID_COMMIT_TIMESTAMP... | {
"body": "@Test\n public void loadShouldPutRollbackIfCommitTsIsNull() throws Exception {\n AtomicLong answerCount = new AtomicLong();\n\n doAnswer((invocation) -> answerCount.get() > 0 ? ROLLBACK_TIMESTAMP : NO_TIMESTAMP)\n .when(mockTransactionService).get(VALID_START_TIMESTAMP);\n\n... | {
"fields": [
{
"declarator": "ONE_MILLION = 1_000_000L",
"modifier": "private static final",
"original_string": "private static final Long ONE_MILLION = 1_000_000L;",
"type": "Long",
"var_name": "ONE_MILLION"
},
{
"declarator": "cache",
"modifier": "private",
... | {
"body": "public long load(long startTs) {\n return cache.get(startTs);\n }",
"class_method_signature": "CommitTsCache.load(long startTs)",
"constructor": false,
"full_signature": "public long load(long startTs)",
"identifier": "load",
"invocations": [
"get"
],
"modifiers": "public",
"p... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_165 | {
"fields": [
{
"declarator": "RESIDUE_ONE = ImmutableList.of(1)",
"modifier": "private static final",
"original_string": "private static final List<Integer> RESIDUE_ONE = ImmutableList.of(1);",
"type": "List<Integer>",
"var_name": "RESIDUE_ONE"
},
{
"declarator": "RESI... | {
"body": "@Test\n public void batchedTimestampCallMakesRequestsAgainIfTimestampRangeDoesNotIncludeCorrectModuli() {\n when(allocator.getRelevantModuli(UUID_TWO)).thenReturn(RESIDUE_TWO);\n when(timestamps.getFreshTimestamps(anyInt()))\n .thenReturn(TIMESTAMP_SEVEN)\n .t... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DelegatingClientAwareManagedTimestampService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(DelegatingClientAwareManagedTimestampService.class);",
"type"... | {
"body": "@Override\n public PartitionedTimestamps getFreshTimestampsForClient(UUID clientIdentifier, int numTransactionsRequested) {\n while (true) {\n TimestampRange timestampRange = delegate.getFreshTimestamps(NUM_PARTITIONS * numTransactionsRequested);\n int targetResidue = alloca... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_866 | {
"fields": [
{
"declarator": "TEST_MESSAGE = \"test_message\"",
"modifier": "private static final",
"original_string": "private static final String TEST_MESSAGE = \"test_message\";",
"type": "String",
"var_name": "TEST_MESSAGE"
},
{
"declarator": "executor = Executors.... | {
"body": "@Test\n public void listenableFutureMethodsDoNotBlockWhenNotLeading() throws ExecutionException, InterruptedException {\n ReturnsListenableFutureImpl listenableFuture = new ReturnsListenableFutureImpl();\n ReturnsListenableFuture proxy =\n AwaitingLeadershipProxy.newProxyIns... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AwaitingLeadershipProxy.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AwaitingLeadershipProxy.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static <U> U newProxyInstance(Class<U> interfaceClass,\n Supplier<U> delegateSupplier,\n LeaderElectionService leaderElectionService) {\n AwaitingLeadershipProxy<U> proxy = new AwaitingLeadershipProxy<>(\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_889 | {
"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 shouldOnlyCallIdentifiedTimeIfLeaseIsValid() {\n LeasedLockToken validToken = LeasedLockToken.of(LOCK_TOKEN, getLease());\n when(timelock.leaderTime()).thenReturn(getIdentifiedTime());\n lockLeaseService.refreshLockLeases(ImmutableSet.of(validToken));\n\n ... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final NamespacedConjureTimelockService delegate;",
"type": "NamespacedConjureTimelockService",
"var_name": "delegate"
},
{
"declarator": "clientId",
"modifier": "pri... | {
"body": "Set<LockToken> refreshLockLeases(Set<LockToken> uncastedTokens) {\n if (uncastedTokens.isEmpty()) {\n return uncastedTokens;\n }\n\n LeaderTime leaderTime = time.get();\n Set<LeasedLockToken> allTokens = leasedTokens(uncastedTokens);\n\n Set<LeasedLockToken> va... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_923 | {
"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 logsOnlyOnceEvenIfManyRequestsAreSlow() {\n for (int i = 0; i < 100; i++) {\n accumulateLogsWithCall(LONG_DURATION, profilingTimelockService::lockImmutableTimestamp);\n }\n\n flushLogsWithCall(SHORT_DURATION, () -> profilingTimelockService.startIdentif... | {
"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 List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) {\n return runTaskTimed(\"startIdentifiedAtlasDbTransactionBatch\",\n () -> delegate.startIdentifiedAtlasDbTransactionBatch(count));\n }",
"class_method_signatu... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_470 | {
"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 exceptionalIterationsDoNotAffectPause() throws Exception {\n SweepDelay sweepDelay = new SweepDelay(100L);\n ScalingSweepTaskScheduler schedulerWithRealDelay = createScheduler(sweepDelay);\n when(sweepIteration.call()).thenReturn(\n SweepIterationR... | {
"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_309 | {
"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 truncateTables() throws Exception {\n kvs.truncateTables(ImmutableSet.of(TABLE_REF));\n\n checkSpan(\"atlasdb-kvs.truncateTables([{table}])\");\n verify(delegate).truncateTables(ImmutableSet.of(TABLE_REF));\n verifyNoMoreInteractions(delegate);\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 truncateTables(Set<TableReference> tableRefs) {\n //noinspection unused - try-with-resources closes trace\n try (CloseableTrace trace = startLocalTrace(\"truncateTables({})\",\n LoggingArgs.safeTablesOrPlaceholder(tableRefs))) {\n 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_759 | {
"fields": [
{
"declarator": "DENSELY_ACCESSED_WIDE_ROWS_METADATA\n = TableMetadata.internal().denselyAccessedWideRows(true).build()",
"modifier": "private static final",
"original_string": "private static final TableMetadata DENSELY_ACCESSED_WIDE_ROWS_METADATA\n = TableMe... | {
"body": "@Test\n public void tablesWithDenselyAccessedWideRowsAlwaysHaveLowBloomFilterFpChance() {\n assertThat(CassandraTableOptions.bloomFilterFpChance(DENSELY_ACCESSED_WIDE_ROWS_METADATA))\n .isEqualTo(CassandraConstants.DENSELY_ACCESSED_WIDE_ROWS_BLOOM_FILTER_FP_CHANCE);\n assert... | {
"fields": [],
"file": "atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraTableOptions.java",
"identifier": "CassandraTableOptions",
"interfaces": "",
"methods": [
{
"class_method_signature": "CassandraTableOptions.CassandraTableOptions()",
"constructor": true,
... | {
"body": "static double bloomFilterFpChance(TableMetadata tableMetadata) {\n if (tableMetadata.hasDenselyAccessedWideRows()) {\n return CassandraConstants.DENSELY_ACCESSED_WIDE_ROWS_BLOOM_FILTER_FP_CHANCE;\n }\n if (tableMetadata.isAppendHeavyAndReadLight()) {\n return tabl... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_870 | {
"fields": [],
"file": "timelock-corruption-detection/src/test/java/com/palantir/timelock/history/util/UseCaseUtilsTest.java",
"identifier": "UseCaseUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void parsesUseCasesWithMultipleDelimiters() {\n assertThat(UseCaseUtils.getPaxosUseCasePrefix(\"a!b!c!d\")).isEqualTo(\"a!b!c\");\n assertThat(UseCaseUtils.getPaxosUseCasePrefix(\"!!!!!!!\")).isEqualTo(\"!!!!!!\");\n }",
"class_method_signature": "UseCaseUtilsTest.parse... | {
"fields": [
{
"declarator": "PATTERN = Pattern.compile(\"^(.*)!(.*)$\")",
"modifier": "private static final",
"original_string": "private static final Pattern PATTERN = Pattern.compile(\"^(.*)!(.*)$\");",
"type": "Pattern",
"var_name": "PATTERN"
}
],
"file": "timelock-corru... | {
"body": "public static String getPaxosUseCasePrefix(String useCase) {\n Matcher matcher = PATTERN.matcher(useCase);\n Preconditions.checkState(matcher.find(),\n \"Unexpected use case format\", SafeArg.of(\"useCase\", useCase));\n return matcher.group(1);\n }",
"class_method_... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_489 | {
"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 sweepProgressesAndSkipsEmptyFinePartitions() {\n setSweepTimestamp(minTsForFinePartition(2 * (2 * readBatchSize) + 2));\n List<Integer> permittedPartitions = Lists.newArrayList();\n for (int index = 0; index <= 2 * readBatchSize; index++) {\n int parti... | {
"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_173 | {
"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 timestampsBeginFromZero() {\n assertThat(store.getUpperLimit()).isEqualTo(0L);\n }",
"class_method_signature": "PaxosTimestampBoundStoreTest.timestampsBeginFromZero()",
"constructor": false,
"full_signature": "@Test public void timestampsBeginFromZero()",
"identifie... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PaxosTimestampBoundStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PaxosTimestampBoundStore.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public synchronized long getUpperLimit() {\n List<PaxosLong> responses = getLatestSequenceNumbersFromAcceptors();\n PaxosLong max = Ordering.natural().onResultOf(PaxosLong::getValue).max(responses);\n agreedState = getAgreedState(max.getValue());\n return agreedSt... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_523 | {
"fields": [
{
"declarator": "SWEEP_TIMESTAMP = 3141592L",
"modifier": "private static final",
"original_string": "private static final long SWEEP_TIMESTAMP = 3141592L;",
"type": "long",
"var_name": "SWEEP_TIMESTAMP"
},
{
"declarator": "PROGRESS_TIMESTAMP = 16180L",
... | {
"body": "@Test\n public void initiallyAcceptsAdditionalBatches() {\n assertThat(accumulator.shouldAcceptAdditionalBatch()).isTrue();\n }",
"class_method_signature": "SweepBatchAccumulatorTest.initiallyAcceptsAdditionalBatches()",
"constructor": false,
"full_signature": "@Test public void initiall... | {
"fields": [
{
"declarator": "accumulatedWrites = Lists.newArrayList()",
"modifier": "private final",
"original_string": "private final List<WriteInfo> accumulatedWrites = Lists.newArrayList();",
"type": "List<WriteInfo>",
"var_name": "accumulatedWrites"
},
{
"declarat... | {
"body": "boolean shouldAcceptAdditionalBatch() {\n return accumulatedWrites.size() < SweepQueueUtils.SWEEP_BATCH_SIZE\n && nextBatchAvailable\n && progressTimestamp < (sweepTimestamp - 1);\n }",
"class_method_signature": "SweepBatchAccumulator.shouldAcceptAdditionalBatch()"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_46 | {
"fields": [
{
"declarator": "SEVENTY_THREE = 73L",
"modifier": "private static final",
"original_string": "private static final long SEVENTY_THREE = 73L;",
"type": "long",
"var_name": "SEVENTY_THREE"
},
{
"declarator": "EIGHTY_TWO = 82L",
"modifier": "private st... | {
"body": "@Test\n public void canGetTimestampsFromRangeInTheMiddle() {\n assertThat(getPartitionedTimestamps(SEVENTY_THREE_TO_EIGHTY_TWO, 7, 10))\n .containsExactly(77L);\n assertThat(getPartitionedTimestamps(SEVENTY_THREE_TO_EIGHTY_TWO, 8, 10))\n .containsExactly(78L);... | {
"fields": [],
"file": "timestamp-impl/src/main/java/com/palantir/timestamp/TimestampRanges.java",
"identifier": "TimestampRanges",
"interfaces": "",
"methods": [
{
"class_method_signature": "TimestampRanges.TimestampRanges()",
"constructor": true,
"full_signature": "private TimestampR... | {
"body": "public static PartitionedTimestamps getPartitionedTimestamps(TimestampRange range, int residue, int modulus) {\n checkModulusAndResidue(residue, modulus);\n\n long startTimestamp = getLowestTimestampMatchingModulus(range.getLowerBound(), residue, modulus);\n long endTimestamp = range.g... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_466 | {
"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 whenDisabledOnLastTaskRescheduleAfterBackoff() throws Exception {\n when(sweepIteration.call()).thenReturn(SweepIterationResults.disabled());\n\n schedulerWithDelay.start(10);\n runSweepIterations(1 + 9, SweepDelay.BACKOFF);\n verify(sweepIteration, times(... | {
"fields": [
{
"declarator": "COOL_DOWN = Duration.ofMinutes(5L)",
"modifier": "private static final",
"original_string": "private static final Duration COOL_DOWN = Duration.ofMinutes(5L);",
"type": "Duration",
"var_name": "COOL_DOWN"
},
{
"declarator": "BATCH_CELLS_LO... | {
"body": "void start(int initialThreads) {\n for (int i = 0; i < initialThreads; i++) {\n increaseNumberOfTasks(INITIAL_DELAY);\n }\n }",
"class_method_signature": "ScalingSweepTaskScheduler.start(int initialThreads)",
"constructor": false,
"full_signature": " void start(int initial... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_935 | {
"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 returnsEmptyIfNoUserAgentsArePresent() {\n assertThat(ProtocolAwareExceptionMapper.parseProtocolVersionFromUserAgentHeader(ImmutableList.of()))\n .isEmpty();\n }",
"class_method_signature": "ProtocolAwareExceptionMapperTest.returnsEmptyIfNoUserAgentsArePres... | {
"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_574 | {
"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 throwsWhenInstallingVersionInThePast() {\n TimestampPartitioningMap<Integer> newMap = DEFAULT_INITIAL_MAPPING.copyInstallingNewValue(TIMESTAMP_2, 2);\n assertThatThrownBy(() -> newMap.copyInstallingNewValue(TIMESTAMP_1, 2))\n .isInstanceOf(IllegalArgument... | {
"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 TimestampPartitioningMap<T> copyInstallingNewValue(\n long lowerBoundForNewVersion,\n T newValue) {\n RangeAndValue<T> latestEntry = getLatestEntry();\n validateProvidedTimestampBounds(lowerBoundForNewVersion, newValue, latestEntry);\n\n ImmutableRangeMap.B... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_11 | {
"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 rejectsMetricWithDefinitivelyFalseFilterEvenWithExceptions() {\n MetricPublicationArbiter arbiter = createArbiter(ImmutableMap.of(\n METRIC_NAME_1, ImmutableSet.of(THROWING_FILTER, TRUE_RETURNING_FILTER, FALSE_RETURNING_FILTER)));\n assertThat(arbiter.tes... | {
"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_124 | {
"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 testExplicitThreadCannotAndUseSubjectFromMainThread() throws InterruptedException {\n\n final AtomicReference<List<String>> inputReference = new AtomicReference<List<String>>(null);\n final AtomicBoolean outputReference = new AtomicBoolean(false);\n\n Thread chil... | {
"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_827 | {
"fields": [
{
"declarator": "config",
"modifier": "private",
"original_string": "private CassandraKeyValueServiceConfig config;",
"type": "CassandraKeyValueServiceConfig",
"var_name": "config"
},
{
"declarator": "runtimeConfig",
"modifier": "private",
"ori... | {
"body": "@Test\n public void ifNoRuntimeConfig_resolvesToInstallConfig() {\n CassandraReloadableKvsConfig reloadableConfig = getReloadableConfigWithEmptyRuntimeConfig();\n\n boolean installConfigParam = true;\n when(config.autoRefreshNodes()).thenReturn(installConfigParam);\n assertTh... | {
"fields": [
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final CassandraKeyValueServiceConfig config;",
"type": "CassandraKeyValueServiceConfig",
"var_name": "config"
},
{
"declarator": "runtimeConfigSupplier",
"modifier": "... | {
"body": "@Override\n public boolean autoRefreshNodes() {\n return config.autoRefreshNodes();\n }",
"class_method_signature": "CassandraReloadableKvsConfig.autoRefreshNodes()",
"constructor": false,
"full_signature": "@Override public boolean autoRefreshNodes()",
"identifier": "autoRefreshNodes"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_962 | {
"fields": [
{
"declarator": "BACKUP_TIMESTAMP = 42",
"modifier": "private static final",
"original_string": "private static final long BACKUP_TIMESTAMP = 42;",
"type": "long",
"var_name": "BACKUP_TIMESTAMP"
},
{
"declarator": "EXCEPTION = new RuntimeException()",
... | {
"body": "@Test\n public void invalidationDoesNotProceedIfTimelockPingUnsuccessful() {\n when(timestampManagementService.ping()).thenThrow(EXCEPTION);\n\n TimeLockMigrator migrator = TimeLockMigrator.create(timestampManagementService, invalidator);\n assertThatThrownBy(migrator::migrate).isIn... | {
"fields": [
{
"declarator": "source",
"modifier": "private final",
"original_string": "private final TimestampStoreInvalidator source;",
"type": "TimestampStoreInvalidator",
"var_name": "source"
},
{
"declarator": "destination",
"modifier": "private final",
... | {
"body": "public static TimeLockMigrator create(\n TimestampManagementService timestampManagementService,\n TimestampStoreInvalidator invalidator) {\n return create(timestampManagementService, invalidator, AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC);\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_431 | {
"fields": [
{
"declarator": "INITIAL_TIMESTAMP = SweepQueueUtils.INITIAL_TIMESTAMP",
"modifier": "private static final",
"original_string": "private static final long INITIAL_TIMESTAMP = SweepQueueUtils.INITIAL_TIMESTAMP;",
"type": "long",
"var_name": "INITIAL_TIMESTAMP"
},
... | {
"body": "@Test\n public void canReadInitialNumberOfShards() {\n assertThat(progress.getNumberOfShards()).isEqualTo(AtlasDbConstants.DEFAULT_SWEEP_QUEUE_SHARDS);\n }",
"class_method_signature": "ShardProgressTest.canReadInitialNumberOfShards()",
"constructor": false,
"full_signature": "@Test publi... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ShardProgress.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ShardProgress.class);",
"type": "Logger",
"var_name": "log"
},
{
"declar... | {
"body": "public int getNumberOfShards() {\n return maybeGet(SHARD_COUNT_SAS).map(Long::intValue).orElse(AtlasDbConstants.DEFAULT_SWEEP_QUEUE_SHARDS);\n }",
"class_method_signature": "ShardProgress.getNumberOfShards()",
"constructor": false,
"full_signature": "public int getNumberOfShards()",
"iden... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_348 | {
"fields": [
{
"declarator": "DATA_SIZE = 4",
"modifier": "private static final",
"original_string": "private static final int DATA_SIZE = 4;",
"type": "int",
"var_name": "DATA_SIZE"
},
{
"declarator": "DATA_SIZE_PLUS_ONE = 5",
"modifier": "private static final",... | {
"body": "@Test(expected = IndexOutOfBoundsException.class)\n public void cantReadMoreThanArrayLength() throws IOException {\n dataStream.read(data, 0, 10);\n }",
"class_method_signature": "BlockConsumingInputStreamTest.cantReadMoreThanArrayLength()",
"constructor": false,
"full_signature": "@Test... | {
"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_718 | {
"fields": [],
"file": "atlasdb-commons/src/test/java/com/palantir/common/base/BatchingVisitablesTest.java",
"identifier": "BatchingVisitablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSkip() {\n BatchingVisitable<Long> visitor = ListVisitor.create(Lists.newArrayList(0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L));\n ImmutableList<Long> copy = BatchingVisitableView.of(visitor).skip(5).immutableCopy();\n assertEquals(\"unexpected list remnants after skippi... | {
"fields": [
{
"declarator": "DEFAULT_BATCH_SIZE = 1000",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_BATCH_SIZE = 1000;",
"type": "int",
"var_name": "DEFAULT_BATCH_SIZE"
},
{
"declarator": "KEEP_ALL_BATCH_SIZE = 100000",
... | {
"body": "public static <T> BatchingVisitableView<T> skip(final BatchingVisitable<T> visitable, final long toSkip) {\n com.palantir.logsafe.Preconditions.checkNotNull(visitable);\n com.palantir.logsafe.Preconditions.checkArgument(toSkip >= 0);\n if (toSkip == 0) {\n return BatchingVis... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_349 | {
"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 canReadSingleByte() throws IOException {\n int byteAsInt = dataStream.read();\n byte[] readByte = { (byte) byteAsInt };\n assertEquals(\"d\", new String(readByte, StandardCharsets.UTF_8));\n }",
"class_method_signature": "BlockConsumingInputStreamTest.canRea... | {
"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_719 | {
"fields": [],
"file": "atlasdb-commons/src/test/java/com/palantir/common/base/BatchingVisitablesTest.java",
"identifier": "BatchingVisitablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testVisitWhile() {\n List<Long> longList = Lists.newArrayList(0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L);\n BatchingVisitable<Long> visitable = ListVisitor.create(longList);\n BatchingVisitableView<Long> view = BatchingVisitables.visitWhile(\n Batchin... | {
"fields": [
{
"declarator": "DEFAULT_BATCH_SIZE = 1000",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_BATCH_SIZE = 1000;",
"type": "int",
"var_name": "DEFAULT_BATCH_SIZE"
},
{
"declarator": "KEEP_ALL_BATCH_SIZE = 100000",
... | {
"body": "public static <T> BatchingVisitableView<T> visitWhile(final BatchingVisitable<T> visitable,\n final Predicate<T> condition) {\n return BatchingVisitableView.of(new AbstractBatchingVisitable<T>() {\n @Override\n protected <K extends Exception> void batchAcceptSizeHint... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_10 | {
"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 exceptionTreatedAsNotFiltered() {\n MetricPublicationArbiter arbiter = createArbiter(ImmutableMap.of(\n METRIC_NAME_1, ImmutableSet.of(THROWING_FILTER)));\n assertThat(arbiter.test(METRIC_NAME_1)).isTrue();\n }",
"class_method_signature": "MetricPubl... | {
"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_575 | {
"fields": [
{
"declarator": "INTERNAL_SCHEMA_METADATA = InternalSchemaMetadata.builder()\n .timestampToTransactionsTableSchemaVersion(\n TimestampPartitioningMap.of(\n ImmutableRangeMap.<Long, Integer>builder()\n .... | {
"body": "@Test\n public void cannotDeserializeUnknownVersionOfMetadata() {\n assertThatThrownBy(() ->\n InternalSchemaMetadataPayloadCodec.decode(ImmutableVersionedInternalSchemaMetadata.builder()\n .version(8377466)\n .payload(new byte[] {1, 2,... | {
"fields": [
{
"declarator": "LATEST_VERSION = 1",
"modifier": "public static final",
"original_string": "public static final int LATEST_VERSION = 1;",
"type": "int",
"var_name": "LATEST_VERSION"
},
{
"declarator": "SUPPORTED_DECODERS =\n ImmutableMap.of(LAT... | {
"body": "static InternalSchemaMetadata decode(VersionedInternalSchemaMetadata versionedInternalSchemaMetadata) {\n return tryDecode(versionedInternalSchemaMetadata)\n .orElseThrow(() -> new SafeIllegalStateException(\"Could not decode persisted internal schema metadata -\"\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_125 | {
"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 setupMigratorFastForwardsTimestamp() {\n fromServices.getManagedTimestampService().fastForwardTimestamp(FUTURE_TIMESTAMP);\n assertThat(toServices.getManagedTimestampService().getFreshTimestamp()).isLessThan(FUTURE_TIMESTAMP);\n\n KeyValueServiceMigrators.setupMi... | {
"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_826 | {
"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 firstConfigInvalidShouldResolveToDefault() {\n CassandraKeyValueServiceRuntimeConfig returnedConfig = new CassandraAtlasDbFactory()\n .preprocessKvsRuntimeConfig(() -> Optional.of(INVALID_CKVS_RUNTIME_CONFIG))\n .get();\n\n assertEquals(\"F... | {
"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 Supplier<CassandraKeyValueServiceRuntimeConfig> preprocessKvsRuntimeConfig(\n Supplier<Optional<KeyValueServiceRuntimeConfig>> runtimeConfig) {\n return () -> {\n Optional<KeyValueServiceRuntimeConfig> configOptional = runtimeConfig.get();\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_963 | {
"fields": [
{
"declarator": "BACKUP_TIMESTAMP = 42",
"modifier": "private static final",
"original_string": "private static final long BACKUP_TIMESTAMP = 42;",
"type": "long",
"var_name": "BACKUP_TIMESTAMP"
},
{
"declarator": "EXCEPTION = new RuntimeException()",
... | {
"body": "@Test\n public void migrationDoesNotProceedIfInvalidationFails() {\n when(invalidator.backupAndInvalidate()).thenThrow(new IllegalStateException());\n\n TimeLockMigrator migrator = TimeLockMigrator.create(timestampManagementService, invalidator);\n assertThatThrownBy(migrator::migra... | {
"fields": [
{
"declarator": "source",
"modifier": "private final",
"original_string": "private final TimestampStoreInvalidator source;",
"type": "TimestampStoreInvalidator",
"var_name": "source"
},
{
"declarator": "destination",
"modifier": "private final",
... | {
"body": "public static TimeLockMigrator create(\n TimestampManagementService timestampManagementService,\n TimestampStoreInvalidator invalidator) {\n return create(timestampManagementService, invalidator, AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC);\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_430 | {
"fields": [
{
"declarator": "LOW_START_TS = 6L",
"modifier": "private static final",
"original_string": "private static final long LOW_START_TS = 6L;",
"type": "long",
"var_name": "LOW_START_TS"
},
{
"declarator": "LOW_COMMIT_TS = 7L",
"modifier": "private stati... | {
"body": "@Test\n public void testTwoCandidates() {\n long sweepTimestampHigherThanCommitTimestamp = HIGH_COMMIT_TS + 1;\n CandidateCellForSweeping snd = ImmutableCandidateCellForSweeping.builder()\n .cell(ANOTHER_CELL)\n .sortedTimestamps(ImmutableList.of(HIGH_START_TS... | {
"fields": [
{
"declarator": "commitTsCache",
"modifier": "private final",
"original_string": "private final CommitTsCache commitTsCache;",
"type": "CommitTsCache",
"var_name": "commitTsCache"
},
{
"declarator": "sweeper",
"modifier": "private final",
"orig... | {
"body": "public BatchOfCellsToSweep getCellsToSweep(List<CandidateCellForSweeping> candidates) {\n Map<Long, Long> startToCommitTs = commitTsCache.loadBatch(getAllValidTimestamps(candidates));\n ImmutableBatchOfCellsToSweep.Builder builder = ImmutableBatchOfCellsToSweep.builder();\n long numCel... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_871 | {
"fields": [
{
"declarator": "tempFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "tempFolder"
},
{
"declarator": "CLIEN... | {
"body": "@Test\n public void canFetchAndCombineHistoriesForLocalAndRemote() {\n Set<PaxosValue> paxosValues\n = PaxosSerializationTestUtils.writeToLogs(acceptorLog, learnerLog, 1, 100);\n\n int lastVerified = -1;\n\n List<HistoryQuery> historyQueries = ImmutableList.of(History... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PaxosLogHistoryProvider.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PaxosLogHistoryProvider.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public List<CompletePaxosHistoryForNamespaceAndUseCase> getHistory() {\n Map<NamespaceAndUseCase, Long> lastVerifiedSequences = getNamespaceAndUseCaseToLastVerifiedSeqMap();\n\n PaxosHistoryOnSingleNode localPaxosHistory = localHistoryLoader.getLocalPaxosHistory(lastVerifiedSequences);\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_488 | {
"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 enableAutoTuningOverridesEffectivelySetsLargeReadBatchSize() {\n enableAutoTuning = true;\n\n for (int partition = 0; partition < readBatchSize * 5; partition++) {\n enqueueWriteCommitted(TABLE_CONS, minTsForFinePartition(partition + 1));\n }\n\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_172 | {
"fields": [
{
"declarator": "ADDRESS_1 = \"foo:1234\"",
"modifier": "private static final",
"original_string": "private static final String ADDRESS_1 = \"foo:1234\";",
"type": "String",
"var_name": "ADDRESS_1"
},
{
"declarator": "ADDRESS_2 = \"bar:5678\"",
"modi... | {
"body": "@Test\n public void canGetClientPaxosUris() {\n Set<String> clientPaxosUris = PaxosTimeLockUriUtils.getClientPaxosUris(ADDRESSES, CLIENT);\n\n assertThat(clientPaxosUris).containsExactlyInAnyOrder(\n String.join(\"/\",\n ADDRESS_1,\n ... | {
"fields": [],
"file": "timelock-impl/src/main/java/com/palantir/atlasdb/timelock/paxos/PaxosTimeLockUriUtils.java",
"identifier": "PaxosTimeLockUriUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PaxosTimeLockUriUtils.PaxosTimeLockUriUtils()",
"constructor": true,
"f... | {
"body": "public static Set<String> getClientPaxosUris(Set<String> addresses, String client) {\n return getNamespacedUris(\n addresses,\n PaxosTimeLockConstants.INTERNAL_NAMESPACE,\n PaxosTimeLockConstants.CLIENT_PAXOS_NAMESPACE,\n client);\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_47 | {
"fields": [
{
"declarator": "SEVENTY_THREE = 73L",
"modifier": "private static final",
"original_string": "private static final long SEVENTY_THREE = 73L;",
"type": "long",
"var_name": "SEVENTY_THREE"
},
{
"declarator": "EIGHTY_TWO = 82L",
"modifier": "private st... | {
"body": "@Test\n public void canHandleMultipleValidMatches() {\n assertThat(getPartitionedTimestamps(SEVENTY_THREE_TO_EIGHTY_TWO, 1, 2))\n .containsExactly(73L, 75L, 77L, 79L, 81L);\n\n assertThat(getPartitionedTimestamps(SEVENTY_THREE_TO_EIGHTY_TWO, 0, 2))\n .contains... | {
"fields": [],
"file": "timestamp-impl/src/main/java/com/palantir/timestamp/TimestampRanges.java",
"identifier": "TimestampRanges",
"interfaces": "",
"methods": [
{
"class_method_signature": "TimestampRanges.TimestampRanges()",
"constructor": true,
"full_signature": "private TimestampR... | {
"body": "public static PartitionedTimestamps getPartitionedTimestamps(TimestampRange range, int residue, int modulus) {\n checkModulusAndResidue(residue, modulus);\n\n long startTimestamp = getLowestTimestampMatchingModulus(range.getLowerBound(), residue, modulus);\n long endTimestamp = range.g... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_522 | {
"fields": [
{
"declarator": "SWEEP_TIMESTAMP = 3141592L",
"modifier": "private static final",
"original_string": "private static final long SWEEP_TIMESTAMP = 3141592L;",
"type": "long",
"var_name": "SWEEP_TIMESTAMP"
},
{
"declarator": "PROGRESS_TIMESTAMP = 16180L",
... | {
"body": "@Test\n public void throwsWhenAttemptingToMergeWriteInfoAfterTheSweepTimestamp() {\n assertThatThrownBy(() -> accumulator.accumulateBatch(SweepBatch.of(\n ImmutableList.of(WriteInfo.write(TABLE_REFERENCE_1, CELL_1, PROGRESS_TIMESTAMP + 5)),\n NO_DEDICATED_ROWS,\n ... | {
"fields": [
{
"declarator": "accumulatedWrites = Lists.newArrayList()",
"modifier": "private final",
"original_string": "private final List<WriteInfo> accumulatedWrites = Lists.newArrayList();",
"type": "List<WriteInfo>",
"var_name": "accumulatedWrites"
},
{
"declarat... | {
"body": "void accumulateBatch(SweepBatch sweepBatch) {\n Preconditions.checkState(sweepBatch.lastSweptTimestamp() < sweepTimestamp,\n \"Tried to accumulate a batch %s at timestamp %s that went beyond the sweep timestamp %s!\"\n + \" This is unexpected, and suggests a bug... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_467 | {
"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 whenOtherErrorRescheduleAfterMaxPause() throws Exception {\n when(sweepIteration.call()).thenReturn(\n SweepIterationResults.otherError(),\n SweepIterationResults.otherError(),\n SUCCESS_MEDIUM);\n\n schedulerWithDelay.start(... | {
"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_934 | {
"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 returnsEmptyIfNoRelevantAgentsFound() {\n assertThat(ProtocolAwareExceptionMapper.parseProtocolVersionFromUserAgentHeader(\n ImmutableList.of(UserAgents.format(USER_AGENT_1.addAgent(AGENT_1)))))\n .isEmpty();\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_308 | {
"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 truncateTable() throws Exception {\n kvs.truncateTable(TABLE_REF);\n\n checkSpan(\"atlasdb-kvs.truncateTable({table})\");\n verify(delegate).truncateTable(TABLE_REF);\n verifyNoMoreInteractions(delegate);\n }",
"class_method_signature": "TracingKeyVal... | {
"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 truncateTable(TableReference tableRef) {\n //noinspection unused - try-with-resources closes trace\n try (CloseableTrace trace = startLocalTrace(\"truncateTable({})\",\n LoggingArgs.safeTableOrPlaceholder(tableRef))) {\n delegate().truncate... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_758 | {
"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 differentRfThanConfigThrows() {\n KsDef ksDef = new KsDef(\"test\", CassandraConstants.SIMPLE_STRATEGY, ImmutableList.of());\n ksDef.setStrategy_options(ImmutableMap.of(DC_1, \"1\", DC_2, \"2\"));\n when(config.replicationFactor()).thenReturn(1);\n assertT... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraVerifier.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraVerifier.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "static void sanityCheckReplicationFactor(KsDef ks, CassandraKeyValueServiceConfig config, Set<String> dcs) {\n checkRfsSpecified(config, dcs, ks.getStrategy_options());\n checkRfsMatchConfig(ks, config, dcs, ks.getStrategy_options());\n }",
"class_method_signature": "CassandraVerifier.sa... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_534 | {
"fields": [
{
"declarator": "VALID_START_TIMESTAMP = 100L",
"modifier": "private static final",
"original_string": "private static final Long VALID_START_TIMESTAMP = 100L;",
"type": "Long",
"var_name": "VALID_START_TIMESTAMP"
},
{
"declarator": "VALID_COMMIT_TIMESTAMP... | {
"body": "@Test\n public void loadShouldReturnTheValidTimestamp() throws Exception {\n when(mockTransactionService.get(VALID_START_TIMESTAMP))\n .thenReturn(VALID_COMMIT_TIMESTAMP);\n\n assertThat(loader.load(VALID_START_TIMESTAMP)).isEqualTo(VALID_COMMIT_TIMESTAMP);\n }",
"class... | {
"fields": [
{
"declarator": "ONE_MILLION = 1_000_000L",
"modifier": "private static final",
"original_string": "private static final Long ONE_MILLION = 1_000_000L;",
"type": "Long",
"var_name": "ONE_MILLION"
},
{
"declarator": "cache",
"modifier": "private",
... | {
"body": "public long load(long startTs) {\n return cache.get(startTs);\n }",
"class_method_signature": "CommitTsCache.load(long startTs)",
"constructor": false,
"full_signature": "public long load(long startTs)",
"identifier": "load",
"invocations": [
"get"
],
"modifiers": "public",
"p... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_51 | {
"fields": [
{
"declarator": "SEVENTY_THREE = 73L",
"modifier": "private static final",
"original_string": "private static final long SEVENTY_THREE = 73L;",
"type": "long",
"var_name": "SEVENTY_THREE"
},
{
"declarator": "EIGHTY_TWO = 82L",
"modifier": "private st... | {
"body": "@Test\n public void throwsIfResidueEqualsOrExceedsModulus() {\n assertThatThrownBy(() -> getPartitionedTimestamps(SEVENTY_THREE_TO_EIGHTY_TWO, 2, 2))\n .isInstanceOf(IllegalArgumentException.class)\n .hasMessage(\"Absolute value of residue 2 equals or exceeds modulus... | {
"fields": [],
"file": "timestamp-impl/src/main/java/com/palantir/timestamp/TimestampRanges.java",
"identifier": "TimestampRanges",
"interfaces": "",
"methods": [
{
"class_method_signature": "TimestampRanges.TimestampRanges()",
"constructor": true,
"full_signature": "private TimestampR... | {
"body": "public static PartitionedTimestamps getPartitionedTimestamps(TimestampRange range, int residue, int modulus) {\n checkModulusAndResidue(residue, modulus);\n\n long startTimestamp = getLowestTimestampMatchingModulus(range.getLowerBound(), residue, modulus);\n long endTimestamp = range.g... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_164 | {
"fields": [
{
"declarator": "RESIDUE_ONE = ImmutableList.of(1)",
"modifier": "private static final",
"original_string": "private static final List<Integer> RESIDUE_ONE = ImmutableList.of(1);",
"type": "List<Integer>",
"var_name": "RESIDUE_ONE"
},
{
"declarator": "RESI... | {
"body": "@Test\n public void batchedTimestampCallShouldReturnAtLeastOneUsableTimestamp() {\n when(allocator.getRelevantModuli(UUID_ONE)).thenReturn(RESIDUE_ONE);\n when(timestamps.getFreshTimestamps(anyInt()))\n .thenReturn(TIMESTAMP_RANGE);\n\n assertThat(service.getFreshTime... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(DelegatingClientAwareManagedTimestampService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(DelegatingClientAwareManagedTimestampService.class);",
"type"... | {
"body": "@Override\n public PartitionedTimestamps getFreshTimestampsForClient(UUID clientIdentifier, int numTransactionsRequested) {\n while (true) {\n TimestampRange timestampRange = delegate.getFreshTimestamps(NUM_PARTITIONS * numTransactionsRequested);\n int targetResidue = alloca... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_867 | {
"fields": [
{
"declarator": "TEST_MESSAGE = \"test_message\"",
"modifier": "private static final",
"original_string": "private static final String TEST_MESSAGE = \"test_message\";",
"type": "String",
"var_name": "TEST_MESSAGE"
},
{
"declarator": "executor = Executors.... | {
"body": "@Test\n public void listenableFutureMethodsDoNotBlockWhenLeading() throws InterruptedException, ExecutionException {\n ReturnsListenableFutureImpl listenableFuture = new ReturnsListenableFutureImpl();\n ReturnsListenableFuture proxy =\n AwaitingLeadershipProxy.newProxyInstan... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AwaitingLeadershipProxy.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AwaitingLeadershipProxy.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static <U> U newProxyInstance(Class<U> interfaceClass,\n Supplier<U> delegateSupplier,\n LeaderElectionService leaderElectionService) {\n AwaitingLeadershipProxy<U> proxy = new AwaitingLeadershipProxy<>(\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_888 | {
"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 unlockShouldInvalidateLease() {\n LockToken token = LeasedLockToken.of(LOCK_TOKEN, getLease());\n lockLeaseService.unlock(ImmutableSet.of(token));\n assertInvalid(token);\n }",
"class_method_signature": "LockLeaseServiceTest.unlockShouldInvalidateLease()",
... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final NamespacedConjureTimelockService delegate;",
"type": "NamespacedConjureTimelockService",
"var_name": "delegate"
},
{
"declarator": "clientId",
"modifier": "pri... | {
"body": "Set<LockToken> unlock(Set<LockToken> tokens) {\n Set<LeasedLockToken> leasedLockTokens = leasedTokens(tokens);\n leasedLockTokens.forEach(LeasedLockToken::invalidate);\n\n Set<ConjureLockToken> unlocked =\n delegate.unlock(ConjureUnlockRequest.of(serverTokens(leasedLockT... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_922 | {
"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 logsTheSlowestNonBannedOperationAboveThreshold() {\n accumulateLogsWithCall(LONG_DURATION, profilingTimelockService::getFreshTimestamp);\n\n flushLogsWithCall(TWO_CENTURIES,\n () -> profilingTimelockService.lock(LockRequest.of(ImmutableSet.of(StringLockDe... | {
"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 LockResponse lock(LockRequest request) {\n // Don't profile this, as it may be skewed by user contention on locks.\n tryFlushLogs();\n return delegate.lock(request);\n }",
"class_method_signature": "ProfilingTimelockService.lock(LockRequest request)",
"cons... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_471 | {
"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 conservativeSweepAddsSentinelAndLeavesSingleValue() {\n enqueueWriteCommitted(TABLE_CONS, LOW_TS);\n assertReadAtTimestampReturnsNothing(TABLE_CONS, LOW_TS);\n\n sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD));\n assertReadAtTimestampReturnsSenti... | {
"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_830 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/cassandra/CassandraCellLoadingConfigTest.java",
"identifier": "CassandraCellLoadingConfigTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void canCreateConfigWithCrossColumnBatchingDisabled() {\n assertThatCode(() -> CassandraCellLoadingConfig.of(1, 100)).doesNotThrowAnyException();\n }",
"class_method_signature": "CassandraCellLoadingConfigTest.canCreateConfigWithCrossColumnBatchingDisabled()",
"constructor":... | {
"fields": [],
"file": "atlasdb-cassandra/src/main/java/com/palantir/atlasdb/cassandra/CassandraCellLoadingConfig.java",
"identifier": "CassandraCellLoadingConfig",
"interfaces": "",
"methods": [
{
"class_method_signature": "CassandraCellLoadingConfig.crossColumnLoadBatchLimit()",
"constructo... | {
"body": "static CassandraCellLoadingConfig of(int crossColumnLoadBatchLimit, int singleQueryLoadBatchLimit) {\n return ImmutableCassandraCellLoadingConfig.builder()\n .crossColumnLoadBatchLimit(crossColumnLoadBatchLimit)\n .singleQueryLoadBatchLimit(singleQueryLoadBatchLimit)\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_133 | {
"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 deletedEntriesAreNotMigrated() {\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 fromTxMan... | {
"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_563 | {
"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 sleepsForAtLeastMinimumDurationIfNothingToCompact() {\n assertThat(BackgroundCompactor.getSleepTime(\n () -> ImmutableCompactorConfig.builder()\n .from(COMPACTOR_CONFIG)\n .compactPauseMillis(COMPACT_MINIMUM_PAUSE_ON... | {
"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_426 | {
"fields": [
{
"declarator": "LOW_START_TS = 6L",
"modifier": "private static final",
"original_string": "private static final long LOW_START_TS = 6L;",
"type": "long",
"var_name": "LOW_START_TS"
},
{
"declarator": "LOW_COMMIT_TS = 7L",
"modifier": "private stati... | {
"body": "@Test\n public void getTimestampsToSweep_onlyTransactionUncommitted_returnsIt() {\n List<CandidateCellForSweeping> candidate = ImmutableList.of(\n ImmutableCandidateCellForSweeping.builder()\n .cell(SINGLE_CELL)\n .sortedTimestamps(ImmutableLis... | {
"fields": [
{
"declarator": "commitTsCache",
"modifier": "private final",
"original_string": "private final CommitTsCache commitTsCache;",
"type": "CommitTsCache",
"var_name": "commitTsCache"
},
{
"declarator": "sweeper",
"modifier": "private final",
"orig... | {
"body": "public BatchOfCellsToSweep getCellsToSweep(List<CandidateCellForSweeping> candidates) {\n Map<Long, Long> startToCommitTs = commitTsCache.loadBatch(getAllValidTimestamps(candidates));\n ImmutableBatchOfCellsToSweep.Builder builder = ImmutableBatchOfCellsToSweep.builder();\n long numCel... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_975 | {
"fields": [
{
"declarator": "LOCK_IMMUTABLE_TIMESTAMP_RESPONSE =\n LockImmutableTimestampResponse.of(1L, LockToken.of(UUID.randomUUID()))",
"modifier": "private static final",
"original_string": "private static final LockImmutableTimestampResponse LOCK_IMMUTABLE_TIMESTAMP_RESPONSE =... | {
"body": "@Test\n public void startIdentifiedAtlasDbTransactionShouldFail() {\n StartIdentifiedAtlasDbTransactionResponse startIdentifiedAtlasDbTransactionResponse =\n makeResponse(1L);\n\n when(rawTimelockService.startIdentifiedAtlasDbTransactionBatch(1))\n .thenReturn... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TimestampCorroboratingTimelockService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TimestampCorroboratingTimelockService.class);",
"type": "Logger",
... | {
"body": "@Override\n public List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) {\n return checkAndUpdateLowerBound(() -> delegate.startIdentifiedAtlasDbTransactionBatch(count),\n responses -> Collections.min(getTimestampsFromResponses(responses... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_631 | {
"fields": [
{
"declarator": "timelockService = mock(TimelockService.class)",
"modifier": "private final",
"original_string": "private final TimelockService timelockService = mock(TimelockService.class);",
"type": "TimelockService",
"var_name": "timelockService"
},
{
"... | {
"body": "@Test\n public void shouldThrowTransactionLockTimeoutExceptionIfLockIsInvalid() throws Exception {\n Exception exception = new IllegalStateException();\n when(delegate.execute(transaction)).thenThrow(exception);\n\n invalidateLockTokens();\n assertThatThrownBy(() -> wrappingT... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final TransactionTask<T, E> delegate;",
"type": "TransactionTask<T, E>",
"var_name": "delegate"
},
{
"declarator": "timelockService",
"modifier": "private final",
... | {
"body": "@Override public T execute(Transaction transaction) throws E {\n try {\n return delegate.execute(transaction);\n } catch (Exception ex) {\n if (shouldRethrowWithoutLockValidation(ex) || immutableTsLockIsValid()) {\n throw ex;\n }\n th... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_261 | {
"fields": [
{
"declarator": "SHORT_NAME = \"shortName\"",
"modifier": "private static final",
"original_string": "private static final String SHORT_NAME = \"shortName\";",
"type": "String",
"var_name": "SHORT_NAME"
},
{
"declarator": "LONG_NAME = \"longName\"",
... | {
"body": "@Test\n public void nameCanBeSpecifiedToBeLoggable() {\n assertThat(NAME_LOGGABLE_DESCRIPTION.getLogSafety()).isEqualTo(LogSafety.SAFE);\n }",
"class_method_signature": "NamedColumnDescriptionTest.nameCanBeSpecifiedToBeLoggable()",
"constructor": false,
"full_signature": "@Test public vo... | {
"fields": [
{
"declarator": "shortName",
"modifier": "final",
"original_string": "final String shortName;",
"type": "String",
"var_name": "shortName"
},
{
"declarator": "longName",
"modifier": "final",
"original_string": "final String longName;",
"ty... | {
"body": "public LogSafety getLogSafety() {\n return logSafety;\n }",
"class_method_signature": "NamedColumnDescription.getLogSafety()",
"constructor": false,
"full_signature": "public LogSafety getLogSafety()",
"identifier": "getLogSafety",
"invocations": [],
"modifiers": "public",
"paramete... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_774 | {
"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 checkAndSetIsInsertIfNotExistsIfExpectedIsNull() {\n CqlQuery query = CassandraTimestampUtils.constructCheckAndSetMultipleQuery(\n ImmutableMap.of(COLUMN_NAME_1, Pair.create(null, VALUE_1)));\n assertThat(query.toString()).contains(\"INSERT\").contains(\"... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraTimestampUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraTimestampUtils.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static CqlQuery constructCheckAndSetMultipleQuery(Map<String, Pair<byte[], byte[]>> checkAndSetRequest) {\n ImmutableCqlSinglePartitionBatchQuery.Builder batchQueryBuilder = CqlSinglePartitionBatchQuery.builder();\n checkAndSetRequest.forEach((columnName, value) ->\n bat... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_324 | {
"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 nothingLoggableByDefault() {\n ImmutableSafeLoggableData.Builder builder = ImmutableSafeLoggableData.builder();\n SafeLoggableDataUtils.addLoggableNamesToBuilder(builder, TABLE_REFERENCE_1, TABLE_METADATA_1);\n SafeLoggableData safeLoggableData = builder.build();... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SafeLoggableDataUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SafeLoggableDataUtils.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@VisibleForTesting\n static void addLoggableNamesToBuilder(\n ImmutableSafeLoggableData.Builder builder,\n TableReference ref,\n TableMetadata tableMetadata) {\n if (IS_SAFE.test(tableMetadata.getNameLogSafety())) {\n builder.addPermittedTableReferences... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_92 | {
"fields": [
{
"declarator": "CLUSTER_URIS = ImmutableList.of(\"foo:1\", \"bar:2\", \"baz:3\")",
"modifier": "private static final",
"original_string": "private static final List<String> CLUSTER_URIS = ImmutableList.of(\"foo:1\", \"bar:2\", \"baz:3\");",
"type": "List<String>",
"var... | {
"body": "@Test\n public void convertAddressToUrlCreatesComponentsCorrectly_Ssl() throws MalformedURLException {\n assertThat(PaxosRemotingUtils.convertAddressToUrl(SSL_TIMELOCK, \"foo:42/api/bar/baz/bzzt\"))\n .isEqualTo(new URL(\"https\", \"foo\", 42, \"/api/bar/baz/bzzt\"));\n }",
"c... | {
"fields": [],
"file": "timelock-agent/src/main/java/com/palantir/timelock/paxos/PaxosRemotingUtils.java",
"identifier": "PaxosRemotingUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "PaxosRemotingUtils.PaxosRemotingUtils()",
"constructor": true,
"full_signature": "pr... | {
"body": "public static URL convertAddressToUrl(TimeLockInstallConfiguration install, String address) {\n try {\n return UriBuilder.fromPath(addProtocol(install, address)).build().toURL();\n } catch (MalformedURLException e) {\n throw new RuntimeException(e);\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_148 | {
"fields": [
{
"declarator": "CLIENT_A = \"a-client\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT_A = \"a-client\";",
"type": "String",
"var_name": "CLIENT_A"
},
{
"declarator": "CLIENT_B = \"b-client\"",
"modifier... | {
"body": "@Test\n public void returnsMaxNumberOfClients() {\n createMaximumNumberOfClients();\n assertThat(namespaces.getNumberOfActiveClients()).isEqualTo(DEFAULT_MAX_NUMBER_OF_CLIENTS);\n }",
"class_method_signature": "TimelockNamespacesTest.returnsMaxNumberOfClients()",
"constructor": fals... | {
"fields": [
{
"declarator": "ACTIVE_CLIENTS = \"activeClients\"",
"modifier": "@VisibleForTesting static final",
"original_string": "@VisibleForTesting static final String ACTIVE_CLIENTS = \"activeClients\";",
"type": "String",
"var_name": "ACTIVE_CLIENTS"
},
{
"decla... | {
"body": "public int getNumberOfActiveClients() {\n return services.size();\n }",
"class_method_signature": "TimelockNamespaces.getNumberOfActiveClients()",
"constructor": false,
"full_signature": "public int getNumberOfActiveClients()",
"identifier": "getNumberOfActiveClients",
"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_518 | {
"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 consistentFullBatchesGravitatesTowardsMinimumPause() {\n sweepTwentyIterationsWithResult(SUCCESS_TOO_SLOW);\n assertThat(delay.getNextPause(SUCCESS_TOO_SLOW)).isGreaterThanOrEqualTo((long) (MIN_PAUSE_MILLIS * 1.05));\n }",
"class_method_signature": "SweepDelayTest.... | {
"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_236 | {
"fields": [
{
"declarator": "TAG_KEY_1 = \"tag1\"",
"modifier": "private static final",
"original_string": "private static final String TAG_KEY_1 = \"tag1\";",
"type": "String",
"var_name": "TAG_KEY_1"
},
{
"declarator": "TAG_VALUE_1 = \"tagVal1\"",
"modifier": ... | {
"body": "@Test\n public void shouldThrowIfFirstMetricTagValueContainsEquals() throws Exception {\n assertThatThrownBy(() -> MetricNameUtils.getMetricName(METRIC_NAME,\n ImmutableMap.of(TAG_KEY_1, \"tag=Val1\", TAG_KEY_2, TAG_VALUE_2)))\n .isInstanceOf(IllegalArgumentException... | {
"fields": [
{
"declarator": "MAX_ALLOWED_TAGS = 10",
"modifier": "private static final",
"original_string": "private static final int MAX_ALLOWED_TAGS = 10;",
"type": "int",
"var_name": "MAX_ALLOWED_TAGS"
},
{
"declarator": "DELIMITER = \";\"",
"modifier": "priv... | {
"body": "public static String getMetricName(String metricName, Map<String, String> tags) {\n Preconditions.checkArgument(tags.size() <= MAX_ALLOWED_TAGS, \"Too many tags set on the metric %s. \"\n + \"Maximum allowed number of tags is %s, found %s.\", metricName, MAX_ALLOWED_TAGS, tags.size())... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_666 | {
"fields": [
{
"declarator": "counter",
"modifier": "private",
"original_string": "private long counter;",
"type": "long",
"var_name": "counter"
},
{
"declarator": "supplierCounter",
"modifier": "private",
"original_string": "private long supplierCounter;",... | {
"body": "@Test\n public void appliesFunctionEachTimeGetIsInvokedAndSuppliedVersionChanged() {\n when(mockVersionedSupplier.get()).thenReturn(VersionedType.of(null, 0));\n assertThat(testSupplier.get()).isNull();\n assertThat(counter).isEqualTo(1);\n\n when(mockVersionedSupplier.get())... | {
"fields": [
{
"declarator": "function",
"modifier": "private final",
"original_string": "private final Function<T, R> function;",
"type": "Function<T, R>",
"var_name": "function"
},
{
"declarator": "supplier",
"modifier": "private final",
"original_string"... | {
"body": "@Override\n public R get() {\n if (!Objects.equals(supplier.get().version(), lastSuppliedVersion)\n || lastComputedTime + maxTimeBetweenRecomputes < clock.getTimeMillis()) {\n recompute();\n }\n return cached;\n }",
"class_method_signature": "CachedCom... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_689 | {
"fields": [
{
"declarator": "ASYNC_INIT_DELAY = 10",
"modifier": "private static final",
"original_string": "private static final int ASYNC_INIT_DELAY = 10;",
"type": "int",
"var_name": "ASYNC_INIT_DELAY"
},
{
"declarator": "FIVE = 5",
"modifier": "private stati... | {
"body": "@Test\n public void initializationAlwaysFailsAfterTheFirstSynchronousTry() {\n AlwaysFailingInitializer initializer = new AlwaysFailingInitializer();\n\n assertThatThrownBy(() -> initializer.initialize(false))\n .isInstanceOf(RuntimeException.class)\n .withFai... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AsyncInitializer.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AsyncInitializer.class);",
"type": "Logger",
"var_name": "log"
},
{
"... | {
"body": "public final void initialize(boolean initializeAsync) {\n assertNeverCalledInitialize();\n\n initializationStartTime = System.currentTimeMillis();\n\n if (!initializeAsync) {\n tryInitializeInternal();\n return;\n }\n\n tryInitializationLoop();\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_373 | {
"fields": [
{
"declarator": "IMAGE = new byte[] {0, 1, 2, 3}",
"modifier": "private static final",
"original_string": "private static final byte[] IMAGE = new byte[] {0, 1, 2, 3};",
"type": "byte[]",
"var_name": "IMAGE"
},
{
"declarator": "USER = UserProfile.newBuilde... | {
"body": "@Test\n public void testStoreImage() {\n final UUID userId = storeUser();\n storeImage(userId);\n runWithRetry(store -> {\n InputStream image = store.getImageForUser(userId);\n try {\n Sha256Hash hash = Sha256Hash.createFrom(image);\n ... | {
"fields": [
{
"declarator": "txnMgr",
"modifier": "final",
"original_string": "final TransactionManager txnMgr;",
"type": "TransactionManager",
"var_name": "txnMgr"
},
{
"declarator": "tx",
"modifier": "final",
"original_string": "final Transaction tx;",
... | {
"body": "public InputStream getImageForUser(UUID userId) {\n Long photoId = getPhotoStreamId(userId);\n if (photoId == null) {\n return null;\n }\n UserPhotosStreamStore streamStore = UserPhotosStreamStore.of(txnMgr, tables);\n return streamStore.loadStream(tx, photoId)... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_723 | {
"fields": [
{
"declarator": "TABLE_REFERENCE = TableReference.createFromFullyQualifiedName(\"ns.table\")",
"modifier": "private static final",
"original_string": "private static final TableReference TABLE_REFERENCE = TableReference.createFromFullyQualifiedName(\"ns.table\");",
"type": "T... | {
"body": "@Test\n public void valuesCreatedAtCorrectLogSafetyLevelsForUpdates() {\n CqlQuery query = CheckAndSetQueries.getQueryForRequest(UPDATE_REQUEST);\n AtomicReference<Object[]> objects = new AtomicReference<>();\n query.logSlowResult((format, args) -> objects.set(args), Stopwatch.creat... | {
"fields": [
{
"declarator": "CASSANDRA_TIMESTAMP = -1L",
"modifier": "private static final",
"original_string": "private static final long CASSANDRA_TIMESTAMP = -1L;",
"type": "long",
"var_name": "CASSANDRA_TIMESTAMP"
},
{
"declarator": "CASSANDRA_PREFIX = \"0x\"",
... | {
"body": "static CqlQuery getQueryForRequest(CheckAndSetRequest request) {\n return request.oldValue().map(unused -> updateIfMatching(request)).orElseGet(() -> insertIfNotExists(request));\n }",
"class_method_signature": "CheckAndSetQueries.getQueryForRequest(CheckAndSetRequest request)",
"constructor"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_959 | {
"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 timeLockMigrationReportsReadyIfMigrationNotNeeded() {\n when(lockAndTimestampServices.migrator()).thenReturn(Optional.empty());\n\n assertTrue(TransactionManagers.timeLockMigrationCompleteIfNeeded(lockAndTimestampServices));\n }",
"class_method_signature": "Transac... | {
"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": "@VisibleForTesting\n static boolean timeLockMigrationCompleteIfNeeded(LockAndTimestampServices lockAndTimestampServices) {\n return lockAndTimestampServices.migrator().map(AsyncInitializer::isInitialized).orElse(true);\n }",
"class_method_signature": "TransactionManagers.timeLockMigrationCom... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_670 | {
"fields": [
{
"declarator": "REFRESH_MILLIS = 1L",
"modifier": "private static final",
"original_string": "private static final long REFRESH_MILLIS = 1L;",
"type": "long",
"var_name": "REFRESH_MILLIS"
},
{
"declarator": "supplier",
"modifier": "private",
"... | {
"body": "@Test\n public void versionUpdatesForGetAfterRefreshMillis() throws InterruptedException {\n assertThat(supplier.get()).isEqualTo(VersionedType.of(0L, UNINITIALIZED_VERSION + 1L));\n\n waitForUpdate();\n assertThat(supplier.get()).isEqualTo(VersionedType.of(0L, UNINITIALIZED_VERSION... | {
"fields": [
{
"declarator": "UNINITIALIZED_VERSION = 0L",
"modifier": "public static final",
"original_string": "public static final long UNINITIALIZED_VERSION = 0L;",
"type": "long",
"var_name": "UNINITIALIZED_VERSION"
},
{
"declarator": "aggregator",
"modifier... | {
"body": "@Override\n public VersionedType<T> get() {\n return memoizedValue.get();\n }",
"class_method_signature": "AggregatingVersionedSupplier.get()",
"constructor": false,
"full_signature": "@Override public VersionedType<T> get()",
"identifier": "get",
"invocations": [
"get"
],
"m... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_220 | {
"fields": [
{
"declarator": "LOGIN = \"login\"",
"modifier": "private static final",
"original_string": "private static final String LOGIN = \"login\";",
"type": "String",
"var_name": "LOGIN"
},
{
"declarator": "HOST = \"host\"",
"modifier": "private static fina... | {
"body": "@Test\n public void namespaceIsSidIfPresent() {\n OracleConnectionConfig connectionConfig = getBaseBuilder()\n .sid(SID)\n .build();\n assertThat(connectionConfig.namespace()).contains(SID);\n }",
"class_method_signature": "OracleConnectionConfigTest.name... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(OracleConnectionConfig.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(OracleConnectionConfig.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@Override\n @Value.Derived\n @JsonIgnore\n public Optional<String> namespace() {\n if (getSid().isPresent()) {\n return getSid();\n }\n return serviceNameConfiguration().map(ServiceNameConfiguration::namespaceOverride);\n }",
"class_method_signature": "OracleCo... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_735 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraApiVersionTest.java",
"identifier": "CassandraApiVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test public void\n version_20_1_0_supports_cas() {\n CassandraApiVersion version = new CassandraApiVersion(\"20.1.0\");\n assertThat(version.supportsCheckAndSet(), is(true));\n }",
"class_method_signature": "CassandraApiVersionTest.version_20_1_0_supports_cas()",
"constructor": fal... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(CassandraApiVersion.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CassandraApiVersion.class);",
"type": "Logger",
"var_name": "LOGGER"
}... | {
"body": "public boolean supportsCheckAndSet() {\n boolean supportsCheckAndSet = majorVersion > 19 || (majorVersion == 19 && minorVersion >= 37);\n\n if (supportsCheckAndSet) {\n LOGGER.info(\"Your cassandra api version ({}) supports check and set.\",\n SafeArg.of(\"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_365 | {
"fields": [
{
"declarator": "SUITE_NAME = \"PerformanceResults\"",
"modifier": "private static final",
"original_string": "private static final String SUITE_NAME = \"PerformanceResults\";",
"type": "String",
"var_name": "SUITE_NAME"
},
{
"declarator": "BENCHMARK_NAME ... | {
"body": "@Test\n public void canGenerateBenchmarkNameForTestWithKeyValueService() {\n BenchmarkParams params = createBenchmarkParams(\"PerformanceResults.doStuff\",\n BenchmarkParam.URI.getKey(),\n DOCKERIZED_CASSANDRA_URI);\n\n assertThat(PerformanceResults.getBenchma... | {
"fields": [
{
"declarator": "KVS_AGNOSTIC_SUFFIX = \"N/A\"",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final String KVS_AGNOSTIC_SUFFIX = \"N/A\";",
"type": "String",
"var_name": "KVS_AGNOSTIC_SUFFIX"
},
{
"... | {
"body": "@VisibleForTesting\n static String getBenchmarkName(BenchmarkParams params) {\n Optional<String> benchmarkUriSuffix = Optional.ofNullable(params.getParam(BenchmarkParam.URI.getKey()))\n .map(DockerizedDatabaseUri::fromUriString)\n .map(uri -> uri.getKeyValueServiceIn... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_109 | {
"fields": [
{
"declarator": "LOCK_CLIENT = LockClient.of(\"foo\")",
"modifier": "private static final",
"original_string": "private static final LockClient LOCK_CLIENT = LockClient.of(\"foo\");",
"type": "LockClient",
"var_name": "LOCK_CLIENT"
},
{
"declarator": "FRES... | {
"body": "@Test\n public void unlockReturnsSubsetThatWereUnlocked() {\n LockToken tokenA = randomLockToken();\n LockToken tokenB = randomLockToken();\n\n when(lockService.unlock(toLegacyToken(tokenA))).thenReturn(true);\n when(lockService.unlock(toLegacyToken(tokenB))).thenReturn(false... | {
"fields": [
{
"declarator": "timestampService",
"modifier": "private final",
"original_string": "private final TimestampService timestampService;",
"type": "TimestampService",
"var_name": "timestampService"
},
{
"declarator": "lockService",
"modifier": "private ... | {
"body": "@Override\n public Set<LockToken> unlock(Set<LockToken> tokens) {\n Set<LockToken> unlocked = Sets.newHashSet();\n for (LockToken tokenV2 : tokens) {\n LockRefreshToken legacyToken = LockTokenConverter.toLegacyToken(tokenV2);\n if (lockService.unlock(legacyToken)) {\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_559 | {
"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 passesMaintenanceHoursCorrectly() throws InterruptedException {\n BackgroundCompactor backgroundCompactor = new BackgroundCompactor(metricsManager,\n txManager,\n kvs,\n mock(LockService.class),\n createAlternatingInM... | {
"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 CompactionOutcome grabLockAndRunOnce(SingleLockService compactorLock)\n throws InterruptedException {\n CompactorConfig config = compactorConfigSupplier.get();\n if (!config.enableCompaction()) {\n log.debug(\"Skipping compaction because it is cur... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_277 | {
"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": "TABL... | {
"body": "@Test\n public void getAllTableNamesNoLoggingHappensIfQueryFastAndInfoLevel() {\n Appender mockAppender = setLogLevelAndGetAppender(Level.INFO);\n\n kvs.getAllTableNames();\n\n verifyNoMoreInteractions(mockAppender);\n }",
"class_method_signature": "ProfilingKeyValueServiceTest... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final KeyValueService delegate;",
"type": "KeyValueService",
"var_name": "delegate"
}
],
"file": "atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/ProfilingKeyVal... | {
"body": "@Override\n public Set<TableReference> getAllTableNames() {\n return maybeLog(delegate::getAllTableNames,\n logTime(\"getAllTableNames\"));\n }",
"class_method_signature": "ProfilingKeyValueService.getAllTableNames()",
"constructor": false,
"full_signature": "@Override pub... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_627 | {
"fields": [
{
"declarator": "timelockService = mock(TimelockService.class)",
"modifier": "private final",
"original_string": "private final TimelockService timelockService = mock(TimelockService.class);",
"type": "TimelockService",
"var_name": "timelockService"
},
{
"... | {
"body": "@Test\n public void shouldReturnResultOfDelegate() throws Exception {\n assertEquals(wrappingTask.execute(transaction), \"result\");\n }",
"class_method_signature": "LockCheckingTransactionTaskTest.shouldReturnResultOfDelegate()",
"constructor": false,
"full_signature": "@Test public voi... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final TransactionTask<T, E> delegate;",
"type": "TransactionTask<T, E>",
"var_name": "delegate"
},
{
"declarator": "timelockService",
"modifier": "private final",
... | {
"body": "@Override public T execute(Transaction transaction) throws E {\n try {\n return delegate.execute(transaction);\n } catch (Exception ex) {\n if (shouldRethrowWithoutLockValidation(ex) || immutableTsLockIsValid()) {\n throw ex;\n }\n th... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_332 | {
"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 rowComponentsMarkedSafeOnlyForOtherTablesAreNotSafe() {\n SafeLoggableData safeLoggableData = ImmutableSafeLoggableData.builder()\n .putPermittedRowComponents(TABLE_REFERENCE_1, ImmutableSet.of(ROW_COMPONENT_1))\n .putPermittedRowComponents(TABLE_... | {
"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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.