id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
97518356_25
{ "fields": [], "file": "dac/backend/src/test/java/com/dremio/dac/util/TestDateUtils.java", "identifier": "TestDateUtils", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFromEpochMillis() {\n LocalDate extractedDate = DateUtils.fromEpochMillis(System.currentTimeMillis());\n assertEquals(LocalDate.now(), extractedDate);\n }", "class_method_signature": "TestDateUtils.testFromEpochMillis()", "constructor": false, "full_signature": "@Test ...
{ "fields": [], "file": "dac/backend/src/main/java/com/dremio/dac/util/DateUtils.java", "identifier": "DateUtils", "interfaces": "", "methods": [ { "class_method_signature": "DateUtils.getStartOfLastMonth()", "constructor": false, "full_signature": "public static long getStartOfLastMonth...
{ "body": "public static LocalDate fromEpochMillis(final long epochMillis) {\n return Instant.ofEpochMilli(epochMillis).atZone(ZoneOffset.UTC).toLocalDate();\n }", "class_method_signature": "DateUtils.fromEpochMillis(final long epochMillis)", "constructor": false, "full_signature": "public static LocalDate ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_697
{ "fields": [ { "declarator": "TEST_USER_NAME = \"testUser\"", "modifier": "private static final", "original_string": "private static final String TEST_USER_NAME = \"testUser\";", "type": "String", "var_name": "TEST_USER_NAME" } ], "file": "plugins/hive3/plugin/src/test/java/...
{ "body": "@Test\n public void impersonationEnabledShouldReturnUser() {\n final HiveConf hiveConf = new HiveConf();\n hiveConf.setBoolVar(HIVE_SERVER2_ENABLE_DOAS, true);\n final SabotContext context = mock(SabotContext.class);\n\n final Hive3StoragePlugin plugin = new Hive3StoragePlugin(hiveConf, contex...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(Hive3StoragePlugin.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Hive3StoragePlugin.class);", "type": "org.slf4j.Log...
{ "body": "public String getUsername(String name) {\n if (isStorageImpersonationEnabled()) {\n return name;\n }\n return SystemUser.SYSTEM_USERNAME;\n }", "class_method_signature": "Hive3StoragePlugin.getUsername(String name)", "constructor": false, "full_signature": "public String getUsername(St...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_382
{ "fields": [ { "declarator": "schemaConverter", "modifier": "private", "original_string": "private SchemaConverter schemaConverter;", "type": "SchemaConverter", "var_name": "schemaConverter" }, { "declarator": "expectedEx = ExpectedException.none()", "modifier": ...
{ "body": "@Test\n public void unsupportedIcebergTypes() {\n org.apache.iceberg.Schema schema = new org.apache.iceberg.Schema(\n NestedField.optional(1, \"timestamp_nozone_field\", Types.TimestampType.withoutZone())\n );\n\n expectedEx.expect(UserException.class);\n expectedEx.expectMessage(\"conver...
{ "fields": [], "file": "sabot/kernel/src/main/java/com/dremio/exec/store/iceberg/SchemaConverter.java", "identifier": "SchemaConverter", "interfaces": "", "methods": [ { "class_method_signature": "SchemaConverter.SchemaConverter()", "constructor": true, "full_signature": "public Schema...
{ "body": "public BatchSchema fromIceberg(org.apache.iceberg.Schema icebergSchema) {\n return new BatchSchema(icebergSchema\n .columns()\n .stream()\n .map(SchemaConverter::fromIcebergColumn)\n .filter(Objects::nonNull)\n .collect(Collectors.toList()));\n }", "class_method_signature": "...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_678
{ "fields": [ { "declarator": "REMOTE_ENDPOINT_1 = newNodeEndpoint(\"10.0.0.2\", 1234)", "modifier": "private static final", "original_string": "private static final NodeEndpoint REMOTE_ENDPOINT_1 = newNodeEndpoint(\"10.0.0.2\", 1234);", "type": "NodeEndpoint", "var_name": "REMOTE_EN...
{ "body": "@Test\n public void testDeleteFile() throws IOException {\n doReturn(true).when(mockRemoteFS).delete(\n new Path(\"/foo/bar\"),\n false);\n\n Path path = new Path(\"/foo/10.0.0.2@bar\");\n assertTrue(fs.delete(path, false));\n }", "class_method_signature": "TestPseudoDistributedF...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(PseudoDistributedFileSystem.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PseudoDistributedFileSystem.class);", "typ...
{ "body": "@Override\n public boolean delete(Path f, boolean recursive) throws IOException {\n Path absolutePath = toAbsolutePath(f);\n checkPath(absolutePath);\n\n // Handle root\n if (absolutePath.isRoot()) {\n throw new AccessControlException(\"Cannot delete \" + f);\n }\n\n if (!isRemoteFi...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_228
{ "fields": [ { "declarator": "versionOption = new ImmutableVersionOption.Builder().setTag(\"1\").build()", "modifier": "private static final", "original_string": "private static final VersionOption versionOption = new ImmutableVersionOption.Builder().setTag(\"1\").build();", "type": "Vers...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testGetCreateOrVersionOptionCreateAndVersion() {\n // Act\n KVStoreOptionUtility.getCreateOrVersionOption(new KVStore.PutOption[]{createOption, versionOption});\n }", "class_method_signature": "KVStoreOptionUtilityTest.testGetCreateOr...
{ "fields": [], "file": "services/datastore/src/main/java/com/dremio/datastore/api/options/KVStoreOptionUtility.java", "identifier": "KVStoreOptionUtility", "interfaces": "", "methods": [ { "class_method_signature": "KVStoreOptionUtility.validateOptions(KVStore.KVStoreOption... options)", "con...
{ "body": "public static Optional<KVStore.PutOption> getCreateOrVersionOption(KVStore.KVStoreOption... options) {\n validateOptions(options);\n\n if (null == options || options.length == 0) {\n return Optional.empty();\n }\n\n for (KVStore.KVStoreOption option : options) {\n if (option == KVStor...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_101
{ "fields": [ { "declarator": "REFLECTIONS_PATH = \"/reflection/\"", "modifier": "private static final", "original_string": "private static final String REFLECTIONS_PATH = \"/reflection/\";", "type": "String", "var_name": "REFLECTIONS_PATH" }, { "declarator": "CATALOG_P...
{ "body": "@Test\n public void testBoostToggleOnRawReflection() {\n Reflection newReflection = createReflection();\n\n Reflection response = expectSuccess(getBuilder(getPublicAPI(3).path(REFLECTIONS_PATH)).buildPost(Entity.entity(newReflection, JSON)), Reflection.class);\n assertFalse(response.isArrowCachin...
{ "fields": [ { "declarator": "reflectionServiceHelper", "modifier": "private final", "original_string": "private final ReflectionServiceHelper reflectionServiceHelper;", "type": "ReflectionServiceHelper", "var_name": "reflectionServiceHelper" }, { "declarator": "catalo...
{ "body": "@POST\n public Reflection createReflection(Reflection reflection) {\n // TODO: handle exceptions\n ReflectionGoal newReflection = reflectionServiceHelper.createReflection(reflection.toReflectionGoal());\n\n String id = newReflection.getId().getId();\n\n return new Reflection(newReflection, ref...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_9
{ "fields": [ { "declarator": "optionManager", "modifier": "private", "original_string": "private SystemOptionManager optionManager;", "type": "SystemOptionManager", "var_name": "optionManager" }, { "declarator": "kvStoreProvider", "modifier": "private", "or...
{ "body": "@Test\n public void test460Version() throws Exception {\n final Version version = new Version(\"4.6.0\", 4, 6, 0, 0, \"\");\n assertFalse(SetTableauDefaults.updateOptionsIfNeeded(version, () -> optionManager, true));\n }", "class_method_signature": "TestSetTableauDefaults.test460Version()", "co...
{ "fields": [ { "declarator": "taskUUID = \"67780ff3-80e1-4d40-88f1-cb7139b5c3de\"", "modifier": "static final", "original_string": "static final String taskUUID = \"67780ff3-80e1-4d40-88f1-cb7139b5c3de\";", "type": "String", "var_name": "taskUUID" }, { "declarator": "V...
{ "body": "@VisibleForTesting\n static boolean updateOptionsIfNeeded(Version previousVersion, Supplier<SystemOptionManager> optionManagerSupplier,\n boolean isOptionManagerOpen) throws Exception {\n // We write a default only when upgrading from versions older than 4.6.0.\n ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_33
{ "fields": [], "file": "dac/backend/src/test/java/com/dremio/dac/explore/TestJSONElementLocator.java", "identifier": "TestJSONElementLocator", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseJsonPath2() throws Exception {\n JsonPath p = JSONElementLocator.parsePath(\"value.a.b.c\");\n assertEquals(p.toString(), 3, p.size());\n assertEquals(new JsonPath(new ObjectJsonPathElement(\"a\"), new ObjectJsonPathElement(\"b\"), new ObjectJsonPathElement(\"c\")), p...
{ "fields": [ { "declarator": "cellText", "modifier": "private final", "original_string": "private final String cellText;", "type": "String", "var_name": "cellText" }, { "declarator": "parser", "modifier": "private", "original_string": "private JsonParser pa...
{ "body": "public static JsonPath parsePath(String path) {\n if (path.startsWith(VALUE_PLACEHOLDER)) {\n return new JsonPath(path.substring(VALUE_PLACEHOLDER.length()));\n }\n throw new IllegalArgumentException(path + \" must start with 'value'\");\n }", "class_method_signature": "JSONElementLocator....
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_414
{ "fields": [], "file": "sabot/kernel/src/test/java/com/dremio/exec/server/options/TestOptionValueProtoUtils.java", "identifier": "TestOptionValueProtoUtils", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testBoolOptionFromProto() {\n final OptionValueProto optionProto = OptionValueProto.newBuilder()\n .setName(\"test.option\")\n .setBoolVal(true)\n .build();\n final OptionValue option = OptionValueProtoUtils.toOptionValue(optionProto);\n assertTrue(verifyEquival...
{ "fields": [], "file": "sabot/kernel/src/main/java/com/dremio/exec/server/options/OptionValueProtoUtils.java", "identifier": "OptionValueProtoUtils", "interfaces": "", "methods": [ { "class_method_signature": "OptionValueProtoUtils.OptionValueProtoUtils()", "constructor": true, "full_si...
{ "body": "public static OptionValue toOptionValue(OptionValueProto value) {\n switch (value.getOptionValCase()) {\n case NUM_VAL:\n return OptionValue.createLong(\n OptionValue.OptionType.SYSTEM,\n value.getName(),\n value.getNumVal()\n );\n case STRING_VAL:\n r...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_290
{ "fields": [], "file": "services/telemetry-api/src/test/java/com/dremio/telemetry/api/config/TestIncludesExcludesFilter.java", "identifier": "TestIncludesExcludesFilter", "interfaces": "", "superclass": "extends DremioTest" }
{ "body": "@Test\n public void includeAndExclude() {\n IncludesExcludesFilter f = new IncludesExcludesFilter(Arrays.asList(\"a.*\"), Arrays.asList(\"a\\\\.b.*\"));\n assertTrue(f.matches(\"a.alpha\", null));\n assertFalse(f.matches(\"a.beta\", null));\n }", "class_method_signature": "TestIncludesExcludes...
{ "fields": [ { "declarator": "includes", "modifier": "private final", "original_string": "private final List<Pattern> includes;", "type": "List<Pattern>", "var_name": "includes" }, { "declarator": "excludes", "modifier": "private final", "original_string": ...
{ "body": "@Override\n public boolean matches(String name, Metric metric) {\n if (includes.isEmpty() || matches(name, includes)) {\n return allowedViaExcludes(name);\n }\n return false;\n }", "class_method_signature": "IncludesExcludesFilter.matches(String name, Metric metric)", "constructor": fal...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_506
{ "fields": [], "file": "common/src/test/java/com/dremio/common/utils/protos/TestBlackListOutput.java", "identifier": "TestBlackListOutput", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void writeByteRange() throws IOException {\n Output delegate = Mockito.mock(Output.class);\n BlackListOutput subject =\n new BlackListOutput(\n delegate,\n Collections.emptyMap(),\n new int[]{2}\n );\n\n subject.writeByteRange(false,...
{ "fields": [ { "declarator": "EmptyArray = new int[0]", "modifier": "private static final", "original_string": "private static final int[] EmptyArray = new int[0];", "type": "int[]", "var_name": "EmptyArray" }, { "declarator": "delegate", "modifier": "private fin...
{ "body": "@Override\n public void writeByteRange(boolean utf8String, int fieldNumber, byte[] value, int offset, int length, boolean repeated) throws IOException {\n if(isBlackListed(fieldNumber)){\n return;\n }\n delegate.writeByteRange(utf8String, fieldNumber, value, offset, length, repeated);\n }",...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_156
{ "fields": [], "file": "services/jobtelemetry/server/src/test/java/com/dremio/service/jobtelemetry/server/TestProfileMerger.java", "identifier": "TestProfileMerger", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMergeWithOnlyPlanningAndExecutorProfiles() {\n final CoordinationProtos.NodeEndpoint nodeEndPoint = CoordinationProtos.NodeEndpoint\n .newBuilder()\n .setAddress(\"190.190.0.666\")\n .build();\n\n final UserBitShared.QueryProfile planningProfile =\n UserBi...
{ "fields": [ { "declarator": "planningProfile", "modifier": "private final", "original_string": "private final QueryProfile planningProfile;", "type": "QueryProfile", "var_name": "planningProfile" }, { "declarator": "tailProfile", "modifier": "private final", ...
{ "body": "static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile,\n Stream<ExecutorQueryProfile> executorProfiles) {\n\n return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge();\n }", "class_method_signature": "ProfileMerger.merge(QueryProfile planningProfi...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_443
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(TestCatalogServiceImpl.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(TestCatalogServiceImpl.class);", "type": "org.s...
{ "body": "@Test\n public void refreshSourceMetadata_FirstTime() throws Exception {\n doMockDatasets(mockUpPlugin, mockDatasets);\n catalogService.refreshSource(mockUpKey, CatalogService.REFRESH_EVERYTHING_NOW, CatalogServiceImpl.UpdateType.FULL);\n catalogService.refreshSource(mockUpKey, CatalogService.REF...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(CatalogServiceImpl.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(CatalogServiceImpl.class);", "type": "org.slf4j.Log...
{ "body": "@VisibleForTesting\n public boolean refreshSource(NamespaceKey source, MetadataPolicy metadataPolicy, UpdateType updateType) throws NamespaceException {\n ManagedStoragePlugin plugin = getPlugins().get(source.getRoot());\n if (plugin == null){\n throw UserException.validationError().message(\"U...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_64
{ "fields": [ { "declarator": "recommender = new SplitRecommender()", "modifier": "private", "original_string": "private SplitRecommender recommender = new SplitRecommender();", "type": "SplitRecommender", "var_name": "recommender" } ], "file": "dac/backend/src/test/java/com/...
{ "body": "@Test\n public void splitRegex() throws Exception {\n File dataFile = temp.newFile(\"splitRegex.json\");\n try (PrintWriter writer = new PrintWriter(dataFile)) {\n writer.append(\"{ \\\"col\\\" : \\\"aaa111BBB222cc33d\\\" }\");\n writer.append(\"{ \\\"col\\\" : \\\"a1b2c3\\\" }\");\n ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(SplitRecommender.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(SplitRecommender.class);", "type": "Logger", "var_name": "logger" } ], ...
{ "body": "public TransformRuleWrapper<SplitRule> wrapRule(SplitRule rule) {\n return new SplitTransformRuleWrapper(rule);\n }", "class_method_signature": "SplitRecommender.wrapRule(SplitRule rule)", "constructor": false, "full_signature": "public TransformRuleWrapper<SplitRule> wrapRule(SplitRule rule)", ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_13
{ "fields": [ { "declarator": "OLD_SCHEMA =\n \"EAAAAAAACgAMAAAACAAEAAoAAAAIAAAACAAAAAAAAAAEAAAAUAEAANAAAABsAAAABAAAANT\" +\n \"+//8YAAAAGAAAADAAAAAwAAAAAAACATQAAAAAAAAAAgAAABAAAAAEAAAAuP7//0AAAQDA/v//\" +\n \"AQACAAAAAAC4/v//AAAAAUAAAAATAAAAJF9kcmVtaW9fJF91cGRhdGVfJAA4////\" +\n \"GAAAABgAAAA...
{ "body": "@Test\n public void testArrowSchemaConversion() {\n byte[] schema = Base64.getDecoder().decode(OLD_SCHEMA);\n\n // try with old schema - preconverted\n try {\n BatchSchema.deserialize(schema);\n fail(\"Should not be able to process old Schema\");\n } catch (IndexOutOfBoundsException ...
{ "fields": [ { "declarator": "taskUUID = \"18df9bdf-9186-4780-b6bb-91bcb14a7a8b\"", "modifier": "static final", "original_string": "static final String taskUUID = \"18df9bdf-9186-4780-b6bb-91bcb14a7a8b\";", "type": "String", "var_name": "taskUUID" } ], "file": "dac/daemon/sr...
{ "body": "@VisibleForTesting\n byte[] convertFromOldSchema(OldSchema oldSchema) {\n FlatBufferBuilder builder = new FlatBufferBuilder();\n int[] fieldOffsets = new int[oldSchema.fieldsLength()];\n for (int i = 0; i < oldSchema.fieldsLength(); i++) {\n fieldOffsets[i] = convertFromOldField(oldSchema.fi...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_434
{ "fields": [ { "declarator": "MAX_COLUMNS = 800", "modifier": "private static final", "original_string": "private static final int MAX_COLUMNS = 800;", "type": "int", "var_name": "MAX_COLUMNS" }, { "declarator": "MAX_NESTED_LEVELS = 16", "modifier": "private stat...
{ "body": "@Test\n public void deleteUnavailableDataset() throws Exception {\n NamespaceService ns = mock(NamespaceService.class);\n when(ns.getDataset(any()))\n .thenReturn(\n new DatasetConfig()\n .setTag(\"0\")\n .setReadDefinition(new ReadDefinition())\n ...
{ "fields": [ { "declarator": "MAXIMUM_CACHE_SIZE = 10_000L", "modifier": "private static final", "original_string": "private static final long MAXIMUM_CACHE_SIZE = 10_000L;", "type": "long", "var_name": "MAXIMUM_CACHE_SIZE" }, { "declarator": "logger = org.slf4j.Logger...
{ "body": "UpdateStatus refreshDataset(NamespaceKey datasetKey, DatasetRetrievalOptions options)\n throws ConnectorException, NamespaceException {\n options.withFallback(bridge.getDefaultRetrievalOptions());\n final NamespaceService namespace = bridge.getNamespaceService();\n final DatasetSaver saver = ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_121
{ "fields": [], "file": "dac/backend/src/test/java/com/dremio/dac/api/TestUserStats.java", "identifier": "TestUserStats", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetEdition() {\n UserStats.Builder stats = new UserStats.Builder();\n stats.setEdition(\"oss\");\n String expected = \"dremio-oss-\" + DremioVersionInfo.getVersion();\n assertEquals(expected, stats.build().getEdition());\n }", "class_method_signature": "TestUserStats...
{ "fields": [ { "declarator": "DREMIO_EDITION_FORMAT = \"dremio-%s-%s\"", "modifier": "private static", "original_string": "private static String DREMIO_EDITION_FORMAT = \"dremio-%s-%s\";", "type": "String", "var_name": "DREMIO_EDITION_FORMAT" }, { "declarator": "editio...
{ "body": "public String getEdition() {\n return edition;\n }", "class_method_signature": "UserStats.getEdition()", "constructor": false, "full_signature": "public String getEdition()", "identifier": "getEdition", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_571
{ "fields": [], "file": "client/jdbc/src/test/java/com/dremio/jdbc/impl/TypeConvertingSqlAccessorTest.java", "identifier": "TypeConvertingSqlAccessorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test_getByte_on_FLOAT_thatFits_getsIt()\n throws InvalidAccessException {\n final SqlAccessor uut =\n new TypeConvertingSqlAccessor( new FloatStubAccessor( -128.0f ) );\n assertThat( uut.getByte( 0 ), equalTo( (byte) -128 ) );\n }", "class_method_signature": "TypeC...
{ "fields": [ { "declarator": "innerAccessor", "modifier": "private final", "original_string": "private final SqlAccessor innerAccessor;", "type": "SqlAccessor", "var_name": "innerAccessor" } ], "file": "client/jdbc/src/main/java/com/dremio/jdbc/impl/TypeConvertingSqlAccessor...
{ "body": "@Override\n public byte getByte( int rowOffset ) throws InvalidAccessException {\n final byte result;\n switch ( getType().getMinorType() ) {\n // 1. Regular type:\n case TINYINT:\n result = innerAccessor.getByte( rowOffset );\n break;\n\n // 2. Converted-from types:\n ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_658
{ "fields": [ { "declarator": "REMOTE_ENDPOINT_1 = newNodeEndpoint(\"10.0.0.2\", 1234)", "modifier": "private static final", "original_string": "private static final NodeEndpoint REMOTE_ENDPOINT_1 = newNodeEndpoint(\"10.0.0.2\", 1234);", "type": "NodeEndpoint", "var_name": "REMOTE_EN...
{ "body": "@Test\n public void testGetFileStatusWithValidRemotePath() throws IOException {\n doReturn(new FileStatus(1024, false, 1, 4096, 37, 42, FsPermission.createImmutable((short) 0644), \"root\", \"wheel\", new Path(\"sabot://10.0.0.2:1234/tmp/file\")))\n .when(mockRemoteFS).getFileStatus(new Path(\"/tmp/...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(PseudoDistributedFileSystem.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PseudoDistributedFileSystem.class);", "typ...
{ "body": "@Override\n public FileStatus getFileStatus(Path f) throws IOException {\n Path absolutePath = toAbsolutePath(f);\n checkPath(absolutePath);\n\n // if the path is not a remote file path\n if (!isRemoteFile(absolutePath)) {\n return new GetFileStatusTask(absolutePath).get();\n }\n\n ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_208
{ "fields": [ { "declarator": "versionOption = new ImmutableVersionOption.Builder().setTag(\"1\").build()", "modifier": "private static final", "original_string": "private static final VersionOption versionOption = new ImmutableVersionOption.Builder().setTag(\"1\").build();", "type": "Vers...
{ "body": "@Test\n public void testValidateOptionsCreateAndIndex() {\n KVStoreOptionUtility.validateOptions(new KVStore.PutOption[]{createOption, indexPutOption});\n }", "class_method_signature": "KVStoreOptionUtilityTest.testValidateOptionsCreateAndIndex()", "constructor": false, "full_signature": "@Test ...
{ "fields": [], "file": "services/datastore/src/main/java/com/dremio/datastore/api/options/KVStoreOptionUtility.java", "identifier": "KVStoreOptionUtility", "interfaces": "", "methods": [ { "class_method_signature": "KVStoreOptionUtility.validateOptions(KVStore.KVStoreOption... options)", "con...
{ "body": "public static void validateOptions(KVStore.KVStoreOption... options) {\n if (null == options || options.length <= 1) {\n return;\n }\n\n boolean foundVersion = false;\n boolean foundCreate = false;\n\n for (KVStore.KVStoreOption option : options) {\n if (option == KVStore.PutOption...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_199
{ "fields": [ { "declarator": "storeName = \"test-store\"", "modifier": "private static final", "original_string": "private static final String storeName = \"test-store\";", "type": "String", "var_name": "storeName" }, { "declarator": "one = \"one\".getBytes(StandardCha...
{ "body": "@Test\n public void add() throws Exception {\n LuceneSearchIndex index = mock(LuceneSearchIndex.class);\n final boolean[] added = {false};\n doAnswer(invocation -> {\n added[0] = true;\n return null;\n }).when(index).update(any(Term.class), any(Document.class));\n when(indexManage...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(ReIndexer.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ReIndexer.class);", "type": "org.slf4j.Logger", "var_n...
{ "body": "@Override\n public void put(String tableName, byte[] key, byte[] value) {\n if (!isIndexed(tableName)) {\n logger.trace(\"Ignoring put: {} on table '{}'\", key, tableName);\n return;\n }\n\n final KVStoreTuple<?> keyTuple = keyTuple(tableName, key);\n final Document document = toDoc(...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_463
{ "fields": [ { "declarator": "properties = new TemporarySystemProperties()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final TemporarySystemProperties properties = new TemporarySystemProperties();", "type": "TemporarySystemProperties", "var_name": "pro...
{ "body": "@Test\n public void distOverride() {\n // clear relevant parameters.\n properties.clear(DremioConfig.EMBEDDED_MASTER_ZK_ENABLED_BOOL);\n properties.clear(DremioConfig.LOCAL_WRITE_PATH_STRING);\n properties.clear(DremioConfig.DB_PATH_STRING);\n properties.clear(\"dremd.write\");\n\n Dremi...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(DremioConfig.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DremioConfig.class);", "type": "org.slf4j.Logger", ...
{ "body": "public static DremioConfig create() {\n return create(null);\n }", "class_method_signature": "DremioConfig.create()", "constructor": false, "full_signature": "public static DremioConfig create()", "identifier": "create", "invocations": [ "create" ], "modifiers": "public static", "pa...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_44
{ "fields": [ { "declarator": "recommender = new ExtractListRecommender()", "modifier": "private", "original_string": "private ExtractListRecommender recommender = new ExtractListRecommender();", "type": "ExtractListRecommender", "var_name": "recommender" }, { "declarat...
{ "body": "@Test\n public void ruleSuggestionsSingleElement() throws Exception {\n List<ExtractListRule> rules = recommender.getRules(new Selection(\"foo\", \"[ \\\"foo\\\", \\\"bar\\\", \\\"baz\\\" ]\", 3, 3), DataType.LIST);\n assertEquals(1, rules.size());\n assertEquals(ExtractListRuleType.single, rules...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ReplaceRecommender.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(ReplaceRecommender.class);", "type": "Logger", "var_name": "logger" } ...
{ "body": "@Override\n public List<ExtractListRule> getRules(Selection selection, DataType selColType) {\n checkArgument(selColType == DataType.LIST, \"Extract list items is supported only on LIST type columns\");\n JsonSelection jsonSelection;\n try {\n jsonSelection = new JSONElementLocator(selection...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_526
{ "fields": [], "file": "common/src/test/java/com/dremio/common/utils/TestPathUtils.java", "identifier": "TestPathUtils", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRemoveLeadingSlash() {\n assertEquals(\"\", PathUtils.removeLeadingSlash(\"\"));\n assertEquals(\"\", PathUtils.removeLeadingSlash(\"/\"));\n assertEquals(\"aaaa\", PathUtils.removeLeadingSlash(\"/aaaa\"));\n assertEquals(\"aaaa/bbb\", PathUtils.removeLeadingSlash(\"/aa...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(PathUtils.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PathUtils.class);", "type": "org.slf4j.Logger", "var_n...
{ "body": "public static String removeLeadingSlash(String path) {\n if (path.length() > 0 && path.charAt(0) == '/') {\n String newPath = path.substring(1);\n return removeLeadingSlash(newPath);\n } else {\n return path;\n }\n }", "class_method_signature": "PathUtils.removeLeadingSlash(Strin...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_176
{ "fields": [], "file": "services/datastore/src/test/java/com/dremio/datastore/format/compound/KeyUtilsTest.java", "identifier": "KeyUtilsTest", "interfaces": "", "superclass": "extends FormatTestArtifacts" }
{ "body": "@Test\n public void testEqualsReturnsTrueWithBooleanTrueTrue() {\n assertTrue(KeyUtils.equals(Boolean.TRUE, Boolean.TRUE));\n }", "class_method_signature": "KeyUtilsTest.testEqualsReturnsTrueWithBooleanTrueTrue()", "constructor": false, "full_signature": "@Test public void testEqualsReturnsTrueW...
{ "fields": [], "file": "services/datastore/src/main/java/com/dremio/datastore/format/compound/KeyUtils.java", "identifier": "KeyUtils", "interfaces": "", "methods": [ { "class_method_signature": "KeyUtils.KeyUtils()", "constructor": true, "full_signature": "private KeyUtils()", "...
{ "body": "public static boolean equals(Object left, Object right) {\n if (left instanceof byte[] && right instanceof byte[]) {\n return Arrays.equals((byte[]) left, (byte[]) right);\n }\n return Objects.equals(left, right);\n }", "class_method_signature": "KeyUtils.equals(Object left, Object right)"...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_52
{ "fields": [ { "declarator": "recommender = new ReplaceRecommender()", "modifier": "private", "original_string": "private ReplaceRecommender recommender = new ReplaceRecommender();", "type": "ReplaceRecommender", "var_name": "recommender" } ], "file": "dac/backend/src/test/j...
{ "body": "@Test\n public void ruleSuggestionsSelectAllText() {\n // Select all the text in text type cell\n Selection selection = new Selection(\"col\", \"There are 20 types of people\", 0, 28); // everything selected\n List<ReplacePatternRule> rules = recommender.getRules(selection, TEXT);\n assertEqua...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ReplaceRecommender.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(ReplaceRecommender.class);", "type": "Logger", "var_name": "logger" } ...
{ "body": "@Override\n public List<ReplacePatternRule> getRules(Selection selection, DataType selColType) {\n Preconditions.checkArgument(selColType == DataType.TEXT,\n \"Cards generation for Replace/Keeponly/Exclude transforms is supported only on TEXT type columns\");\n\n List<ReplacePatternRule> rule...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_475
{ "fields": [], "file": "common/src/test/java/com/dremio/common/util/concurrent/TestDremioFutures.java", "identifier": "TestDremioFutures", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMappingCause() {\n Future future = mock(Future.class);\n Throwable cause = new TestException(\"inner exception\");\n try {\n when(future.get()).thenThrow(new ExecutionException(\"outer exception\", cause));\n } catch (InterruptedException | ExecutionException ignor...
{ "fields": [], "file": "common/src/main/java/com/dremio/common/util/concurrent/DremioFutures.java", "identifier": "DremioFutures", "interfaces": "", "methods": [ { "class_method_signature": "DremioFutures.DremioFutures()", "constructor": true, "full_signature": "private DremioFutures()...
{ "body": "public static <T, X extends Exception> T getChecked(\n Future<T> future,\n Class<X> exceptionClass,\n Function<? super Throwable, ? extends X> mapper\n ) throws X {\n try {\n return Futures.getChecked(future, ExecutionException.class);\n } catch (ExecutionException e) {\n try {\n ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_160
{ "fields": [], "file": "services/jobtelemetry/server/src/test/java/com/dremio/service/jobtelemetry/server/TestProfileMerger.java", "identifier": "TestProfileMerger", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMergeWithInconsistentExecutorProfiles() {\n final CoordinationProtos.NodeEndpoint nodeEndPoint = CoordinationProtos.NodeEndpoint\n .newBuilder()\n .setAddress(\"190.190.0.666\")\n .build();\n\n final UserBitShared.QueryProfile planningProfile =\n UserBitSh...
{ "fields": [ { "declarator": "planningProfile", "modifier": "private final", "original_string": "private final QueryProfile planningProfile;", "type": "QueryProfile", "var_name": "planningProfile" }, { "declarator": "tailProfile", "modifier": "private final", ...
{ "body": "static QueryProfile merge(QueryProfile planningProfile, QueryProfile tailProfile,\n Stream<ExecutorQueryProfile> executorProfiles) {\n\n return new ProfileMerger(planningProfile, tailProfile, executorProfiles).merge();\n }", "class_method_signature": "ProfileMerger.merge(QueryProfile planningProfi...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_530
{ "fields": [ { "declarator": "v1 = new Version(\"1.2.3-SNAPSHOT\", 1, 2, 3, 0, \"SNAPSHOT\")", "modifier": "private final", "original_string": "private final Version v1 = new Version(\"1.2.3-SNAPSHOT\", 1, 2, 3, 0, \"SNAPSHOT\");", "type": "Version", "var_name": "v1" }, { ...
{ "body": "@SuppressWarnings(\"SelfComparison\")\n @Test\n public void testCompareTo() {\n assertTrue(v1.compareTo(v1) == 0);\n assertTrue(v1.compareTo(v2) < 0);\n assertTrue(v1.compareTo(v3) < 0);\n assertTrue(v1.compareTo(v4) == 0);\n assertTrue(v1.compareTo(v5) < 0);\n assertTrue(v1.compareTo(n...
{ "fields": [ { "declarator": "version", "modifier": "private final", "original_string": "private final String version;", "type": "String", "var_name": "version" }, { "declarator": "major", "modifier": "private final", "original_string": "private final int m...
{ "body": "@Override\n public int compareTo(Version o) {\n Preconditions.checkNotNull(o);\n return ComparisonChain.start()\n .compare(this.major, o.major)\n .compare(this.minor, o.minor)\n .compare(this.patch, o.patch)\n .compare(this.buildNumber, o.buildNumber)\n .compare(th...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_619
{ "fields": [], "file": "plugins/s3/src/test/java/com/dremio/plugins/s3/store/TestS3FileSystem.java", "identifier": "TestS3FileSystem", "interfaces": "", "superclass": "" }
{ "body": "@Test (expected = ContainerNotFoundException.class)\n public void testUnknownContainerNotExists() throws IOException {\n TestExtendedS3FileSystem fs = new TestExtendedS3FileSystem();\n AmazonS3 mockedS3Client = mock(AmazonS3.class);\n when(mockedS3Client.doesBucketExistV2(any(String.class))).then...
{ "fields": [ { "declarator": "S3_PERMISSION_ERROR_MSG = \"Access was denied by S3\"", "modifier": "public static final", "original_string": "public static final String S3_PERMISSION_ERROR_MSG = \"Access was denied by S3\";", "type": "String", "var_name": "S3_PERMISSION_ERROR_MSG" ...
{ "body": "@Override\n protected ContainerHolder getUnknownContainer(String containerName) throws IOException {\n // Per docs, if invalid security credentials are used to execute\n // AmazonS3#doesBucketExist method, the client is not able to distinguish\n // between bucket permission errors and invalid cre...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_249
{ "fields": [], "file": "services/accelerator/src/test/java/com/dremio/service/reflection/TestReflectionGoalChecker.java", "identifier": "TestReflectionGoalChecker", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testHashingEmptyWithBoostEnabledGoal(){\n ReflectionGoal goal = new ReflectionGoal()\n .setArrowCachingEnabled(true);\n\n ReflectionGoalHash actual = ReflectionGoalChecker.Instance.calculateReflectionGoalVersion(goal);\n assertEquals(\"e3b0c44298fc1c149afbf4c8996fb92427ae...
{ "fields": [ { "declarator": "Instance = new ReflectionGoalChecker()", "modifier": "public static final", "original_string": "public static final ReflectionGoalChecker Instance = new ReflectionGoalChecker();", "type": "ReflectionGoalChecker", "var_name": "Instance" }, { ...
{ "body": "public ReflectionGoalHash calculateReflectionGoalVersion(ReflectionGoal reflectionGoal){\n HasherOutput hasherOutput = new HasherOutput();\n Output blackListedOutput = reflectionGoalMaterializationBlackLister.apply(hasherOutput);\n try {\n reflectionGoal.writeTo(blackListedOutput, reflectionG...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_422
{ "fields": [ { "declarator": "som", "modifier": "private", "original_string": "private SystemOptionManager som;", "type": "SystemOptionManager", "var_name": "som" }, { "declarator": "kvStore", "modifier": "private", "original_string": "private LegacyKVStore...
{ "body": "@Test\n public void testGetNonDefaultOptions() {\n registerTestOption(OptionValue.Kind.LONG, \"test-option-0\", \"0\");\n registerTestOption(OptionValue.Kind.LONG, \"test-option-1\", \"1\");\n\n OptionValue optionValue0 = OptionValue.createLong(OptionValue.OptionType.SYSTEM, \"test-option-0\", 10...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(SystemOptionManager.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SystemOptionManager.class);", "type": "org.slf4j.L...
{ "body": "@Override\n public OptionList getNonDefaultOptions() {\n final OptionList nonDefaultOptions = new OptionList();\n getOptionProtoList().forEach(\n entry -> nonDefaultOptions.add(OptionValueProtoUtils.toOptionValue(entry))\n );\n return nonDefaultOptions;\n }", "class_method_signature": ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_588
{ "fields": [], "file": "client/jdbc/src/test/java/com/dremio/jdbc/impl/TypeConvertingSqlAccessorTest.java", "identifier": "TypeConvertingSqlAccessorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test_getInt_on_BIGINT_thatFits_getsIt() throws InvalidAccessException {\n final SqlAccessor uut =\n new TypeConvertingSqlAccessor( new BigIntStubAccessor( 2147483647 ) );\n assertThat( uut.getInt( 0 ), equalTo( 2147483647 ) );\n }", "class_method_signature": "TypeConver...
{ "fields": [ { "declarator": "innerAccessor", "modifier": "private final", "original_string": "private final SqlAccessor innerAccessor;", "type": "SqlAccessor", "var_name": "innerAccessor" } ], "file": "client/jdbc/src/main/java/com/dremio/jdbc/impl/TypeConvertingSqlAccessor...
{ "body": "@Override\n public int getInt( int rowOffset ) throws InvalidAccessException {\n final int result;\n switch ( getType().getMinorType() ) {\n // 1. Regular type:\n case INT:\n result = innerAccessor.getInt( rowOffset );\n break;\n\n // 2. Converted-from types:\n case...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_567
{ "fields": [], "file": "client/jdbc/src/test/java/com/dremio/jdbc/impl/TypeConvertingSqlAccessorTest.java", "identifier": "TypeConvertingSqlAccessorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test_getByte_on_INTEGER_thatFits_getsIt()\n throws InvalidAccessException {\n final SqlAccessor uut =\n new TypeConvertingSqlAccessor( new IntegerStubAccessor( -128 ) );\n assertThat( uut.getByte( 0 ), equalTo( (byte) -128 ) );\n }", "class_method_signature": "Type...
{ "fields": [ { "declarator": "innerAccessor", "modifier": "private final", "original_string": "private final SqlAccessor innerAccessor;", "type": "SqlAccessor", "var_name": "innerAccessor" } ], "file": "client/jdbc/src/main/java/com/dremio/jdbc/impl/TypeConvertingSqlAccessor...
{ "body": "@Override\n public byte getByte( int rowOffset ) throws InvalidAccessException {\n final byte result;\n switch ( getType().getMinorType() ) {\n // 1. Regular type:\n case TINYINT:\n result = innerAccessor.getByte( rowOffset );\n break;\n\n // 2. Converted-from types:\n ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_137
{ "fields": [], "file": "services/jobs/src/test/java/com/dremio/service/jobs/TestJobResultToLogEntryConverter.java", "identifier": "TestJobResultToLogEntryConverter", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOutcomeReasonFailed() throws Exception {\n JobResultToLogEntryConverter converter = new JobResultToLogEntryConverter();\n Job job = mock(Job.class);\n JobAttempt jobAttempt = new JobAttempt();\n JobInfo jobInfo = new JobInfo();\n JobId jobId = new JobId();\n jobId...
{ "fields": [], "file": "services/jobs/src/main/java/com/dremio/service/jobs/JobResultToLogEntryConverter.java", "identifier": "JobResultToLogEntryConverter", "interfaces": "implements Function<Job, LoggedQuery>", "methods": [ { "class_method_signature": "JobResultToLogEntryConverter.apply(Job job)"...
{ "body": "@Override\n public LoggedQuery apply(Job job) {\n final JobInfo info = job.getJobAttempt().getInfo();\n final List<String> contextList = info.getContextList();\n String outcomeReason = null;\n switch(job.getJobAttempt().getState()) {\n case CANCELED:\n outcomeReason = info.getCance...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_91
{ "fields": [ { "declarator": "table = \"\\\"cp\\\".\\\"tpch/supplier.parquet\\\"\"", "modifier": "private static", "original_string": "private static String table = \"\\\"cp\\\".\\\"tpch/supplier.parquet\\\"\";", "type": "String", "var_name": "table" }, { "declarator":...
{ "body": "@Test\n public void testOrderAlias() {\n VirtualDatasetState ds =\n extract(getQueryFromSQL(\"select a as b from cp.\\\"json/nested.json\\\" order by b\"));\n assertEquals(\n new VirtualDatasetState()\n .setFrom(new FromTable(\"\\\"cp\\\".\\\"json/nested.json\\\"\").setAlias...
{ "fields": [], "file": "dac/backend/src/main/java/com/dremio/dac/explore/QuerySemantics.java", "identifier": "QuerySemantics", "interfaces": "", "methods": [ { "class_method_signature": "QuerySemantics.QuerySemantics()", "constructor": true, "full_signature": "private QuerySemantics()"...
{ "body": "public static VirtualDatasetState extract(QueryMetadata metadata) {\n final com.dremio.service.jobs.metadata.proto.VirtualDatasetState pState = metadata.getState();\n final VirtualDatasetState state = new VirtualDatasetState();\n if (pState.hasFrom()) {\n state.setFrom(fromBuf(pState.getFrom(...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_459
{ "fields": [ { "declarator": "collector = new ErrorCollector()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ErrorCollector collector = new ErrorCollector();", "type": "ErrorCollector", "var_name": "collector" } ], "file": "common/src/test/...
{ "body": "@Test\n public void testDepth() {\n checkDepth(Path.of(\"/\"), 0);\n checkDepth(Path.of(\"/foo\"), 1);\n checkDepth(Path.of(\"/foo/bar\"), 2);\n checkDepth(Path.of(\"foo\"), 0);\n }", "class_method_signature": "TestPath.testDepth()", "constructor": false, "full_signature": "@Test public...
{ "fields": [ { "declarator": "SEPARATOR = \"/\"", "modifier": "public static final", "original_string": "public static final String SEPARATOR = \"/\";", "type": "String", "var_name": "SEPARATOR" }, { "declarator": "SEPARATOR_CHAR = '/'", "modifier": "public stati...
{ "body": "public int depth() {\n final String path = uri.getPath();\n\n if (path.charAt(0) == SEPARATOR_CHAR && path.length() == 1) {\n return 0;\n }\n\n int depth = 0;\n for (int i = 0 ; i < path.length(); i++) {\n if (path.charAt(i) == SEPARATOR_CHAR) {\n depth++;\n }\n }\n ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_320
{ "fields": [ { "declarator": "N1_EP1 = newNodeEndpoint(\"node1\", 30010)", "modifier": "private static final", "original_string": "private static final NodeEndpoint N1_EP1 = newNodeEndpoint(\"node1\", 30010);", "type": "NodeEndpoint", "var_name": "N1_EP1" }, { "declara...
{ "body": "@Test\n public void noMatchHardAffinity() throws Exception {\n try {\n final Wrapper wrapper = newSplitWrapper(200, 1, 20,\n Collections.singletonList(new EndpointAffinity(N1_EP1, 1.0, true, 20)),\n new ExecutionNodeMap(ImmutableList.of(N2_EP1))\n );\n\n INSTANCE.parall...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(HardAffinityFragmentParallelizer.class)", "modifier": "private static final", "original_string": "private static final Logger logger = org.slf4j.LoggerFactory.getLogger(HardAffinityFragmentParallelizer.class);", "typ...
{ "body": "@Override\n public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<NodeEndpoint> activeEndpoints) throws PhysicalOperatorSetupException {\n\n final Stats stats = fragmentWrapper.getStats();\n final ParallelizationInfo pInfo ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_265
{ "fields": [], "file": "services/namespace/src/test/java/com/dremio/service/namespace/file/TestFileFormat.java", "identifier": "TestFileFormat", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testsetSkipFirstLineTextFile() throws Exception {\n TextFileConfig fileFormat = new TextFileConfig();\n fileFormat.setSkipFirstLine(true);\n String tableOptions = fileFormat.toTableOptions();\n assertContains(\"skipFirstLine => true\", tableOptions);\n }", "class_method_...
{ "fields": [ { "declarator": "buffer = LinkedBuffer.allocate(512)", "modifier": "@JsonIgnore\n private final", "original_string": "@JsonIgnore\n private final LinkedBuffer buffer = LinkedBuffer.allocate(512);", "type": "LinkedBuffer", "var_name": "buffer" }, { "decla...
{ "body": "public String toTableOptions() throws IllegalArgumentException {\n final StringBuilder stringBuilder = new StringBuilder();\n switch (getFileType()) {\n case TEXT:\n case CSV:\n case TSV:\n case PSV:\n final TextFileConfig textFileConfig = (TextFileConfig)this;\n str...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_635
{ "fields": [ { "declarator": "TEST_RPC_TIMEOUT_MS = 100", "modifier": "private static final", "original_string": "private static final int TEST_RPC_TIMEOUT_MS = 100;", "type": "int", "var_name": "TEST_RPC_TIMEOUT_MS" }, { "declarator": "logger = org.slf4j.LoggerFactory...
{ "body": "@Test\n public void testToProtobuFileStatusWithDefault() throws IOException {\n FileStatus status = new FileStatus();\n\n DFS.FileStatus result = RemoteNodeFileSystem.toProtoFileStatus(status);\n assertFalse(result.hasPath());\n assertEquals(0, result.getLength());\n assertFalse(result.getI...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(RemoteNodeFileSystem.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(RemoteNodeFileSystem.class);", "type": "org.slf4j...
{ "body": "static DFS.FileStatus toProtoFileStatus(FileStatus status) throws IOException {\n DFS.FileStatus.Builder builder = DFS.FileStatus.newBuilder();\n\n builder\n .setLength(status.getLen())\n .setIsDirectory(status.isDirectory())\n .setBlockReplication(status.getReplication())\n .setB...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_29
{ "fields": [ { "declarator": "datasetPath = new DatasetPath(\"myspace.parentDS\")", "modifier": "private final", "original_string": "private final DatasetPath datasetPath = new DatasetPath(\"myspace.parentDS\");", "type": "DatasetPath", "var_name": "datasetPath" }, { "...
{ "body": "@Test\n public void testMutatorApplyNoDropPreview() {\n boolean preview = true;\n TransformResult result = mutator(preview).apply(\"foo\", \"foo2\", newValue, false);\n assertEquals(newHashSet(\"foo2\"), result.getAddedColumns());\n assertEquals(newHashSet(), result.getModifiedColumns());\n ...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(DatasetStateMutator.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DatasetStateMutator.class);", "type": "org.slf4j.L...
{ "body": "public TransformResult apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSourceColumn) {\n return apply(oldCol, newCol, newExp.wrap(), dropSourceColumn);\n }", "class_method_signature": "DatasetStateMutator.apply(String oldCol, String newCol, ExpressionBase newExp, boolean dropSo...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_727
{ "fields": [ { "declarator": "properties = new TemporarySystemProperties()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final TemporarySystemProperties properties = new TemporarySystemProperties();", "type": "TemporarySystemProperties", "var_name": "pro...
{ "body": "@Test\n public void testTimelineServiceIsDisabledByDefault(){\n YarnController controller = Mockito.mock(YarnController.class);\n YarnService yarnService = new YarnService(new TestListener(), controller, Mockito.mock(NodeProvider.class));\n Cluster cluster = new Cluster();\n cluster.setState(C...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(YarnService.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(YarnService.class);", "type": "Logger", "var_name": "logger" }, { "d...
{ "body": "@VisibleForTesting\n protected String updateYarnConfiguration(Cluster cluster, YarnConfiguration yarnConfiguration) {\n String rmAddress = null;\n // make sure we set defaults first - before we overwrite it with props from ClusterConfig\n setYarnDefaults(cluster, yarnConfiguration);\n List<Pro...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_377
{ "fields": [ { "declarator": "tempDir = new TemporaryFolder()", "modifier": "@ClassRule\n public static final", "original_string": "@ClassRule\n public static final TemporaryFolder tempDir = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "tempDir" } ], "fi...
{ "body": "@Test\n public void match() throws Exception {\n IcebergFormatMatcher matcher = new IcebergFormatMatcher(null);\n FileSystem fs = HadoopFileSystem.getLocal(new Configuration());\n File root = tempDir.newFolder();\n FileSelection fileSelection = FileSelection.create(fs, Path.of(root.toURI()));\...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(IcebergFormatMatcher.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(IcebergFormatMatcher.class);", "type": "org.slf4j...
{ "body": "@Override\n public boolean matches(FileSystem fs, FileSelection fileSelection, CompressionCodecFactory codecFactory) throws IOException {\n Path rootDir = Path.of(fileSelection.getSelectionRoot());\n Path metaDir = rootDir.resolve(METADATA_DIR_NAME);\n if (!fs.isDirectory(rootDir) || !fs.exists(m...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_398
{ "fields": [], "file": "sabot/kernel/src/test/java/com/dremio/exec/store/dfs/TestDremioFileSystemCache.java", "identifier": "TestDremioFileSystemCache", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void withUniqueConnProps() throws Exception {\n final DremioFileSystemCache dfsc = new DremioFileSystemCache();\n final URI uri = URI.create(\"file:///path\");\n final List<String> uniqueProps = ImmutableList.of(\"prop1\", \"prop2\");\n\n\n Configuration conf1 = new Configurati...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(DremioFileSystemCache.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DremioFileSystemCache.class);", "type": "org.slf...
{ "body": "public FileSystem get(URI uri, Configuration conf, List<String> uniqueConnectionProps) throws IOException{\n final Key key = new Key(uri, conf, uniqueConnectionProps);\n\n FileSystem fs;\n synchronized (this) {\n fs = map.get(key);\n }\n if (fs != null) {\n return fs;\n }\n\n ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_662
{ "fields": [ { "declarator": "REMOTE_ENDPOINT_1 = newNodeEndpoint(\"10.0.0.2\", 1234)", "modifier": "private static final", "original_string": "private static final NodeEndpoint REMOTE_ENDPOINT_1 = newNodeEndpoint(\"10.0.0.2\", 1234);", "type": "NodeEndpoint", "var_name": "REMOTE_EN...
{ "body": "@Test\n public void testListStatusRoot() throws IOException {\n Path root = new Path(\"/\");\n FileStatus[] statuses = fs.listStatus(root);\n\n assertEquals(1, statuses.length);\n\n assertEquals(new Path(\"pdfs:/foo\"), statuses[0].getPath());\n assertTrue(statuses[0].isDirectory());\n a...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(PseudoDistributedFileSystem.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PseudoDistributedFileSystem.class);", "typ...
{ "body": "@Override\n public FileStatus[] listStatus(Path f) throws FileNotFoundException, IOException {\n final RemoteIterator<FileStatus> remoteIterator = listStatusIterator(f);\n\n // Note: RemoteIterator has no relation to java.util.Iterator so frequently used\n // helper functions can't be called on t...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_232
{ "fields": [], "file": "services/datastore/src/test/java/com/dremio/datastore/TestLegacyProtobufSerializer.java", "identifier": "TestLegacyProtobufSerializer", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParse() throws InvalidProtocolBufferException {\n // Creating a protobuf message as it would be generated by protostuff for the following message\n // SearchQuery -> Boolean -> [ SearchQuery -> Term, SearchQuery -> Term ]\n\n final UnknownFieldSet term1 = UnknownFieldSet.n...
{ "fields": [], "file": "services/datastore/src/main/java/com/dremio/datastore/LegacyProtobufSerializer.java", "identifier": "LegacyProtobufSerializer", "interfaces": "", "methods": [ { "class_method_signature": "LegacyProtobufSerializer.LegacyProtobufSerializer(Class<T> clazz, Parser<T> parser)", ...
{ "body": "public static <M extends Message> M parseFrom(Parser<M> parser, ByteString bytes)\n throws InvalidProtocolBufferException {\n return rewriteProtostuff(parser.parseFrom(bytes));\n }", "class_method_signature": "LegacyProtobufSerializer.parseFrom(Parser<M> parser, ByteString bytes)", "constructo...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_418
{ "fields": [ { "declarator": "som", "modifier": "private", "original_string": "private SystemOptionManager som;", "type": "SystemOptionManager", "var_name": "som" }, { "declarator": "kvStore", "modifier": "private", "original_string": "private LegacyKVStore...
{ "body": "@Test\n public void testGet() {\n registerTestOption(OptionValue.Kind.LONG, \"test-option\", \"0\");\n\n OptionValue optionValue = OptionValue.createLong(OptionValue.OptionType.SYSTEM, \"test-option\", 123);\n OptionValueProtoList optionList = OptionValueProtoList.newBuilder()\n .addAllOptio...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(SystemOptionManager.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SystemOptionManager.class);", "type": "org.slf4j.L...
{ "body": "@Override\n public OptionValue getOption(final String name) {\n final OptionValueProto value = getOptionProto(name);\n return value == null ? null : OptionValueProtoUtils.toOptionValue(value);\n }", "class_method_signature": "SystemOptionManager.getOption(final String name)", "constructor": fal...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_5
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "kvstore =\n...
{ "body": "@Test\n public void testIllegalUpgrade() throws Exception {\n thrown.expect(Exception.class);\n thrown.expectMessage(\"Illegal upgrade from OSS to EE\");\n\n final ByteString prevEdition = ByteString.copyFrom(\"OSS\".getBytes());\n final ConfigurationEntry configurationEntry = new Configuratio...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(Upgrade.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Upgrade.class);", "type": "org.slf4j.Logger", "var_name"...
{ "body": "@VisibleForTesting\n public void validateUpgrade(final LegacyKVStoreProvider storeProvider, final String curEdition) throws Exception {\n if (!getDACConfig().isMigrationEnabled()) {\n // If the migration is disabled, validate this task.\n final ConfigurationStore configurationStore = new Conf...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_731
{ "fields": [ { "declarator": "healthMonitorThread", "modifier": "private", "original_string": "private YarnContainerHealthMonitor.YarnContainerHealthMonitorThread healthMonitorThread;", "type": "YarnContainerHealthMonitor.YarnContainerHealthMonitorThread", "var_name": "healthMonitor...
{ "body": "@Test\n public void testUnavailableContainer() throws Exception {\n when(connection.getResponseCode()).thenReturn(HttpStatus.SC_NOT_FOUND);\n assertNull(healthMonitorThread.getContainerState(connection));\n assertFalse(healthMonitorThread.isHealthy());\n }", "class_method_signature": "TestYarn...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(YarnContainerHealthMonitor.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(YarnContainerHealthMonitor.class);", "type"...
{ "body": "@Override\n public boolean isHealthy() {\n //TODO DX-20576: We are currently always returning true\n // In the future, this method should return the health of the container\n // as implemented in YarnContainerHealthMonitorThread#isContainerHealthy()\n return isHealthy;\n }", "class_method_s...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_224
{ "fields": [ { "declarator": "versionOption = new ImmutableVersionOption.Builder().setTag(\"1\").build()", "modifier": "private static final", "original_string": "private static final VersionOption versionOption = new ImmutableVersionOption.Builder().setTag(\"1\").build();", "type": "Vers...
{ "body": "@Test\n public void testGetCreateOrVersionOptionNull() {\n // Act\n final Optional<KVStore.PutOption> ret = KVStoreOptionUtility.getCreateOrVersionOption();\n\n // Assert\n assertFalse(ret.isPresent());\n }", "class_method_signature": "KVStoreOptionUtilityTest.testGetCreateOrVersionOptionNu...
{ "fields": [], "file": "services/datastore/src/main/java/com/dremio/datastore/api/options/KVStoreOptionUtility.java", "identifier": "KVStoreOptionUtility", "interfaces": "", "methods": [ { "class_method_signature": "KVStoreOptionUtility.validateOptions(KVStore.KVStoreOption... options)", "con...
{ "body": "public static Optional<KVStore.PutOption> getCreateOrVersionOption(KVStore.KVStoreOption... options) {\n validateOptions(options);\n\n if (null == options || options.length == 0) {\n return Optional.empty();\n }\n\n for (KVStore.KVStoreOption option : options) {\n if (option == KVStor...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_674
{ "fields": [ { "declarator": "REMOTE_ENDPOINT_1 = newNodeEndpoint(\"10.0.0.2\", 1234)", "modifier": "private static final", "original_string": "private static final NodeEndpoint REMOTE_ENDPOINT_1 = newNodeEndpoint(\"10.0.0.2\", 1234);", "type": "NodeEndpoint", "var_name": "REMOTE_EN...
{ "body": "@Test\n public void testAppendFile() throws IOException {\n FSDataOutputStream mockFDOS = mock(FSDataOutputStream.class);\n doReturn(mockFDOS).when(mockRemoteFS).append(\n new Path(\"/foo/bar/file\"),\n 4096,\n null);\n\n Path path = new Path(\"/foo/bar/10.0.0.2@f...
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(PseudoDistributedFileSystem.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PseudoDistributedFileSystem.class);", "typ...
{ "body": "@Override\n public FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException {\n Path absolutePath = toAbsolutePath(f);\n checkPath(absolutePath);\n\n // Handle root\n if (absolutePath.isRoot()) {\n throw new AccessControlException(\"Cannot open \" + f);\...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_87
{ "fields": [ { "declarator": "table = \"\\\"cp\\\".\\\"tpch/supplier.parquet\\\"\"", "modifier": "private static", "original_string": "private static String table = \"\\\"cp\\\".\\\"tpch/supplier.parquet\\\"\";", "type": "String", "var_name": "table" }, { "declarator":...
{ "body": "@Test\n public void testCount() {\n VirtualDatasetState ds =\n extract(getQueryFromSQL(\"select count(*) from cp.\\\"json/nested.json\\\"\"));\n assertEquals(\n new VirtualDatasetState()\n .setFrom(new FromTable(\"\\\"cp\\\".\\\"json/nested.json\\\"\").setAlias(\"json/nested...
{ "fields": [], "file": "dac/backend/src/main/java/com/dremio/dac/explore/QuerySemantics.java", "identifier": "QuerySemantics", "interfaces": "", "methods": [ { "class_method_signature": "QuerySemantics.QuerySemantics()", "constructor": true, "full_signature": "private QuerySemantics()"...
{ "body": "public static VirtualDatasetState extract(QueryMetadata metadata) {\n final com.dremio.service.jobs.metadata.proto.VirtualDatasetState pState = metadata.getState();\n final VirtualDatasetState state = new VirtualDatasetState();\n if (pState.hasFrom()) {\n state.setFrom(fromBuf(pState.getFrom(...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_68
{ "fields": [ { "declarator": "allocator", "modifier": "private", "original_string": "private BufferAllocator allocator;", "type": "BufferAllocator", "var_name": "allocator" } ], "file": "dac/backend/src/test/java/com/dremio/dac/explore/TestHistogramGenerator.java", "identi...
{ "body": "@Test\n public void testTimeIntervals() throws Exception {\n HistogramGenerator hg = new HistogramGenerator(null);\n\n String myTimeStr = \"2016-02-29 13:59:01\";\n DateTimeFormatter dtf = DateFunctionsUtils.getISOFormatterForFormatString(\"YYYY-MM-DD HH24:MI:SS\");\n LocalDateTime myTime = dt...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(HistogramGenerator.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(HistogramGenerator.class);", "type": "Logger", "var_name": "logger" }, ...
{ "body": "@VisibleForTesting\n protected static LocalDateTime roundTime(LocalDateTime tmpValue, TruncEvalEnum trucateTo, boolean isRoundDown) {\n switch (trucateTo) {\n case SECOND:\n if (isRoundDown) {\n return tmpValue.secondOfMinute().roundFloorCopy();\n } else {\n return ...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_336
{ "fields": [], "file": "sabot/kernel/src/test/java/com/dremio/exec/planner/sql/handlers/commands/TestMetadataProviderConditions.java", "identifier": "TestMetadataProviderConditions", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLikeFilterAlwaysTrue() {\n assertSame(MetadataProviderConditions.ALWAYS_TRUE,\n MetadataProviderConditions.getCatalogNamePredicate(null));\n assertSame(MetadataProviderConditions.ALWAYS_TRUE,\n MetadataProviderConditions.getCatalogNamePredicate(newLikeFilter(null, \...
{ "fields": [ { "declarator": "ALWAYS_TRUE = x -> true", "modifier": "static final", "original_string": "static final Predicate<String> ALWAYS_TRUE = x -> true;", "type": "Predicate<String>", "var_name": "ALWAYS_TRUE" }, { "declarator": "SQL_LIKE_ANY_STRING_PATTERN = \"...
{ "body": "public static Predicate<String> getCatalogNamePredicate(LikeFilter filter) {\n if (filter == null || !filter.hasPattern() || SQL_LIKE_ANY_STRING_PATTERN.equals(filter.getPattern())) {\n return ALWAYS_TRUE;\n }\n\n final String patternString =\n RegexpUtil.sqlToRegexLike(filter.getPattern...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_623
{ "fields": [], "file": "plugins/s3/src/test/java/com/dremio/plugins/util/ContainerFileSystemTest.java", "identifier": "ContainerFileSystemTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void transformContainerPathWithColon() {\n // given\n final Path path = new Path(\"s3a://qa1.dremio.com/test:breaks\");\n final String containerName = \"qa1.dremio.com\";\n\n // when\n final Path transformed = ContainerFileSystem.transform(path, containerName);\n\n // then...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ContainerFileSystem.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(ContainerFileSystem.class);", "type": "Logger", "var_name": "logger" }...
{ "body": "@VisibleForTesting\n static Path transform(Path path, String containerName) {\n final String relativePath = removeLeadingSlash(Path.getPathWithoutSchemeAndAuthority(path).toString());\n final Path containerPath = new Path(Path.SEPARATOR + containerName);\n\n // If relativePath is not null or emp...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
97518356_273
{ "fields": [], "file": "services/namespace/src/test/java/com/dremio/service/namespace/file/TestFileFormat.java", "identifier": "TestFileFormat", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSheetExcelFileWithSingleQuote() throws Exception {\n ExcelFileConfig fileFormat = new ExcelFileConfig();\n fileFormat.setSheetName(\"fo'o\");\n String tableOptions = fileFormat.toTableOptions();\n assertContains(\"type => 'excel'\", tableOptions);\n assertContains(\"...
{ "fields": [ { "declarator": "buffer = LinkedBuffer.allocate(512)", "modifier": "@JsonIgnore\n private final", "original_string": "@JsonIgnore\n private final LinkedBuffer buffer = LinkedBuffer.allocate(512);", "type": "LinkedBuffer", "var_name": "buffer" }, { "decla...
{ "body": "public String toTableOptions() throws IllegalArgumentException {\n final StringBuilder stringBuilder = new StringBuilder();\n switch (getFileType()) {\n case TEXT:\n case CSV:\n case TSV:\n case PSV:\n final TextFileConfig textFileConfig = (TextFileConfig)this;\n str...
{ "created": null, "fork": null, "fork_count": 232, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 97518356, "size": 51402, "stargazer_count": 737, "stars": null, "updates": null, "url": "https://github.com/dremio/dremio-oss" }
64185596_23
{ "fields": [ { "declarator": "cluster", "modifier": "private static", "original_string": "private static Cluster cluster;", "type": "Cluster", "var_name": "cluster" } ], "file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe...
{ "body": "@Test\n public void getTableShardShardValueWorkTest() {\n final TableShardContext context = new TableShardContext(\"whatever\");\n context.setShardValue(100);\n\n final Map<String, Object> data1 = new HashMap<>();\n data1.put(\"id\", 7); // ignore\n data1.put(\"age\", ...
{ "fields": [ { "declarator": "clusterConfig", "modifier": "private", "original_string": "private ClusterConfigImpl clusterConfig;", "type": "ClusterConfigImpl", "var_name": "clusterConfig" }, { "declarator": "databaseShards = new HashMap<>()", "modifier": "privat...
{ "body": "@Override\n public String getTableShard(String tableName, TableShardContext context) {\n return shardStrategyProxy.getTableShard(tableName, context);\n }", "class_method_signature": "DefaultCluster.getTableShard(String tableName, TableShardContext context)", "constructor": false, "full_s...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_74
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testTable() {\n AbstractFreeSqlBuilder test = create();\n test.append(table(template));\n assertEquals(wrappedTemplate, test.build());\n \n test = create();\n test.append(table(tableName));\n test.setHints(new DalHints().inTableShard(1...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public static Table table(String tableName) {\n return new Table(tableName);\n }", "class_method_signature": "AbstractFreeSqlBuilder.table(String tableName)", "constructor": false, "full_signature": "public static Table table(String tableName)", "identifier": "table", "invocations": [],...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_62
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalSingleTaskRequestTest.java", "identifier": "DalSingleTaskRequestTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIsCrossShard() {\n\t\tDalSingleTaskRequest<Integer> test = null;\n\t\tList<Integer> pojos = new ArrayList<>();\n\t\ttest = new DalSingleTaskRequest<>(\"dao_test_sqlsvr_dbShard\", new DalHints(), pojos, new TestSingleTask());\n\t\tassertFalse(test.isCrossShard());\n\t}", "class_me...
{ "fields": [ { "declarator": "caller", "modifier": "private", "original_string": "private String caller;", "type": "String", "var_name": "caller" }, { "declarator": "logicDbName", "modifier": "private", "original_string": "private String logicDbName;", ...
{ "body": "@Override\n public boolean isCrossShard() {\n // The single task request is always executed as if the pojos are not corss shard even they really are.\n return false;\n }", "class_method_signature": "DalSingleTaskRequest.isCrossShard()", "constructor": false, "full_signature": "@Ov...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_4
{ "fields": [ { "declarator": "databaseResource", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private DatabaseResource databaseResource;", "type": "DatabaseResource", "var_name": "databaseResource" }, { "declarator": "dalGroupDBDao", ...
{ "body": "@Test\n public void getAllNameBasesTest() throws Exception {\n PowerMockito.mockStatic(CustomizedResource.class);\n PowerMockito.when(CustomizedResource.getInstance()).thenReturn(customizedResource);\n Mockito.when(customizedResource.getDBLevelInfoApiClassName()).thenReturn(\"com.ct...
{ "fields": [ { "declarator": "classLoader", "modifier": "private static", "original_string": "private static ClassLoader classLoader;", "type": "ClassLoader", "var_name": "classLoader" }, { "declarator": "mapper = new ObjectMapper()", "modifier": "private static"...
{ "body": "@GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllNamebases\")\n public Status getAllNameBases() {\n try {\n Status status = Status.OK();\n String className = CustomizedResource.getInstance().getDBLevelInfoApiClassName();\n Class<?> clazz = Class....
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_35
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/configure/ConnectionStringParserTest.java", "identifier": "ConnectionStringParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseMySqlUrl4() {\n String ipUrl = \"jdbc:mysql://address=(type=master)(protocol=tcp)(host=10.1.1.1)(port=3308):3306:3306/\";\n String domainUrl = \"jdbc:mysql://address=(type=master)(protocol=tcp)(host=test.db.com)(port=3308):3306:3306/\";\n HostAndPort ipA...
{ "fields": [ { "declarator": "parser = null", "modifier": "private static", "original_string": "private static ConnectionStringParser parser = null;", "type": "ConnectionStringParser", "var_name": "parser" }, { "declarator": "dburlPattern =\n Pattern.compile...
{ "body": "public static HostAndPort parseHostPortFromURL(String url) {\n if (StringUtils.isEmpty(url)) {\n return new HostAndPort();\n }\n\n if (url.toLowerCase().startsWith(MYSQL_URL_PREFIX)) {\n String host = null;\n Integer port = null;\n\n // jdbc:...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_121
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testGreaterThanEquals() throws SQLException {\n Clause test = greaterThanEquals(template);\n setEnv(test);\n\n assertEquals(wrappedTemplate + \" >= ?\", test.build());\n }", "class_method_signature": "ExpressionsTest.testGreaterThanEquals()", "constructor"...
{ "fields": [ { "declarator": "NULL = new NullExpression()", "modifier": "public static final", "original_string": "public static final NullExpression NULL = new NullExpression();", "type": "NullExpression", "var_name": "NULL" }, { "declarator": "TRUE = new ImmutableExp...
{ "body": "public static ColumnExpression greaterThanEquals(String name) {\n return columnExpression(\"%s >= ?\", name);\n }", "class_method_signature": "Expressions.greaterThanEquals(String name)", "constructor": false, "full_signature": "public static ColumnExpression greaterThanEquals(String name)"...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_176
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/DalSingleResultExtractorTest.java", "identifier": "DalSingleResultExtractorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testExtract() {\n\t\tDalColumnMapRowMapper mapper = new DalColumnMapRowMapper();\n\t\tDalSingleResultExtractor test = new DalSingleResultExtractor(mapper, true);\n\t\t\n\t\t\n\t}", "class_method_signature": "DalSingleResultExtractorTest.testExtract()", "constructor": false, "full...
{ "fields": [ { "declarator": "mapper", "modifier": "private", "original_string": "private DalRowMapper<T> mapper;", "type": "DalRowMapper<T>", "var_name": "mapper" }, { "declarator": "requireSingle", "modifier": "private", "original_string": "private boolea...
{ "body": "@Override\n\tpublic T extract(ResultSet rs) throws SQLException {\n\t\tT result = null;\n\t\t\n\t\tcheckHints(rs);\n\t\t\n\t\tif(rs.next()) {\n\t\t\tresult = mapper.map(rs, 0);\n\t\t\tif(rs.next() && requireSingle)\n\t\t\t\tthrow new DalException(ErrorCode.AssertSingle);\n\t\t}\n\t\treturn result;\n\t}", ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_19
{ "fields": [ { "declarator": "cluster", "modifier": "private static", "original_string": "private static Cluster cluster;", "type": "Cluster", "var_name": "cluster" } ], "file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe...
{ "body": "@Test\n public void getTableShardNullTest() {\n final String tableShardIndex = cluster.getTableShard(\"table1\", new TableShardContext(\"whatever\"));\n Assert.assertNull(tableShardIndex);\n }", "class_method_signature": "DefaultClusterTest.getTableShardNullTest()", "constructor": f...
{ "fields": [ { "declarator": "clusterConfig", "modifier": "private", "original_string": "private ClusterConfigImpl clusterConfig;", "type": "ClusterConfigImpl", "var_name": "clusterConfig" }, { "declarator": "databaseShards = new HashMap<>()", "modifier": "privat...
{ "body": "@Override\n public String getTableShard(String tableName, TableShardContext context) {\n return shardStrategyProxy.getTableShard(tableName, context);\n }", "class_method_signature": "DefaultCluster.getTableShard(String tableName, TableShardContext context)", "constructor": false, "full_s...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_160
{ "fields": [ { "declarator": "connectionString = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String connectionString = \"dao_test_sqlsvr\";", "type": "String", "var_name": "connectionString" } ], "file": "dal-client/src/...
{ "body": "@Test\n\tpublic void testGetConn() throws SQLException {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tDalConnection test = getConnection();\n\t\t\tassertNotNull(test.getConn());\n\t\t} catch (Throwable e){\n\t\t\tfail();\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\tif(conn != null)\n\t\t\t\tconn.clo...
{ "fields": [ { "declarator": "oldIsolationLevel", "modifier": "private", "original_string": "private Integer oldIsolationLevel;", "type": "Integer", "var_name": "oldIsolationLevel" }, { "declarator": "newIsolationLevel", "modifier": "private", "original_str...
{ "body": "public Connection getConn() {\n return conn;\n }", "class_method_signature": "DalConnection.getConn()", "constructor": false, "full_signature": "public Connection getConn()", "identifier": "getConn", "invocations": [], "modifiers": "public", "parameters": "()", "return": "Connecti...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_137
{ "fields": [ { "declarator": "logicDbName = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";", "type": "String", "var_name": "logicDbName" }, { "declarator": "logicShardDbName =...
{ "body": "@Test\n\tpublic void testValidate() {\n\t\tDalTransaction test = null;\n\t\ttry {\n\t\t\ttest = new DalTransaction(getDalConnection(), logicDbName);\n\t\t\ttest.validate(logicDbName, null);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\n\t\t}finally {\n\t\t\tif(test != null && tes...
{ "fields": [ { "declarator": "logicDbName", "modifier": "private", "original_string": "private String logicDbName;", "type": "String", "var_name": "logicDbName" }, { "declarator": "connHolder", "modifier": "private", "original_string": "private DalConnectio...
{ "body": "public void validate(String desiganateLogicDbName, String desiganateShard) throws SQLException {\n if (desiganateLogicDbName == null || desiganateLogicDbName.length() == 0)\n throw new DalException(ErrorCode.LogicDbEmpty);\n\n if (!desiganateLogicDbName.equals(this.logicDbName))\n ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_58
{ "fields": [ { "declarator": "all = new ConcurrentHashMap<>()", "modifier": "static", "original_string": "static ConcurrentHashMap<String, Object> all = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<String, Object>", "var_name": "all" } ], "file": "dal-client/src/t...
{ "body": "@Test\n\tpublic void testExecuteNullable() {\n\t\tDalRequestExecutor test = new DalRequestExecutor();\n\t\tTestDalRequest request = new TestDalRequest(null, new Integer[]{null});\n\t\tDalHints hints = new DalHints();\n\t\t\n\t\ttry {\n\t\t\tInteger result = test.execute(hints, request, true);\n\t\t\tassert...
{ "fields": [ { "declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()", "modifier": "private static final", "original_string": "private static final ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();", "type": "ILogger", "var_name": "LOGGER" }, { "declara...
{ "body": "public <T> T execute(final DalHints hints, final DalRequest<T> request) throws SQLException {\n\t\treturn execute(hints, request, null);\n\t}", "class_method_signature": "DalRequestExecutor.execute(final DalHints hints, final DalRequest<T> request)", "constructor": false, "full_signature": "public T ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_140
{ "fields": [ { "declarator": "logicDbName = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";", "type": "String", "var_name": "logicDbName" }, { "declarator": "logicShardDbName =...
{ "body": "@Test\n\tpublic void testEndTransaction() {\n\t\tDalTransaction test = null;\n\t\ttry {\n\t\t\ttest = new DalTransaction(getDalConnection(), logicDbName);\n\t\t\tassertEquals(0, test.getLevel());\n\t\t\tint level = test.startTransaction();\n\t\t\tassertEquals(1, test.getLevel());\n\t\t\t\n\t\t\ttest.endTra...
{ "fields": [ { "declarator": "logicDbName", "modifier": "private", "original_string": "private String logicDbName;", "type": "String", "var_name": "logicDbName" }, { "declarator": "connHolder", "modifier": "private", "original_string": "private DalConnectio...
{ "body": "public void endTransaction(int startLevel) throws SQLException {\n if (rolledBack || completed)\n throw new DalException(ErrorCode.TransactionState);\n\n if (startLevel != (level - 1)) {\n rollback();\n throw new DalException(ErrorCode.TransactionLevelMatch, (...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_78
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testSetInNullable() throws SQLException {\n AbstractFreeSqlBuilder test = new AbstractFreeSqlBuilder();\n test.setLogicDbName(logicDbName);\n StatementParameters p = new StatementParameters();\n test.with(p);\n \n List<String> paras = new Arr...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder setInNullable(String name, List<?> values, int sqlType) {\n setIn(name, values, sqlType);\n getParameters().nullable();\n return this;\n }", "class_method_signature": "AbstractFreeSqlBuilder.setInNullable(String name, List<?> values, int sqlType)", ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_117
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testBracket() throws SQLException {\n Clause test = bracket(expression(template));\n setEnv(test);\n\n assertEquals(\"(\"+template+\")\", test.build());\n }", "class_method_signature": "ExpressionsTest.testBracket()", "constructor": false, "full_signatur...
{ "fields": [ { "declarator": "NULL = new NullExpression()", "modifier": "public static final", "original_string": "public static final NullExpression NULL = new NullExpression();", "type": "NullExpression", "var_name": "NULL" }, { "declarator": "TRUE = new ImmutableExp...
{ "body": "public static Clause bracket(String... templates) {\n return bracket(expressions(templates));\n }", "class_method_signature": "Expressions.bracket(String... templates)", "constructor": false, "full_signature": "public static Clause bracket(String... templates)", "identifier": "bracket", ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_97
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testNot() {\n AbstractFreeSqlBuilder test = create();\n test.not();\n assertEquals(\"NOT\", test.build());\n }", "class_method_signature": "AbstractFreeSqlBuilderTest.testNot()", "constructor": false, "full_signature": "@Test public void testNot()", "i...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder not() {\n return append(Expressions.NOT);\n }", "class_method_signature": "AbstractFreeSqlBuilder.not()", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder not()", "identifier": "not", "invocations": [ "append" ], "modifiers": "...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_8
{ "fields": [ { "declarator": "daoOfDatabaseSet", "modifier": "@Mock\n private", "original_string": "@Mock\n private DaoOfDatabaseSet daoOfDatabaseSet;", "type": "DaoOfDatabaseSet", "var_name": "daoOfDatabaseSet" } ], "file": "dal-dao-gen/src/test/java/com/ctrip/platfor...
{ "body": "@Test\n public void getAllInOneNameByNameOnlyTest() throws SQLException {\n String dbname = \"abtest_dalcluster\";\n assertEquals(dbname, AllInOneNameUtils.getAllInOneNameByNameOnly(dbname));\n\n PowerMockito.mockStatic(BeanGetter.class);\n PowerMockito.when(BeanGetter.getDao...
{ "fields": [], "file": "dal-dao-gen/src/main/java/com/ctrip/platform/dal/daogen/utils/AllInOneNameUtils.java", "identifier": "AllInOneNameUtils", "interfaces": "", "methods": [ { "class_method_signature": "AllInOneNameUtils.getAllInOneName(String dbName, String modeType)", "constructor": fals...
{ "body": "public static String getAllInOneNameByNameOnly (String dbName) throws SQLException {\n if (dbName != null && dbName.length() > 11 && DbModeTypeEnum.Cluster.getDes().equals(dbName.substring(dbName.length() - 10))) {\n return dbName;\n } else {\n return BeanGetter.getDaoOf...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_81
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testAppendColumn() {\n AbstractFreeSqlBuilder test = create();\n test.appendColumn(template);\n test.setLogicDbName(logicDbName);\n assertEquals(\"[\" + template + \"]\", test.build());\n \n test = create();\n test.appendColumn(templat...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder appendColumn(String name) {\n return append(column(name));\n }", "class_method_signature": "AbstractFreeSqlBuilder.appendColumn(String name)", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder appendColumn(String name)", "identifier": "ap...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_101
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testGreaterThan() {\n testExpression(wrappedTemplate + \" > ?\", new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().greaterThan(template);\n }\n public AbstractFreeSqlBuilder createExpWithP...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder greaterThan(String name) {\n return append(Expressions.greaterThan(name));\n }", "class_method_signature": "AbstractFreeSqlBuilder.greaterThan(String name)", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder greaterThan(String name)", "id...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_39
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/configure/ConnectionStringParserTest.java", "identifier": "ConnectionStringParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseSqlServerUrl() {\n String ipUrl = \"jdbc:sqlserver://10.1.1.1:1433;sslProtocol=TLS;databaseName=test\";\n String domainUrl = \"jdbc:sqlserver://test.db.com:1433;sslProtocol=TLS;databaseName=test\";\n HostAndPort ipAndPort = ConnectionStringParser.parseHo...
{ "fields": [ { "declarator": "parser = null", "modifier": "private static", "original_string": "private static ConnectionStringParser parser = null;", "type": "ConnectionStringParser", "var_name": "parser" }, { "declarator": "dburlPattern =\n Pattern.compile...
{ "body": "public static HostAndPort parseHostPortFromURL(String url) {\n if (StringUtils.isEmpty(url)) {\n return new HostAndPort();\n }\n\n if (url.toLowerCase().startsWith(MYSQL_URL_PREFIX)) {\n String host = null;\n Integer port = null;\n\n // jdbc:...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_156
{ "fields": [ { "declarator": "logicDbName = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";", "type": "String", "var_name": "logicDbName" } ], "file": "dal-client/src/test/java/com/c...
{ "body": "@Test\n\tpublic void testDoInTransactionCommitFail() {\n\t\tfinal DalHints hints = new DalHints();\n\t\ttry {\n\t\t\tfinal DalTransactionManager test = new DalTransactionManager(getCustomDalConnectionManager());\n\t\t\tConnectionAction<?> action = new ConnectionAction<Object>() {\n\t\t\t\tpublic Object exe...
{ "fields": [ { "declarator": "connManager", "modifier": "private", "original_string": "private DalConnectionManager connManager;", "type": "DalConnectionManager", "var_name": "connManager" }, { "declarator": "transactionHolder = new ThreadLocal<DalTransaction>()", ...
{ "body": "public <T> T doInTransaction(ConnectionAction<T> action, DalHints hints) throws SQLException {\n action.initLogEntry(connManager.getLogicDbName(), hints);\n action.start();\n\n Throwable ex = null;\n T result = null;\n int level;\n try {\n level = startT...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_42
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/ShardedIntArrayResultMergerTest.java", "identifier": "ShardedIntArrayResultMergerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testMerge() {\n\t\tShardedIntArrayResultMerger test = new ShardedIntArrayResultMerger();\n\t\ttry {\n\t\t\ttest.recordPartial(\"1\", new Integer[] {0, 1, 2, 3});\n\t\t\ttest.addPartial(\"1\", new int[] {0, 1, 2, 3});\n\t\t\t\n\t\t\ttest.recordPartial(\"2\", new Integer[] {4, 5, 6});\n\...
{ "fields": [ { "declarator": "indexByShard = new HashMap<>()", "modifier": "private", "original_string": "private Map<String , Integer[]> indexByShard = new HashMap<>();", "type": "Map<String , Integer[]>", "var_name": "indexByShard" }, { "declarator": "affectedRowsMap...
{ "body": "@Override\n\tpublic int[] merge() throws SQLException {\n\t\tint[] affectedRowsList = new int[affectedRowsMap.size()];\n\t\t\n\t\tint i = 0;\n\t\tfor(Integer affectedRows: affectedRowsMap.values())\n\t\t\taffectedRowsList[i++] = affectedRows;\n\t\t\n\t\treturn affectedRowsList;\n\t}", "class_method_signa...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_15
{ "fields": [ { "declarator": "cluster", "modifier": "private static", "original_string": "private static Cluster cluster;", "type": "Cluster", "var_name": "cluster" } ], "file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe...
{ "body": "@Test\n public void getDbShardIndexShardOffsetTest() {\n final DbShardContext context = new DbShardContext(\"whatever\");\n final Map<String, Object> data = new HashMap<>();\n data.put(\"id\", 8);\n final ShardData shardData = new MappedShardData(data);\n context.setSh...
{ "fields": [ { "declarator": "clusterConfig", "modifier": "private", "original_string": "private ClusterConfigImpl clusterConfig;", "type": "ClusterConfigImpl", "var_name": "clusterConfig" }, { "declarator": "databaseShards = new HashMap<>()", "modifier": "privat...
{ "body": "@Override\n public Integer getDbShard(String tableName, DbShardContext context) {\n return shardStrategyProxy.getDbShard(tableName, context);\n }", "class_method_signature": "DefaultCluster.getDbShard(String tableName, DbShardContext context)", "constructor": false, "full_signature": "@O...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_183
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/DalRowMapperExtractorTest.java", "identifier": "DalRowMapperExtractorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOOMForLargeCount() throws SQLException {\n DalRowMapperExtractor<Integer> extractor = new DalRowMapperExtractor<>(new DalObjectRowMapper<>(Integer.class), 999999999);\n extractor.extract(new MockResultSet());\n }", "class_method_signature": "DalRowMapperExtract...
{ "fields": [ { "declarator": "COUNT_LIMIT = 5000000", "modifier": "private static final", "original_string": "private static final int COUNT_LIMIT = 5000000;", "type": "int", "var_name": "COUNT_LIMIT" }, { "declarator": "mapper", "modifier": "private", "ori...
{ "body": "@Override\n\tpublic List<T> extract(ResultSet rs) throws SQLException {\n\t\tList<T> result = count == 0 ? new ArrayList<T>() : new ArrayList<T>(Math.min(count, COUNT_LIMIT));\n\t\tif(start != 0)\n\t\t\trs.absolute(start);\n\t\tint i = 0;\n\t\tint rowNum = 0;\n\t\t\n\t\tcheckHints(rs);\n\t\t\n\t\twhile ((i...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_54
{ "fields": [ { "declarator": "all = new ConcurrentHashMap<>()", "modifier": "static", "original_string": "static ConcurrentHashMap<String, Object> all = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<String, Object>", "var_name": "all" } ], "file": "dal-client/src/t...
{ "body": "@Test\n\tpublic void testExecuteFailByValidate() {\n\t\tDalRequestExecutor test = new DalRequestExecutor();\n\t\tSQLException ex = new SQLException(\"Test\");\n\t\tTestDalRequest request = new TestDalRequest(ex, null);\n\t\tDalHints hints = new DalHints();\n\t\t\n\t\ttry {\n\t\t\ttest.execute(hints, reques...
{ "fields": [ { "declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()", "modifier": "private static final", "original_string": "private static final ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();", "type": "ILogger", "var_name": "LOGGER" }, { "declara...
{ "body": "public <T> T execute(final DalHints hints, final DalRequest<T> request) throws SQLException {\n\t\treturn execute(hints, request, null);\n\t}", "class_method_signature": "DalRequestExecutor.execute(final DalHints hints, final DalRequest<T> request)", "constructor": false, "full_signature": "public T ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_55
{ "fields": [ { "declarator": "all = new ConcurrentHashMap<>()", "modifier": "static", "original_string": "static ConcurrentHashMap<String, Object> all = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<String, Object>", "var_name": "all" } ], "file": "dal-client/src/t...
{ "body": "@Test\n\tpublic void testExecuteFailByValidateAsync() {\n\t\tDalRequestExecutor test = new DalRequestExecutor();\n\t\tSQLException ex = new SQLException(\"Test\");\n\t\tTestDalRequest request = new TestDalRequest(ex, null);\n\t\tDalHints hints = new DalHints().asyncExecution();\n\t\t\n\t\ttry {\n\t\t\tasse...
{ "fields": [ { "declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()", "modifier": "private static final", "original_string": "private static final ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();", "type": "ILogger", "var_name": "LOGGER" }, { "declara...
{ "body": "public <T> T execute(final DalHints hints, final DalRequest<T> request) throws SQLException {\n\t\treturn execute(hints, request, null);\n\t}", "class_method_signature": "DalRequestExecutor.execute(final DalHints hints, final DalRequest<T> request)", "constructor": false, "full_signature": "public T ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_182
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/LoggerHelperTest.java", "identifier": "LoggerHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetToString() {\n try {\n Set<String> set1 = new HashSet<>();\n set1.add(\"aa\");\n set1.add(\"bb\");\n set1.add(\"cc\");\n String str1 = LoggerHelper.setToOrderedString(set1);\n\n Set<String> set2 = new Has...
{ "fields": [ { "declarator": "SQLHIDDENString = \"*\"", "modifier": "public static final", "original_string": "public static final String SQLHIDDENString = \"*\";", "type": "String", "var_name": "SQLHIDDENString" }, { "declarator": "NULL_SET = \"NullSet\"", "modi...
{ "body": "public static String setToOrderedString(Set<String> origin) {\n\t\tif (origin == null)\n\t\t\treturn NULL_SET;\n\n\t\tif (origin.size()==0)\n\t\t\treturn EMPTY_SET;\n\n\t\tSet<String> treeSet = new TreeSet<>();\n\t\tfor (String item : origin) {\n\t\t\tif (item != null)\n\t\t\t\ttreeSet.add(item);\n\t\t}\n\...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_14
{ "fields": [ { "declarator": "cluster", "modifier": "private static", "original_string": "private static Cluster cluster;", "type": "Cluster", "var_name": "cluster" } ], "file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe...
{ "body": "@Test\n public void getDbShardTest() {\n final DbShardContext assignationShardIdContext = new DbShardContext(\"whatever\").setShardId(0);\n final Integer AssignationShardIdShardIndex = cluster.getDbShard(\"table13\", assignationShardIdContext);\n Assert.assertEquals(0, (int) Assigna...
{ "fields": [ { "declarator": "clusterConfig", "modifier": "private", "original_string": "private ClusterConfigImpl clusterConfig;", "type": "ClusterConfigImpl", "var_name": "clusterConfig" }, { "declarator": "databaseShards = new HashMap<>()", "modifier": "privat...
{ "body": "@Override\n public Integer getDbShard(String tableName, DbShardContext context) {\n return shardStrategyProxy.getDbShard(tableName, context);\n }", "class_method_signature": "DefaultCluster.getDbShard(String tableName, DbShardContext context)", "constructor": false, "full_signature": "@O...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_43
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/TaskAdapterTest.java", "identifier": "TaskAdapterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetPrimaryKeys() throws SQLException {\n\t\tTaskAdapter<MultipleKeyClientTestModel> test = new TaskAdapter();\n\t\tDalParser<MultipleKeyClientTestModel> parser = new DalDefaultJpaParser<>(MultipleKeyClientTestModel.class);\n\t\t\n\t\ttest.initialize(parser);\n\t\t\n\t\tMultipleKeyC...
{ "fields": [ { "declarator": "GENERATED_KEY = \"GENERATED_KEY\"", "modifier": "public static final", "original_string": "public static final String GENERATED_KEY = \"GENERATED_KEY\";", "type": "String", "var_name": "GENERATED_KEY" }, { "declarator": "COLUMN_SEPARATOR =...
{ "body": "public Map<String, ?> getPrimaryKeys(Map<String, ?> fields) {\n\t\tMap<String, Object> pks = new LinkedHashMap<>();\n\t\tfor(String pkName: parser.getPrimaryKeyNames())\n\t\t\tpks.put(pkName, fields.get(pkName));\n\t\treturn pks;\n\t}", "class_method_signature": "TaskAdapter.getPrimaryKeys(Map<String, ?>...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_38
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/configure/ConnectionStringParserTest.java", "identifier": "ConnectionStringParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseMySqlReplicationUrl() {\n String ipUrl = \"jdbc:mysql:replication://\" +\n \"address=(type=master)(protocol=tcp)(host=10.1.1.1)(port=3308),\" +\n \"address=(type=master)(protocol=tcp)(host=10.2.2.2)(port=3309),\" +\n \"addr...
{ "fields": [ { "declarator": "parser = null", "modifier": "private static", "original_string": "private static ConnectionStringParser parser = null;", "type": "ConnectionStringParser", "var_name": "parser" }, { "declarator": "dburlPattern =\n Pattern.compile...
{ "body": "public static HostAndPort parseHostPortFromURL(String url) {\n if (StringUtils.isEmpty(url)) {\n return new HostAndPort();\n }\n\n if (url.toLowerCase().startsWith(MYSQL_URL_PREFIX)) {\n String host = null;\n Integer port = null;\n\n // jdbc:...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_157
{ "fields": [ { "declarator": "logicDbName = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";", "type": "String", "var_name": "logicDbName" } ], "file": "dal-client/src/test/java/com/c...
{ "body": "@Test\n\tpublic void testRegister() {\n\t\tfinal DalHints hints = new DalHints();\n\t\tfinal DalTransactionListener testListener = new DalTransactionListener(){\n\t\t\t@Override\n\t\t\tpublic void beforeCommit() {\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void beforeRollback() {\n\t\t\t}\n\n\t\t\t@Override...
{ "fields": [ { "declarator": "connManager", "modifier": "private", "original_string": "private DalConnectionManager connManager;", "type": "DalConnectionManager", "var_name": "connManager" }, { "declarator": "transactionHolder = new ThreadLocal<DalTransaction>()", ...
{ "body": "public static void register(DalTransactionListener listener) throws DalException {\n reqiresTransaction();\n Objects.requireNonNull(listener, \"The listener should not be null\");\n\n transactionHolder.get().register(listener);\n }", "class_method_signature": "DalTransactionManage...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_9
{ "fields": [], "file": "dal-dao-gen/src/test/java/com/ctrip/platform/dal/daogen/utils/DalClusterUtilsTest.java", "identifier": "DalClusterUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getModeTypeByDbBaseName() {\n assertEquals(\"titankey\", DalClusterUtils.getModeTypeByDbBaseName(null));\n assertEquals(\"dalcluster\", DalClusterUtils.getModeTypeByDbBaseName(\"abtest_dalcluster\"));\n }", "class_method_signature": "DalClusterUtilsTest.getModeType...
{ "fields": [], "file": "dal-dao-gen/src/main/java/com/ctrip/platform/dal/daogen/utils/DalClusterUtils.java", "identifier": "DalClusterUtils", "interfaces": "", "methods": [ { "class_method_signature": "DalClusterUtils.getModeTypeByDbBaseName( String baseName)", "constructor": false, "fu...
{ "body": "public static String getModeTypeByDbBaseName( String baseName) {\n if (baseName != null && baseName.length() > 11 && DbModeTypeEnum.Cluster.getDes().equals(baseName.substring(baseName.length() - 10))) {\n return DbModeTypeEnum.Cluster.getDes();\n } else {\n return DbMode...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_80
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testAppendWith() {\n AbstractFreeSqlBuilder test = create();\n test.appendWith(COMMA, new Text(template), new Text(elseTemplate));\n assertEquals(\"template, elseTemplate\", test.build());\n \n }", "class_method_signature": "AbstractFreeSqlBuilderTest...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder appendWith(Clause separator, Clause... templates) {\n ClauseList clauses = new ClauseList(templates);\n List<Clause> clauseList = clauses.getList();\n int size = clauseList.size();\n for (Clause clause : clauseList) {\n append(clause);\n ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_100
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testNotEqual() {\n testExpression(wrappedTemplate + \" <> ?\", new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().notEqual(template);\n }\n public AbstractFreeSqlBuilder createExpWithParame...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder notEqual(String name) {\n return append(Expressions.notEqual(name));\n }", "class_method_signature": "AbstractFreeSqlBuilder.notEqual(String name)", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder notEqual(String name)", "identifier": "...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_79
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testAppend() {\n AbstractFreeSqlBuilder test = create();\n test.append(template);\n assertEquals(template, test.build());\n \n test = create();\n test.append(template, template, template);\n assertEquals(\"template template template\",...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder append(String... templates) {\n return append(texts(templates));\n }", "class_method_signature": "AbstractFreeSqlBuilder.append(String... templates)", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder append(String... templates)", "identi...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_116
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testConditionExpression() throws SQLException {\n Clause test = expression(true, template);\n \n setEnv(test);\n assertEquals(template, test.build());\n \n test = expression(false, template);\n \n setEnv(test);\n assertEq...
{ "fields": [ { "declarator": "NULL = new NullExpression()", "modifier": "public static final", "original_string": "public static final NullExpression NULL = new NullExpression();", "type": "NullExpression", "var_name": "NULL" }, { "declarator": "TRUE = new ImmutableExp...
{ "body": "public static Expression expression(String template) {\n return new Expression(template);\n }", "class_method_signature": "Expressions.expression(String template)", "constructor": false, "full_signature": "public static Expression expression(String template)", "identifier": "expression", ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_96
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testOr() {\n AbstractFreeSqlBuilder test = create();\n test.or();\n assertEquals(\"\", test.build());\n\n test = create();\n test.or(template);\n assertEquals(template, test.build());\n \n test = create();\n test.or(templ...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder or() {\n return append(Expressions.OR);\n }", "class_method_signature": "AbstractFreeSqlBuilder.or()", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder or()", "identifier": "or", "invocations": [ "append" ], "modifiers": "publi...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_141
{ "fields": [ { "declarator": "logicDbName = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";", "type": "String", "var_name": "logicDbName" }, { "declarator": "logicShardDbName =...
{ "body": "@Test\n\tpublic void testRollbackTransaction() {\n\t\tDalTransaction test = null;\n\t\ttry {\n\t\t\ttest = new DalTransaction(getDalConnection(), logicDbName);\n\t\t\tassertEquals(0, test.getLevel());\n\t\t\ttest.startTransaction();\n\t\t\ttest.startTransaction();\n\t\t\t\n\t\t\ttest.rollbackTransaction();...
{ "fields": [ { "declarator": "logicDbName", "modifier": "private", "original_string": "private String logicDbName;", "type": "String", "var_name": "logicDbName" }, { "declarator": "connHolder", "modifier": "private", "original_string": "private DalConnectio...
{ "body": "public void rollbackTransaction() throws SQLException {\n if (rolledBack)\n return;\n\n if (level > FIRST_LEVEL) {\n setTransactionStatusOnRollback();\n level--;\n return;\n }\n\n if (status == DalTransactionStatus.Commit || status == ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_136
{ "fields": [ { "declarator": "logicDbName = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";", "type": "String", "var_name": "logicDbName" }, { "declarator": "logicShardDbName =...
{ "body": "@Test\n\tpublic void testDalTransaction() {\n\t\tDalTransaction test = null;\n\t\ttry {\n\t\t\ttest = new DalTransaction(getDalConnection(), logicDbName);\n\t\t\tassertNotNull(test);\n\t\t\tassertFalse(test.getConnection().getConn().getAutoCommit());\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();...
{ "fields": [ { "declarator": "logicDbName", "modifier": "private", "original_string": "private String logicDbName;", "type": "String", "var_name": "logicDbName" }, { "declarator": "connHolder", "modifier": "private", "original_string": "private DalConnectio...
{ "body": "public DalTransaction(DalConnection connHolder, String logicDbName) throws SQLException {\n this.logicDbName = logicDbName;\n this.connHolder = connHolder;\n connHolder.getConn().setAutoCommit(false);\n this.logger = DalClientFactory.getDalLogger();\n }", "class_method_sign...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_59
{ "fields": [ { "declarator": "all = new ConcurrentHashMap<>()", "modifier": "static", "original_string": "static ConcurrentHashMap<String, Object> all = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<String, Object>", "var_name": "all" } ], "file": "dal-client/src/t...
{ "body": "@Test\n\tpublic void testExecuteCallback() {\n\t\tDalRequestExecutor test = new DalRequestExecutor();\n\t\tTestDalRequest request = new TestDalRequest(null, new Integer[]{1});\n\t\tDalHints hints = new DalHints();\n\t\tDefaultResultCallback callback = new DefaultResultCallback();\n\t\t\n\t\ttry {\n\t\t\tIn...
{ "fields": [ { "declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()", "modifier": "private static final", "original_string": "private static final ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();", "type": "ILogger", "var_name": "LOGGER" }, { "declara...
{ "body": "public <T> T execute(final DalHints hints, final DalRequest<T> request) throws SQLException {\n\t\treturn execute(hints, request, null);\n\t}", "class_method_signature": "DalRequestExecutor.execute(final DalHints hints, final DalRequest<T> request)", "constructor": false, "full_signature": "public T ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_161
{ "fields": [ { "declarator": "connectionString = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String connectionString = \"dao_test_sqlsvr\";", "type": "String", "var_name": "connectionString" } ], "file": "dal-client/src/...
{ "body": "@Test\n\tpublic void testGetMeta() throws SQLException {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tDalConnection test = getConnection();\n\t\t\tassertNotNull(test.getMeta());\n\t\t\tLogEntry entry = new LogEntry();\n\t\t\t\n\t\t\tassertNotNull(test.getMeta());\n\t\t\ttest.getMeta().populate(entry); \n...
{ "fields": [ { "declarator": "oldIsolationLevel", "modifier": "private", "original_string": "private Integer oldIsolationLevel;", "type": "Integer", "var_name": "oldIsolationLevel" }, { "declarator": "newIsolationLevel", "modifier": "private", "original_str...
{ "body": "public DbMeta getMeta() {\n return meta;\n }", "class_method_signature": "DalConnection.getMeta()", "constructor": false, "full_signature": "public DbMeta getMeta()", "identifier": "getMeta", "invocations": [], "modifiers": "public", "parameters": "()", "return": "DbMeta", "sign...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_177
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/DalFirstResultMergerTest.java", "identifier": "DalFirstResultMergerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testAddPartial() {\n\t\tDalFirstResultMerger<Object> test = new DalFirstResultMerger<>();\n\t\ttest.addPartial(\"\", null);\n\t\ttest.addPartial(\"\", new Object());\n\t}", "class_method_signature": "DalFirstResultMergerTest.testAddPartial()", "constructor": false, "full_signatur...
{ "fields": [ { "declarator": "result = new ArrayList<>()", "modifier": "private", "original_string": "private List<T> result = new ArrayList<>();", "type": "List<T>", "var_name": "result" }, { "declarator": "comparator", "modifier": "private", "original_str...
{ "body": "@Override\n\tpublic void addPartial(String shard, T partial) {\n\t\tif(partial!=null)\n\t\t\tresult.add(partial);\n\t}", "class_method_signature": "DalFirstResultMerger.addPartial(String shard, T partial)", "constructor": false, "full_signature": "@Override public void addPartial(String shard, T part...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_18
{ "fields": [ { "declarator": "cluster", "modifier": "private static", "original_string": "private static Cluster cluster;", "type": "Cluster", "var_name": "cluster" } ], "file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe...
{ "body": "@Test\n public void getDbShardShardColValuedWorkTest() {\n final DbShardContext context = new DbShardContext(\"whatever\");\n final Map<String, Object> data1 = new HashMap<>();\n data1.put(\"id\", 7);\n final ShardData shardData1 = new MappedShardData(data1);\n context...
{ "fields": [ { "declarator": "clusterConfig", "modifier": "private", "original_string": "private ClusterConfigImpl clusterConfig;", "type": "ClusterConfigImpl", "var_name": "clusterConfig" }, { "declarator": "databaseShards = new HashMap<>()", "modifier": "privat...
{ "body": "@Override\n public Integer getDbShard(String tableName, DbShardContext context) {\n return shardStrategyProxy.getDbShard(tableName, context);\n }", "class_method_signature": "DefaultCluster.getDbShard(String tableName, DbShardContext context)", "constructor": false, "full_signature": "@O...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_120
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testGreaterThan() throws SQLException {\n Clause test = greaterThan(template);\n setEnv(test);\n\n assertEquals(wrappedTemplate + \" > ?\", test.build());\n }", "class_method_signature": "ExpressionsTest.testGreaterThan()", "constructor": false, "full_si...
{ "fields": [ { "declarator": "NULL = new NullExpression()", "modifier": "public static final", "original_string": "public static final NullExpression NULL = new NullExpression();", "type": "NullExpression", "var_name": "NULL" }, { "declarator": "TRUE = new ImmutableExp...
{ "body": "public static ColumnExpression greaterThan(String name) {\n return columnExpression(\"%s > ?\", name);\n }", "class_method_signature": "Expressions.greaterThan(String name)", "constructor": false, "full_signature": "public static ColumnExpression greaterThan(String name)", "identifier": "...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_34
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/configure/ConnectionStringParserTest.java", "identifier": "ConnectionStringParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseMySqlUrl3() {\n String ipUrl = \"jdbc:mysql://(host=10.1.1.1,port=3308,type=master,protocol=tcp)/test?useUnicode=true&characterEncoding=UTF-8\";\n String domainUrl = \"jdbc:mysql://(port=3308,host=test.db.com)/test?useUnicode=true&characterEncoding=UTF-8\";\n ...
{ "fields": [ { "declarator": "parser = null", "modifier": "private static", "original_string": "private static ConnectionStringParser parser = null;", "type": "ConnectionStringParser", "var_name": "parser" }, { "declarator": "dburlPattern =\n Pattern.compile...
{ "body": "public static HostAndPort parseHostPortFromURL(String url) {\n if (StringUtils.isEmpty(url)) {\n return new HostAndPort();\n }\n\n if (url.toLowerCase().startsWith(MYSQL_URL_PREFIX)) {\n String host = null;\n Integer port = null;\n\n // jdbc:...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...