id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
86808110_295 | {
"fields": [],
"file": "annotationprocessor/src/test/java/io/toolisticon/annotationprocessortoolkit/tools/UtilitiesTest.java",
"identifier": "UtilitiesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void convertVarargsToArray_noValues_shouldReturnEmptySet() {\n\n MatcherAssert.assertThat(Arrays.asList(Utilities.convertVarargsToArray()), Matchers.empty());\n\n }",
"class_method_signature": "UtilitiesTest.convertVarargsToArray_noValues_shouldReturnEmptySet()",
"constructo... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/Utilities.java",
"identifier": "Utilities",
"interfaces": "",
"methods": [
{
"class_method_signature": "Utilities.Utilities()",
"constructor": true,
"full_signature": "private Util... | {
"body": "@SafeVarargs\n public static <T> T[] convertVarargsToArray(T... varargs) {\n final Object[] e = {};\n\n if (varargs == null) {\n return (T[]) e;\n }\n return varargs;\n\n }",
"class_method_signature": "Utilities.convertVarargsToArray(T... varargs)",
"constru... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_153 | {
"fields": [
{
"declarator": "testField",
"modifier": "private",
"original_string": "private PublicNoargConstructorNextToOtherConstructors testField;",
"type": "PublicNoargConstructorNextToOtherConstructors",
"var_name": "testField"
},
{
"declarator": "unitTestBuilder ... | {
"body": "@Test\n public void checkWithNoargConstructor() {\n\n unitTestBuilder.useProcessor(new AbstractUnitTestAnnotationProcessorClass() {\n @Override\n protected void testCase(TypeElement element) {\n\n TypeElement typeElement = TypeUtils.TypeRetrieval.getTypeElemen... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/HasPublicNoargConstructorMatcher.java",
"identifier": "HasPublicNoargConstructorMatcher",
"interfaces": "implements ImplicitMatcher<Element>",
"methods": [
{
"class_method_signatur... | {
"body": "@Override\n public boolean check(Element element) {\n\n if (element == null) {\n return false;\n }\n\n\n // check if underlying TypeElement can be found for element\n TypeElement typeElement = TypeUtils.TypeRetrieval.getTypeElement(element.asType());\n if (t... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_368 | {
"fields": [],
"file": "templating/src/test/java/io/toolisticon/annotationprocessortoolkit/templating/templateblocks/ForTemplateBlockTest.java",
"identifier": "ForTemplateBlockTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test_getTemplateBlockType() {\n MatcherAssert.assertThat(new ForTemplateBlock(\"test:abc.def\", \"DEF\").getTemplateBlockType(), Matchers.is(TemplateBlockType.FOR));\n }",
"class_method_signature": "ForTemplateBlockTest.test_getTemplateBlockType()",
"constructor": false... | {
"fields": [
{
"declarator": "ATTRIBUTE_PATTERN = Pattern.compile(\"\\\\s*(\\\\w+?)\\\\s*[:]\\\\s*((?:\\\\w|[.])+?)\\\\s*\")",
"modifier": "private final static",
"original_string": "private final static Pattern ATTRIBUTE_PATTERN = Pattern.compile(\"\\\\s*(\\\\w+?)\\\\s*[:]\\\\s*((?:\\\\w|[.])+... | {
"body": "@Override\n public TemplateBlockType getTemplateBlockType() {\n return TemplateBlockType.FOR;\n }",
"class_method_signature": "ForTemplateBlock.getTemplateBlockType()",
"constructor": false,
"full_signature": "@Override public TemplateBlockType getTemplateBlockType()",
"identifier": "g... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_387 | {
"fields": [],
"file": "templating/src/test/java/io/toolisticon/annotationprocessortoolkit/templating/ModelPathResolverTest.java",
"identifier": "ModelPathResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void getGetter_nonexistingFieldNameShouldReturnNull() {\n\n MatcherAssert.assertThat(ModelPathResolver.getGetter(new GetGetterTestClass(), \"xxx\"), Matchers.nullValue());\n\n }",
"class_method_signature": "ModelPathResolverTest.getGetter_nonexistingFieldNameShouldReturnNull()... | {
"fields": [
{
"declarator": "modelMapThreadLocal = new ThreadLocal<Map<String, Object>>() {\n @Override\n protected Map<String, Object> initialValue() {\n return new HashMap<String, Object>();\n }\n }",
"modifier": "public static",
"original_string": "public ... | {
"body": "protected static String getGetter(Object instance, String fieldNameOrGetter) {\n\n final String[] GETTER_PREFIXES = {\"get\", \"is\", \"has\"};\n\n final String trimmedFieldNameOrGetter = fieldNameOrGetter != null ? fieldNameOrGetter.trim() : null;\n\n if (instance == null || trimmedFi... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_104 | {
"fields": [
{
"declarator": "testField = \"XXX\"",
"modifier": "public",
"original_string": "public String testField = \"XXX\";",
"type": "String",
"var_name": "testField"
},
{
"declarator": "unitTestBuilder = CompileTestBuilder\n .unitTest()\n .... | {
"body": "@Test\n public void checkMismatchingMethod_class() {\n\n unitTestBuilder.useProcessor(new AbstractUnitTestAnnotationProcessorClass() {\n @Override\n protected void testCase(TypeElement element) {\n\n MatcherAssert.assertThat(\"Should return false for non field... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/IsFieldMatcher.java",
"identifier": "IsFieldMatcher",
"interfaces": "implements ImplicitMatcher<ELEMENT>",
"methods": [
{
"class_method_signature": "IsFieldMatcher.check(ELEMENT el... | {
"body": "@Override\n public boolean check(ELEMENT element) {\n return ElementUtils.CheckKindOfElement.isField(element);\n }",
"class_method_signature": "IsFieldMatcher.check(ELEMENT element)",
"constructor": false,
"full_signature": "@Override public boolean check(ELEMENT element)",
"identifier... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_391 | {
"fields": [],
"file": "templating/src/test/java/io/toolisticon/annotationprocessortoolkit/templating/ModelPathResolverTest.java",
"identifier": "ModelPathResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void getGetter_testMethodWithParameter() {\n\n MatcherAssert.assertThat(ModelPathResolver.getGetter(new GetGetterTestClass(), \"methodWithParameter\"), Matchers.is(\"getMethodWithParameter\"));\n\n }",
"class_method_signature": "ModelPathResolverTest.getGetter_testMethodWithPa... | {
"fields": [
{
"declarator": "modelMapThreadLocal = new ThreadLocal<Map<String, Object>>() {\n @Override\n protected Map<String, Object> initialValue() {\n return new HashMap<String, Object>();\n }\n }",
"modifier": "public static",
"original_string": "public ... | {
"body": "protected static String getGetter(Object instance, String fieldNameOrGetter) {\n\n final String[] GETTER_PREFIXES = {\"get\", \"is\", \"has\"};\n\n final String trimmedFieldNameOrGetter = fieldNameOrGetter != null ? fieldNameOrGetter.trim() : null;\n\n if (instance == null || trimmedFi... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_112 | {
"fields": [
{
"declarator": "unitTestBuilder = CompileTestBuilder\n .unitTest()\n .useSource(JavaFileObjectUtils.readFromResource(\"/AnnotationClassAttributeTestClass.java\"))",
"modifier": "private",
"original_string": "private CompileTestBuilder.UnitTestBuilder unitTest... | {
"body": "@Test\n public void checkMatchingAnnotationType() {\n\n unitTestBuilder.useProcessor(new AbstractUnitTestAnnotationProcessorClass() {\n @Override\n protected void testCase(TypeElement element) {\n\n TypeElement typeElement = TypeUtils.TypeRetrieval.getTypeElem... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/IsAnnotationTypeMatcher.java",
"identifier": "IsAnnotationTypeMatcher",
"interfaces": "implements ImplicitMatcher<ELEMENT>",
"methods": [
{
"class_method_signature": "IsAnnotationT... | {
"body": "@Override\n public boolean check(ELEMENT element) {\n return ElementUtils.CheckKindOfElement.isAnnotation(element);\n }",
"class_method_signature": "IsAnnotationTypeMatcher.check(ELEMENT element)",
"constructor": false,
"full_signature": "@Override public boolean check(ELEMENT element)",... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_283 | {
"fields": [
{
"declarator": "unitTestBuilder = CompileTestBuilder\n .unitTest()\n .useSource(JavaFileObjectUtils.readFromResource(\"/AnnotationValueUtilsTestClass.java\"))",
"modifier": "private",
"original_string": "private CompileTestBuilder.UnitTestBuilder unitTestBuil... | {
"body": "@Test\n public void annotationValueUtils_test_getCharValue() {\n\n unitTestBuilder.useProcessor(new AbstractUnitTestAnnotationProcessorClass() {\n @Override\n protected void testCase(TypeElement element) {\n AnnotationMirror annotationMirror = AnnotationUtils.... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/AnnotationValueUtils.java",
"identifier": "AnnotationValueUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "AnnotationValueUtils.AnnotationValueUtils()",
"constructor": ... | {
"body": "public static Character getCharValue(AnnotationValue annotationValue) {\n return !isChar(annotationValue) ? null : (Character) annotationValue.getValue();\n }",
"class_method_signature": "AnnotationValueUtils.getCharValue(AnnotationValue annotationValue)",
"constructor": false,
"full_signat... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_329 | {
"fields": [],
"file": "templating/src/test/java/io/toolisticon/annotationprocessortoolkit/templating/expressions/operands/StringOperandTest.java",
"identifier": "StringOperandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNonMatchingStringPattern() {\n\n // This is more or less a theoretical case\n MatcherAssert.assertThat(new StringOperand(\"'ABC\").value(), Matchers.nullValue());\n MatcherAssert.assertThat(new StringOperand(\"ABC'\").value(), Matchers.nullValue());\n ... | {
"fields": [
{
"declarator": "internalValue",
"modifier": "private final",
"original_string": "private final String internalValue;",
"type": "String",
"var_name": "internalValue"
}
],
"file": "templating/src/main/java/io/toolisticon/annotationprocessortoolkit/templating/expr... | {
"body": "@Override\n public String value() {\n return internalValue;\n }",
"class_method_signature": "StringOperand.value()",
"constructor": false,
"full_signature": "@Override public String value()",
"identifier": "value",
"invocations": [],
"modifiers": "@Override public",
"parameters":... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_145 | {
"fields": [
{
"declarator": "unit = new ByElementKindMatcher()",
"modifier": "private",
"original_string": "private ByElementKindMatcher unit = new ByElementKindMatcher();",
"type": "ByElementKindMatcher",
"var_name": "unit"
}
],
"file": "annotationprocessor/src/test/java/i... | {
"body": "@Test\n public void test_getStringRepresentationOfPassedCharacteristic_happyPath() {\n\n MatcherAssert.assertThat(\"Should return cannonical class name of annotation class\", unit.getStringRepresentationOfPassedCharacteristic(ElementKind.ENUM).equals(ElementKind.ENUM.name()));\n\n }",
"class... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/ByElementKindMatcher.java",
"identifier": "ByElementKindMatcher",
"interfaces": "implements CriteriaMatcher<Element, ElementKind>",
"methods": [
{
"class_method_signature": "ByElem... | {
"body": "@Override\n public String getStringRepresentationOfPassedCharacteristic(ElementKind toGetStringRepresentationFor) {\n return toGetStringRepresentationFor != null ? toGetStringRepresentationFor.name() : null;\n }",
"class_method_signature": "ByElementKindMatcher.getStringRepresentationOfPasse... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_217 | {
"fields": [
{
"declarator": "field = \"sds\"",
"modifier": "private",
"original_string": "private String field = \"sds\";",
"type": "String",
"var_name": "field"
},
{
"declarator": "unitTestBuilder = CompileTestBuilder\n .unitTest()\n .useSource(... | {
"body": "@Test\n public void checkMismatchingVariableElement_nullValuedElement() {\n\n unitTestBuilder.useProcessor(new AbstractUnitTestAnnotationProcessorClass() {\n @Override\n protected void testCase(TypeElement element) {\n\n MatcherAssert.assertThat(\"Should retur... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/IsVariableElementMatcher.java",
"identifier": "IsVariableElementMatcher",
"interfaces": "implements ImplicitMatcher<ELEMENT>",
"methods": [
{
"class_method_signature": "IsVariableE... | {
"body": "@Override\n public boolean check(ELEMENT element) {\n return ElementUtils.CastElement.isVariableElement(element);\n }",
"class_method_signature": "IsVariableElementMatcher.check(ELEMENT element)",
"constructor": false,
"full_signature": "@Override public boolean check(ELEMENT element)",
... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_26 | {
"fields": [
{
"declarator": "list",
"modifier": "",
"original_string": "List<Element> list;",
"type": "List<Element>",
"var_name": "list"
},
{
"declarator": "element1",
"modifier": "",
"original_string": "Element element1;",
"type": "Element",
... | {
"body": "@Test\n public void testImplicitFilter_nullSafety_nullListToFilter() {\n\n ImplicitFilter<Element, ImplicitValidator<Element, ImplicitMatcher<Element>>> unit =\n new ImplicitFilter<Element, ImplicitValidator<Element, ImplicitMatcher<Element>>>(TestCoreMatcherFactory.createElementBa... | {
"fields": [
{
"declarator": "validator",
"modifier": "private final",
"original_string": "private final VALIDATOR validator;",
"type": "VALIDATOR",
"var_name": "validator"
}
],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/filter... | {
"body": "public List<ELEMENT> filter(List<ELEMENT> toFilter) {\n return filter(toFilter, false);\n }",
"class_method_signature": "ImplicitFilter.filter(List<ELEMENT> toFilter)",
"constructor": false,
"full_signature": "public List<ELEMENT> filter(List<ELEMENT> toFilter)",
"identifier": "filter",
... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_352 | {
"fields": [],
"file": "templating/src/test/java/io/toolisticon/annotationprocessortoolkit/templating/expressions/ExpressionParserTest.java",
"identifier": "ExpressionParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void evaluateExpression_withModel_testVariationOfWhitespaces() {\n\n\n Map<String, Object> model = new HashMap<String, Object>();\n model.put(\"value1\", 5L);\n model.put(\"value2\", 6L);\n model.put(\"value3\", null);\n Expression expression = Expressio... | {
"fields": [],
"file": "templating/src/main/java/io/toolisticon/annotationprocessortoolkit/templating/expressions/ExpressionParser.java",
"identifier": "ExpressionParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "ExpressionParser.parseExpression(String expressionString, Map<Strin... | {
"body": "public static Expression parseExpression(String expressionString, Map<String, Object> model) {\n\n ModelPathResolver.modelMapThreadLocal.set(model);\n return parseExpression(expressionString);\n\n }",
"class_method_signature": "ExpressionParser.parseExpression(String expressionString, Ma... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_71 | {
"fields": [
{
"declarator": "unitTestBuilder = CompileTestBuilder\n .unitTest()\n .useSource(JavaFileObjectUtils.readFromResource(\"/AnnotationProcessorTestClass.java\"))",
"modifier": "private",
"original_string": "private CompileTestBuilder.UnitTestBuilder unitTestBuild... | {
"body": "@Test\n public void checkMatchingCase() {\n\n unitTestBuilder.useProcessor(new AbstractUnitTestAnnotationProcessorClass() {\n @Override\n protected void testCase(TypeElement element) {\n\n MatcherAssert.assertThat(\"Should return true for class : \", CoreMatch... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/IsClassMatcher.java",
"identifier": "IsClassMatcher",
"interfaces": "implements ImplicitMatcher<ELEMENT>",
"methods": [
{
"class_method_signature": "IsClassMatcher.check(ELEMENT el... | {
"body": "@Override\n public boolean check(ELEMENT element) {\n return ElementUtils.CheckKindOfElement.isClass(element);\n }",
"class_method_signature": "IsClassMatcher.check(ELEMENT element)",
"constructor": false,
"full_signature": "@Override public boolean check(ELEMENT element)",
"identifier... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_240 | {
"fields": [
{
"declarator": "unit = new ByModifierMatcher()",
"modifier": "private",
"original_string": "private ByModifierMatcher unit = new ByModifierMatcher();",
"type": "ByModifierMatcher",
"var_name": "unit"
}
],
"file": "annotationprocessor/src/test/java/io/toolistico... | {
"body": "@Test\n public void test_checkForMatchingCharacteristic_mismatch() {\n\n Element element = Mockito.mock(Element.class);\n\n\n Set<Modifier> modifierSet = new HashSet<Modifier>();\n modifierSet.add(Modifier.FINAL);\n\n Mockito.when(element.getModifiers()).thenReturn(modifierSe... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/ByModifierMatcher.java",
"identifier": "ByModifierMatcher",
"interfaces": "implements CriteriaMatcher<Element, Modifier>",
"methods": [
{
"class_method_signature": "ByModifierMatch... | {
"body": "@Override\n public boolean checkForMatchingCharacteristic(Element element, Modifier toCheckFor) {\n return (element != null && toCheckFor != null) && element.getModifiers().contains(toCheckFor);\n }",
"class_method_signature": "ByModifierMatcher.checkForMatchingCharacteristic(Element element... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_305 | {
"fields": [],
"file": "templating/src/test/java/io/toolisticon/annotationprocessortoolkit/templating/expressions/operands/UnaryOperationWrapperOperandTest.java",
"identifier": "UnaryOperationWrapperOperandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test_unaryOperationType_successfulPath_getOperandsJavaType() {\n\n UnaryOperationWrapperOperand unit = new UnaryOperationWrapperOperand(new BooleanOperand(\"true\"), OperationType.NEGATE);\n MatcherAssert.assertThat( (Class)unit.getOperandsJavaType(), Matchers.equalTo((... | {
"fields": [
{
"declarator": "operand",
"modifier": "private final",
"original_string": "private final Operand operand;",
"type": "Operand",
"var_name": "operand"
},
{
"declarator": "unaryOperationType",
"modifier": "private final",
"original_string": "priv... | {
"body": "@Override\n public Class<Object> getOperandsJavaType() {\n\n if (resultOperand == null) {\n calculateResultOperand();\n }\n\n return resultOperand.getOperandsJavaType();\n }",
"class_method_signature": "UnaryOperationWrapperOperand.getOperandsJavaType()",
"construc... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_186 | {
"fields": [],
"file": "annotationprocessor/src/test/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/IsAttributeFieldMatcherTest.java",
"identifier": "IsAttributeFieldMatcherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test_isAttributeField_match__shouldReturnTrue() {\n\n CompileTestBuilder\n .unitTest()\n .useSource(JavaFileObjectUtils.readFromResource(\"/AnnotationProcessorUnitTestClassInternal.java\"))\n .useProcessor(new AbstractUnitTestAnnota... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/IsAttributeFieldMatcher.java",
"identifier": "IsAttributeFieldMatcher",
"interfaces": "implements ImplicitMatcher<VariableElement>",
"methods": [
{
"class_method_signature": "IsAtt... | {
"body": "@Override\n public boolean check(VariableElement element) {\n\n if (element == null || element.getKind() != ElementKind.FIELD) {\n return false;\n }\n\n\n return BeanUtils.isAttribute(element);\n }",
"class_method_signature": "IsAttributeFieldMatcher.check(VariableEl... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_169 | {
"fields": [
{
"declarator": "NAME = \"NAME\"",
"modifier": "private final static",
"original_string": "private final static String NAME = \"NAME\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "unit = new ByQualifiedNameMatcher()",
"modifier": "priv... | {
"body": "@Test\n public void test_checkForMatchingCharacteristic_mismatch_class() {\n\n TypeElement element = Mockito.mock(TypeElement.class);\n\n Name nameOfElement = Mockito.mock(Name.class);\n Mockito.when(nameOfElement.toString()).thenReturn(\"XXX\");\n\n Mockito.when(element.getK... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/ByQualifiedNameMatcher.java",
"identifier": "ByQualifiedNameMatcher",
"interfaces": "implements CriteriaMatcher<Element, String>",
"methods": [
{
"class_method_signature": "ByQuali... | {
"body": "@Override\n public boolean checkForMatchingCharacteristic(Element element, String toCheckFor) {\n\n if (element == null || toCheckFor == null) {\n return false;\n }\n\n switch (element.getKind()) {\n case ENUM:\n case INTERFACE:\n case ANN... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_256 | {
"fields": [
{
"declarator": "MESSSAGE = \"message ${0} : ${1}\"",
"modifier": "final static",
"original_string": "final static String MESSSAGE = \"message ${0} : ${1}\";",
"type": "String",
"var_name": "MESSSAGE"
},
{
"declarator": "MESSAGE_ARG_1 = \"A\"",
"modi... | {
"body": "@Test\n public void createMessage_greaterNumberOfParameters() {\n\n MatcherAssert.assertThat(MessagerUtils.createMessage(\"TEST ${0}, ${2}, ${1}\", 1, \"YES\", true, \"WTF\"), Matchers.is(\"TEST 1, true, YES\"));\n\n }",
"class_method_signature": "MessagerUtilsTest.createMessage_greaterNumbe... | {
"fields": [
{
"declarator": "printMessageCodes = false",
"modifier": "private static",
"original_string": "private static boolean printMessageCodes = false;",
"type": "boolean",
"var_name": "printMessageCodes"
}
],
"file": "annotationprocessor/src/main/java/io/toolisticon/a... | {
"body": "public static String createMessage(String message, Object... messageParameters) {\n\n // use custom message\n String result = message;\n\n if (messageParameters != null) {\n\n for (int i = 0; i < messageParameters.length; i++) {\n result = result.replaceAll(\"... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_67 | {
"fields": [
{
"declarator": "unitTestBuilder = CompileTestBuilder\n .unitTest()\n .useSource(JavaFileObjectUtils.readFromResource(\"/testcases.commands/GetAttributesCommandTestClass.java\"))",
"modifier": "private",
"original_string": "private CompileTestBuilder.UnitTestB... | {
"body": "@Test\n public void shouldExecuteSuccessfullyGetterAndSetterAnnotatedMethod() {\n\n unitTestBuilder.useProcessor(\n new AbstractUnitTestAnnotationProcessorClass() {\n @Override\n protected void testCase(TypeElement element) {\n\n ... | {
"fields": [
{
"declarator": "INSTANCE = new GetAttributesCommand()",
"modifier": "public final static",
"original_string": "public final static GetAttributesCommand INSTANCE = new GetAttributesCommand();",
"type": "GetAttributesCommand",
"var_name": "INSTANCE"
}
],
"file": ... | {
"body": "@Override\n public AttributeResult[] execute(TypeElement element) {\n\n return BeanUtils.getAttributes(element);\n\n }",
"class_method_signature": "GetAttributesCommand.execute(TypeElement element)",
"constructor": false,
"full_signature": "@Override public AttributeResult[] execute(Type... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_88 | {
"fields": [
{
"declarator": "unit = new ByAnnotationMatcher()",
"modifier": "private",
"original_string": "private ByAnnotationMatcher unit = new ByAnnotationMatcher();",
"type": "ByAnnotationMatcher",
"var_name": "unit"
}
],
"file": "annotationprocessor/src/test/java/io/to... | {
"body": "@Test\n public void test_checkForMatchingCharacteristic_mismatch() {\n\n TestAnnotation annotation = Mockito.mock(TestAnnotation.class);\n Element element = Mockito.mock(Element.class);\n\n Mockito.when(element.getAnnotation(TestAnnotation.class)).thenReturn(null);\n\n Matche... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/ByAnnotationMatcher.java",
"identifier": "ByAnnotationMatcher",
"interfaces": "implements CriteriaMatcher<Element, Class<? extends Annotation>>",
"methods": [
{
"class_method_signa... | {
"body": "@Override\n public boolean checkForMatchingCharacteristic(Element element, Class<? extends Annotation> toCheckFor) {\n return element != null && toCheckFor != null && element.getAnnotation(toCheckFor) != null;\n }",
"class_method_signature": "ByAnnotationMatcher.checkForMatchingCharacteristi... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_313 | {
"fields": [],
"file": "templating/src/test/java/io/toolisticon/annotationprocessortoolkit/templating/expressions/operands/OperandTest.java",
"identifier": "OperandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void OperandType_getOperand_testLong() {\n MatcherAssert.assertThat(OperandType.getOperandType(\"1234\"), Matchers.is(OperandType.LONG));\n }",
"class_method_signature": "OperandTest.OperandType_getOperand_testLong()",
"constructor": false,
"full_signature": "@Test public ... | {
"fields": [],
"file": "templating/src/main/java/io/toolisticon/annotationprocessortoolkit/templating/expressions/operands/Operand.java",
"identifier": "Operand",
"interfaces": "",
"methods": [
{
"class_method_signature": "Operand.Operand()",
"constructor": true,
"full_signature": "publ... | {
"body": "public abstract OperandType getOperandType();",
"class_method_signature": "Operand.getOperandType()",
"constructor": false,
"full_signature": "public abstract OperandType getOperandType()",
"identifier": "getOperandType",
"invocations": [],
"modifiers": "public abstract",
"parameters": "()",
... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_190 | {
"fields": [],
"file": "annotationprocessor/src/test/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/IsAttributeFieldMatcherTest.java",
"identifier": "IsAttributeFieldMatcherTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test_passedNullValue_shouldReturnFalse() {\n\n CompileTestBuilder\n .unitTest()\n .useSource(JavaFileObjectUtils.readFromResource(\"/AnnotationProcessorUnitTestClassInternal.java\"))\n .useProcessor(new AbstractUnitTestAnnotationPro... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/IsAttributeFieldMatcher.java",
"identifier": "IsAttributeFieldMatcher",
"interfaces": "implements ImplicitMatcher<VariableElement>",
"methods": [
{
"class_method_signature": "IsAtt... | {
"body": "@Override\n public boolean check(VariableElement element) {\n\n if (element == null || element.getKind() != ElementKind.FIELD) {\n return false;\n }\n\n\n return BeanUtils.isAttribute(element);\n }",
"class_method_signature": "IsAttributeFieldMatcher.check(VariableEl... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_30 | {
"fields": [
{
"declarator": "unitTestBuilder = CompileTestBuilder\n .unitTest()\n .useSource(JavaFileObjectUtils.readFromResource(\"/AnnotationValueUtilsTestClass.java\"))",
"modifier": "private",
"original_string": "private CompileTestBuilder.UnitTestBuilder unitTestBuil... | {
"body": "@Test\n public void fieldWithImplementedGetterAndSetters_checkHasSetter() {\n\n unitTestBuilder.useSource(JavaFileObjectUtils.readFromResource(\"testcases.beanutils/FieldLevelTestcases.java\"))\n .useProcessor(new AbstractUnitTestAnnotationProcessorClass() {\n @O... | {
"fields": [
{
"declarator": "GETTER_PREFIXES = {\"get\", \"is\", \"has\"}",
"modifier": "protected final static",
"original_string": "protected final static String[] GETTER_PREFIXES = {\"get\", \"is\", \"has\"};",
"type": "String[]",
"var_name": "GETTER_PREFIXES"
},
{
... | {
"body": "public static boolean checkHasSetter(VariableElement field) {\n\n if (field == null || field.getKind() != ElementKind.FIELD) {\n return false;\n }\n\n TypeElement typeElement = ElementUtils.AccessEnclosingElements.<TypeElement>getFirstEnclosingElementOfKind(field, ElementKin... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_201 | {
"fields": [
{
"declarator": "NAME = \"NAME\"",
"modifier": "private final static",
"original_string": "private final static String NAME = \"NAME\";",
"type": "String",
"var_name": "NAME"
},
{
"declarator": "unit = new ByNameRegexMatcher()",
"modifier": "private"... | {
"body": "@Test\n public void test_checkForMatchingCharacteristic_nullValuedParameters() {\n MatcherAssert.assertThat(\"Should return false in case of null valued parameters\", !unit.checkForMatchingCharacteristic(null, null));\n\n }",
"class_method_signature": "ByNameRegexMatcherTest.test_checkForMat... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/ByNameRegexMatcher.java",
"identifier": "ByNameRegexMatcher",
"interfaces": "implements CriteriaMatcher<Element, String>",
"methods": [
{
"class_method_signature": "ByNameRegexMatc... | {
"body": "@Override\n public boolean checkForMatchingCharacteristic(Element element, String toCheckFor) {\n if (element != null && toCheckFor != null) {\n\n Pattern pattern = Pattern.compile(toCheckFor);\n return pattern.matcher(element.getSimpleName().toString()).matches();\n\n ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_344 | {
"fields": [],
"file": "templating/src/test/java/io/toolisticon/annotationprocessortoolkit/templating/expressions/ExpressionParserTest.java",
"identifier": "ExpressionParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void evaluateExpression_withModel_equalOneDynamicNullValue1() {\n\n\n Map<String, Object> model = new HashMap<String, Object>();\n model.put(\"value1\", 5L);\n model.put(\"value2\", null);\n\n Expression expression = ExpressionParser.parseExpression(\"value1 ==... | {
"fields": [],
"file": "templating/src/main/java/io/toolisticon/annotationprocessortoolkit/templating/expressions/ExpressionParser.java",
"identifier": "ExpressionParser",
"interfaces": "",
"methods": [
{
"class_method_signature": "ExpressionParser.parseExpression(String expressionString, Map<Strin... | {
"body": "public static Expression parseExpression(String expressionString, Map<String, Object> model) {\n\n ModelPathResolver.modelMapThreadLocal.set(model);\n return parseExpression(expressionString);\n\n }",
"class_method_signature": "ExpressionParser.parseExpression(String expressionString, Ma... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
86808110_128 | {
"fields": [
{
"declarator": "unitTestBuilder = CompileTestBuilder\n .unitTest()\n .useSource(JavaFileObjectUtils.readFromResource(\"/AnnotationProcessorTestClass.java\"))",
"modifier": "private",
"original_string": "private CompileTestBuilder.UnitTestBuilder unitTestBuild... | {
"body": "@Test\n public void checkMismatchingExecutableElement_class() {\n\n unitTestBuilder.useProcessor(new AbstractUnitTestAnnotationProcessorClass() {\n @Override\n protected void testCase(TypeElement element) {\n\n MatcherAssert.assertThat(\"Should return false fo... | {
"fields": [],
"file": "annotationprocessor/src/main/java/io/toolisticon/annotationprocessortoolkit/tools/matcher/impl/IsExecutableElementMatcher.java",
"identifier": "IsExecutableElementMatcher",
"interfaces": "implements ImplicitMatcher<ELEMENT>",
"methods": [
{
"class_method_signature": "IsExecu... | {
"body": "@Override\n public boolean check(ELEMENT element) {\n return ElementUtils.CastElement.isExecutableElement(element);\n }",
"class_method_signature": "IsExecutableElementMatcher.check(ELEMENT element)",
"constructor": false,
"full_signature": "@Override public boolean check(ELEMENT element... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 86808110,
"size": 2194,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/toolisticon/annotation-processor-toolkit"
} |
45705189_0 | {
"fields": [],
"file": "grassroot-services/src/test/java/za/org/grassroot/services/geo/GeoLocationUtilsTest.java",
"identifier": "GeoLocationUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCenterCalculation1() {\n\t\tArrayList<GeoLocation> locations = Lists.newArrayList(\n\t\t\t\tnew GeoLocation(50.00, 40.00),\n\t\t\t\tnew GeoLocation(70.00, 40.00),\n\t\t\t\tnew GeoLocation(70.00, 40.00)\n\t\t);\n\t\tGeoLocation centralLocation = GeoLocationUtils.centralLocation(loca... | {
"fields": [
{
"declarator": "M_PER_DEGREE = 111045",
"modifier": "private final static",
"original_string": "private final static double M_PER_DEGREE = 111045;",
"type": "double",
"var_name": "M_PER_DEGREE"
},
{
"declarator": "DEFAULT_RADIUS = 5000",
"modifier":... | {
"body": "public static GeoLocation centralLocation(List<GeoLocation> geoLocations) {\n\t\tObjects.requireNonNull(geoLocations);\n\t\tif (geoLocations.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tint locationCount = geoLocations.size();\n\n\t\tif (locationCount == 1) {\n\t\t\treturn geoLocations.iterator().next();\n... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 45705189,
"size": 80562,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/grassrootza/grassroot-platform"
} |
45705189_1 | {
"fields": [],
"file": "grassroot-services/src/test/java/za/org/grassroot/services/geo/GeoLocationUtilsTest.java",
"identifier": "GeoLocationUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCenterCalculation2() {\n\t\tList<GeoLocation> locations = new ArrayList<>();\n\t\tlocations.add(new GeoLocation(121.612016711363d, 32));\n\t\tlocations.add(new GeoLocation(121.849004871905, 31));\n\t\tGeoLocation centralLocation = GeoLocationUtils.centralLocation(locations);\n\t\ta... | {
"fields": [
{
"declarator": "M_PER_DEGREE = 111045",
"modifier": "private final static",
"original_string": "private final static double M_PER_DEGREE = 111045;",
"type": "double",
"var_name": "M_PER_DEGREE"
},
{
"declarator": "DEFAULT_RADIUS = 5000",
"modifier":... | {
"body": "public static GeoLocation centralLocation(List<GeoLocation> geoLocations) {\n\t\tObjects.requireNonNull(geoLocations);\n\t\tif (geoLocations.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tint locationCount = geoLocations.size();\n\n\t\tif (locationCount == 1) {\n\t\t\treturn geoLocations.iterator().next();\n... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 45705189,
"size": 80562,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/grassrootza/grassroot-platform"
} |
45705189_2 | {
"fields": [],
"file": "grassroot-services/src/test/java/za/org/grassroot/services/geo/GeoLocationUtilsTest.java",
"identifier": "GeoLocationUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCenterCalculationWithEmptyInput() {\n\t\tGeoLocation centralLocation = GeoLocationUtils.centralLocation(Collections.emptyList());\n\t\tassertNull(centralLocation);\n\t}",
"class_method_signature": "GeoLocationUtilsTest.testCenterCalculationWithEmptyInput()",
"constructor": fals... | {
"fields": [
{
"declarator": "M_PER_DEGREE = 111045",
"modifier": "private final static",
"original_string": "private final static double M_PER_DEGREE = 111045;",
"type": "double",
"var_name": "M_PER_DEGREE"
},
{
"declarator": "DEFAULT_RADIUS = 5000",
"modifier":... | {
"body": "public static GeoLocation centralLocation(List<GeoLocation> geoLocations) {\n\t\tObjects.requireNonNull(geoLocations);\n\t\tif (geoLocations.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tint locationCount = geoLocations.size();\n\n\t\tif (locationCount == 1) {\n\t\t\treturn geoLocations.iterator().next();\n... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 45705189,
"size": 80562,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/grassrootza/grassroot-platform"
} |
45705189_3 | {
"fields": [],
"file": "grassroot-core/src/test/java/za/org/grassroot/core/util/TestFormatUtil.java",
"identifier": "TestFormatUtil",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFormatDouble() {\n\n assertEquals(\"123\", FormatUtil.formatDoubleToString(123.000));\n assertEquals(\"123\", FormatUtil.formatDoubleToString(123));\n assertEquals(\"123.1\", FormatUtil.formatDoubleToString(123.100));\n assertEquals(\"123.12\", FormatU... | {
"fields": [],
"file": "grassroot-core/src/main/java/za/org/grassroot/core/util/FormatUtil.java",
"identifier": "FormatUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FormatUtil.formatDoubleToString(double d)",
"constructor": false,
"full_signature": "public static St... | {
"body": "public static String formatDoubleToString(double d) {\n if(d == (long) d)\n return String.format(\"%d\",(long)d);\n else\n return String.format(\"%s\",d);\n }",
"class_method_signature": "FormatUtil.formatDoubleToString(double d)",
"constructor": false,
"full_si... | {
"created": null,
"fork": null,
"fork_count": 9,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 45705189,
"size": 80562,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/grassrootza/grassroot-platform"
} |
97518356_122 | {
"fields": [],
"file": "dac/backend/src/test/java/com/dremio/dac/api/TestUserStats.java",
"identifier": "TestUserStats",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetStatsByDate() {\n UserStats.Builder statsBuilder = new UserStats.Builder();\n LocalDate now = LocalDate.now();\n\n // Should log only last 10 days. This should be ignored\n statsBuilder.addUserStat(toEpochMillis(now.minusDays(11)), \"UI\", \"testuser1\");\n\n // S... | {
"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 List<Map<String, Object>> getUserStatsByDate() {\n return userStatsByDate;\n }",
"class_method_signature": "UserStats.getUserStatsByDate()",
"constructor": false,
"full_signature": "public List<Map<String, Object>> getUserStatsByDate()",
"identifier": "getUserStatsByDate",
"invocations... | {
"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_572 | {
"fields": [],
"file": "client/jdbc/src/test/java/com/dremio/jdbc/impl/TypeConvertingSqlAccessorTest.java",
"identifier": "TypeConvertingSqlAccessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test( expected = SQLConversionOverflowException.class )\n public void test_getByte_on_FLOAT_thatOverflows_rejectsIt()\n throws InvalidAccessException {\n final SqlAccessor uut =\n new TypeConvertingSqlAccessor( new FloatStubAccessor( -130f ) );\n try {\n uut.getByte( 0 );\n }\n ... | {
"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_10 | {
"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 testPost460Version() throws Exception {\n final Version version = new Version(\"4.6.1\", 4, 6, 1, 0, \"\");\n assertFalse(SetTableauDefaults.updateOptionsIfNeeded(version, () -> optionManager, true));\n }",
"class_method_signature": "TestSetTableauDefaults.testPost460Version()... | {
"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_437 | {
"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 doNotDeleteUnavailableDatasetWithoutDefinition() throws Exception {\n NamespaceService ns = mock(NamespaceService.class);\n when(ns.getDataset(any())).thenReturn(new DatasetConfig()\n .setFullPathList(ImmutableList.of(\"one\", \"two\... | {
"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_525 | {
"fields": [],
"file": "common/src/test/java/com/dremio/common/utils/TestPathUtils.java",
"identifier": "TestPathUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRelativePath() throws Exception {\n assertEquals(\"a\", PathUtils.relativePath(Path.of(\"/a\"), Path.of(\"/\")));\n assertEquals(\"b\", PathUtils.relativePath(Path.of(\"/a/b\"), Path.of(\"/a\")));\n assertEquals(\"b/c.json\", PathUtils.relativePath(Path.of(\"/a/b/c.json\")... | {
"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 relativePath(Path absolutePath, Path basePath) {\n Preconditions.checkArgument(absolutePath.isAbsolute(), \"absolutePath must be an absolute path\");\n Preconditions.checkArgument(basePath.isAbsolute(), \"basePath must be an absolute path\");\n\n List<String> absolutePathCompo... | {
"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_175 | {
"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 testEqualsReturnsFalseRightNull() {\n assertFalse(KeyUtils.equals(Boolean.TRUE, null));\n }",
"class_method_signature": "KeyUtilsTest.testEqualsReturnsFalseRightNull()",
"constructor": false,
"full_signature": "@Test public void testEqualsReturnsFalseRightNull()",
"identifi... | {
"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_460 | {
"fields": [],
"file": "common/src/test/java/com/dremio/service/TestServiceRegistry.java",
"identifier": "TestServiceRegistry",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReplace() throws Exception {\n doTestReplace(false);\n }",
"class_method_signature": "TestServiceRegistry.testReplace()",
"constructor": false,
"full_signature": "@Test public void testReplace()",
"identifier": "testReplace",
"invocations": [
"doTestReplace"
],
... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(SingletonRegistry.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SingletonRegistry.class);",
"type": "org.slf4j.Logge... | {
"body": "public <T extends Service> T replace(@Nullable T service) {\n if (service == null) {\n return null;\n }\n\n final Service toReplace = wrapService(service);\n\n for(ListIterator<Service> it = services.listIterator(); it.hasNext(); ) {\n Service s = it.next();\n if (toReplace.equal... | {
"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_47 | {
"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 testMatcher() {\n ReplaceMatcher matcher = ReplaceRecommender.getMatcher(\n new ReplacePatternRule(ReplaceSelectionType.MATCHES)\n .setSelectionPattern(\"[ac]\")\n .setIgnoreCase(false));\n Match match = matcher.matches(\"abc\");\n assertNotNull(ma... | {
"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": "public static ReplaceMatcher getMatcher(ReplacePatternRule rule) {\n final String pattern = rule.getSelectionPattern();\n ReplaceSelectionType selectionType = rule.getSelectionType();\n if (rule.getIgnoreCase() != null && rule.getIgnoreCase()) {\n return new ToLowerReplaceMatcher(getMatcher(p... | {
"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_319 | {
"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 matchHardAffinity() throws Exception {\n final Wrapper wrapper = newSplitWrapper(200, 1, 20,\n Collections.singletonList(new EndpointAffinity(N1_EP1, 1.0, true, 20)),\n new ExecutionNodeMap(ImmutableList.of(N1_EP1))\n );\n INSTANCE.parallelizeFragment(wrapper, ne... | {
"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_499 | {
"fields": [],
"file": "common/src/test/java/com/dremio/common/utils/protos/TestBlackListOutput.java",
"identifier": "TestBlackListOutput",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void writeDouble() 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.writeDouble(1, 9, 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 writeDouble(int fieldNumber, double value, boolean repeated) throws IOException {\n if(isBlackListed(fieldNumber)){\n return;\n }\n delegate.writeDouble(fieldNumber, value, repeated);\n }",
"class_method_signature": "BlackListOutput.writeDouble(int fieldNumber, dou... | {
"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_163 | {
"fields": [],
"file": "services/base-rpc/src/test/java/com/dremio/exec/rpc/TestReconnectingConnection.java",
"identifier": "TestReconnectingConnection",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void ensureSecondSuccess() {\n conn(\n r -> r.connectionFailed(FailureType.CONNECTION, new IllegalStateException()),\n r -> r.connectionSucceeded(newRemoteConnection())\n ).runCommand(Cmd.expectSucceed());\n }",
"class_method_signature": "TestReconnectingConnectio... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(this.getClass())",
"modifier": "private final",
"original_string": "private final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(this.getClass());",
"type": "org.slf4j.Logger",
"var_name": "logger"... | {
"body": "public <R extends MessageLite, C extends RpcCommand<R, CONNECTION_TYPE>> void runCommand(C cmd) {\n\n if (closed.get()) {\n cmd.connectionFailed(FailureType.CONNECTION, new IOException(\"Connection has been closed: \" + toString()));\n }\n\n ConnectionRunner r = new ConnectionRunner();\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_533 | {
"fields": [
{
"declarator": "arguments",
"modifier": "private final",
"original_string": "private final List<String> arguments;",
"type": "List<String>",
"var_name": "arguments"
},
{
"declarator": "maxDirectMemory",
"modifier": "private final",
"original_s... | {
"body": "@Test\n public void checkMaxDirectMemory() {\n assertThat(VM.maxDirectMemory(arguments), is(maxDirectMemory));\n }",
"class_method_signature": "TestVM.checkMaxDirectMemory()",
"constructor": false,
"full_signature": "@Test public void checkMaxDirectMemory()",
"identifier": "checkMaxDirectMemor... | {
"fields": [
{
"declarator": "LOGGER = org.slf4j.LoggerFactory.getLogger(VM.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(VM.class);",
"type": "org.slf4j.Logger",
"var_name": "LOGGER"... | {
"body": "private static final long maxDirectMemory() {\n // First try Java8\n try {\n return invokeMaxDirectMemory(\"sun.misc.VM\");\n } catch (ReflectiveOperationException ignored) {\n // ignore\n }\n\n // Try Java9 or higher\n // Only works if jdk.internal is added to the unnamed modul... | {
"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_51 | {
"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 ruleSuggestionsSelectEndingText() {\n // Select ending text in cell\n Selection selection = new Selection(\"col\", \"There are 20 types of people\", 22, 6); // \"people\" is selected\n List<ReplacePatternRule> rules = recommender.getRules(selection, TEXT);\n assertEquals(4,... | {
"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_476 | {
"fields": [],
"file": "common/src/test/java/com/dremio/common/util/TestDremioVersionUtils.java",
"identifier": "TestDremioVersionUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCompatibleNodeEndpoints() {\n NodeEndpoint nep1 = NodeEndpoint.newBuilder()\n .setAddress(\"localhost\")\n .setDremioVersion(DremioVersionInfo.getVersion())\n .build();\n\n ... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(DremioVersionUtils.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DremioVersionUtils.class);",
"type": "org.slf4j.Log... | {
"body": "public static Collection<NodeEndpoint> getCompatibleNodeEndpoints(Collection<NodeEndpoint> nodeEndpoints) {\n List<NodeEndpoint> compatibleNodeEndpoints = new ArrayList<>();\n if (nodeEndpoints != null && !nodeEndpoints.isEmpty()) {\n compatibleNodeEndpoints = nodeEndpoints.stream()\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_564 | {
"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_TINYINT_getsIt() throws InvalidAccessException {\n final SqlAccessor uut1 =\n new TypeConvertingSqlAccessor( new TinyIntStubAccessor( (byte) 127 ) );\n assertThat( uut1.getByte( 0 ), equalTo( (byte) 127 ) );\n final SqlAccessor uut2 =\n new TypeCo... | {
"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_134 | {
"fields": [],
"file": "dac/backend/src/test/java/com/dremio/dac/server/admin/profile/OperatorWrapperTest.java",
"identifier": "OperatorWrapperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMetricsTableHandlesNotRegisteredMetrics() throws IOException {\n\n OperatorProfile op = OperatorProfile\n .newBuilder().addMetric(\n UserBitShared.MetricValue.newBuilder()\n .setMetricId(1)\n .setDoubleValue(200))\n .addMetric(\n User... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(OperatorWrapper.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(OperatorWrapper.class);",
"type": "org.slf4j.Logger",
... | {
"body": "public void addMetrics(JsonGenerator generator) throws IOException {\n if (operatorType == null) {\n return;\n }\n\n final Integer[] metricIds = OperatorMetricRegistry.getMetricIds(coreOperatorTypeMetricsMap, operatorType.getNumber());\n\n if (metricIds.length == 0) {\n return;\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_421 | {
"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 testDeleteAll() {\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\", 100);\n Op... | {
"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 boolean deleteAllOptions(OptionType type) {\n checkArgument(type == OptionType.SYSTEM, \"OptionType must be SYSTEM.\");\n options.put(OPTIONS_KEY, OptionValueProtoList.newBuilder().build());\n notifyListeners();\n return true;\n }",
"class_method_signature": "SystemOption... | {
"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_358 | {
"fields": [
{
"declarator": "ARBTRIARY_LEAF",
"modifier": "private static final",
"original_string": "private static final EmptyValues ARBTRIARY_LEAF;",
"type": "EmptyValues",
"var_name": "ARBTRIARY_LEAF"
},
{
"declarator": "SORT_FACTOR = new TypeValidators.RangeDoubl... | {
"body": "@Test\n public void doubleSortWithExchangeUnbalancedNodes() {\n ExternalSort es1 = new ExternalSort(OpProps.prototype(0, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), ARBTRIARY_LEAF, Collections.emp... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(MemoryAllocationUtilities.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(MemoryAllocationUtilities.class);",
"type": ... | {
"body": "@VisibleForTesting\n static void setMemory(final OptionManager optionManager, Map<Fragment, Wrapper> fragments, long maxMemoryPerNodePerQuery) {\n final ArrayListMultimap<NodeEndpoint, PhysicalOperator> consideredOps = ArrayListMultimap.create();\n final ArrayListMultimap<NodeEndpoint, PhysicalOpera... | {
"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_708 | {
"fields": [
{
"declarator": "mockTempDir",
"modifier": "private static",
"original_string": "private static Path mockTempDir;",
"type": "Path",
"var_name": "mockTempDir"
},
{
"declarator": "mockNestedTempDir",
"modifier": "private static",
"original_string... | {
"body": "@Test(expected = IOException.class)\n public void validateZipDirectoryZipSlipTestUpdirMoreThanNestedCorrectDirFinalDirDifferent() throws IOException {\n // This expected to fail, because this would resolve to /baseTmpDir/nestedTmpDir2/somedir/somefile,\n // which differs from /baseTmpDir/nestedTmpDi... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(NativeLibPluginClassLoader.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(NativeLibPluginClassLoader.class);",
"type"... | {
"body": "@VisibleForTesting\n static void validateZipDirectory(Path tempDirectory, final ZipEntry entry) throws IOException {\n final Path destinationPath = tempDirectory.resolve(entry.getName()).normalize();\n if (!destinationPath.startsWith(tempDirectory)) {\n throw new IOException(String.format(\"JAR... | {
"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_92 | {
"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 testNestedColRef() {\n VirtualDatasetState ds =\n extract(getQueryFromSQL(\"select t.a.Tuesday as tuesday from cp.\\\"json/extract_map.json\\\" as t\"));\n assertEquals(\n new VirtualDatasetState()\n .setFrom(new FromTable(\"\\\"cp\\\".\\\"json/extract_ma... | {
"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_266 | {
"fields": [],
"file": "services/namespace/src/test/java/com/dremio/service/namespace/file/TestFileFormat.java",
"identifier": "TestFileFormat",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAutoGenerateColumnNamesTextFile() throws Exception {\n TextFileConfig fileFormat = new TextFileConfig();\n fileFormat.setAutoGenerateColumnNames(false);\n String tableOptions = fileFormat.toTableOptions();\n assertContains(\"autoGenerateColumnNames => false\", tableOpti... | {
"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_636 | {
"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 testToProtobuFileStatusWithDirectory() throws IOException {\n FileStatus status = new FileStatus(0, true, 0, 0, 1, 2, null, null, null, TEST_PATH);\n\n DFS.FileStatus result = RemoteNodeFileSystem.toProtoFileStatus(status);\n assertEquals(TEST_PATH_STRING, result.getPath());\n... | {
"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_323 | {
"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 multiNodeCluster2() throws Exception {\n final Wrapper wrapper = newWrapper(200, 1, 20,\n ImmutableList.of(\n new EndpointAffinity(N1_EP2, 0.15, true, 50),\n new EndpointAffinity(N2_EP2, 0.15, true, 50),\n new EndpointAffinity(N3_EP1, 0.10, tr... | {
"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_289 | {
"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 onlyInclude() {\n IncludesExcludesFilter f = new IncludesExcludesFilter(Arrays.asList(\"a.*\"), Arrays.asList());\n assertTrue(f.matches(\"alpha\", null));\n assertFalse(f.matches(\"beta\", null));\n }",
"class_method_signature": "TestIncludesExcludesFilter.onlyInclude()",
... | {
"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_118 | {
"fields": [
{
"declarator": "USER_PATH = \"/user/\"",
"modifier": "private static final",
"original_string": "private static final String USER_PATH = \"/user/\";",
"type": "String",
"var_name": "USER_PATH"
},
{
"declarator": "password = \"foo12bar\"",
"modifier"... | {
"body": "@Test\n public void testCreateUser() throws Exception {\n UserInfoRequest userInfo = new UserInfoRequest(null, \"test_new_user\", \"test\", \"new user\",\n \"bla@bla.bla\", \"0\", \"123some_password\", null);\n User savedUser = expectSuccess(getBuilder(getPublicAPI(3).path(USER_PATH))\n .b... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(UserResource.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(UserResource.class);",
"type": "org.slf4j.Logger",
... | {
"body": "@RolesAllowed({\"admin\"})\n @POST\n public User createUser(User user) throws IOException {\n final com.dremio.service.users.User userConfig = UserResource.addUser(of(user, Optional.empty()), user.getPassword(),\n userGroupService, namespaceService);\n\n return User.fromUser(userConfig);\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_548 | {
"fields": [
{
"declarator": "NON_NULL_VALUE = 89723408957L",
"modifier": "public static final",
"original_string": "public static final long NON_NULL_VALUE = 89723408957L;",
"type": "long",
"var_name": "NON_NULL_VALUE"
},
{
"declarator": "DST_VALUE = 1558999993123L",
... | {
"body": "@Test\n public void testGetObject() throws Exception {\n assertEquals(\n new Timestamp(72, 10, 4, 11, 10, 8, (int)TimeUnit.MILLISECONDS.toNanos(957)),\n accessor.getObject(0));\n }",
"class_method_signature": "TestTimeStampMilliAccessor.testGetObject()",
"constructor": false,
"full_sig... | {
"fields": [
{
"declarator": "TYPE = Types.optional(MinorType.TIMESTAMP)",
"modifier": "private static final",
"original_string": "private static final MajorType TYPE = Types.optional(MinorType.TIMESTAMP);",
"type": "MajorType",
"var_name": "TYPE"
},
{
"declarator": "d... | {
"body": "@Override\n public Object getObject(int index) {\n return getTimestamp(index, defaultTimeZone);\n }",
"class_method_signature": "TimeStampMilliAccessor.getObject(int index)",
"constructor": false,
"full_signature": "@Override public Object getObject(int index)",
"identifier": "getObject",
"i... | {
"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_661 | {
"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 testGetFileStatusWithUnknownRemotePath() throws IOException {\n Path path = new Path(\"/tmp/10.0.0.3@file\");\n try {\n fs.getFileStatus(path);\n fail(\"Expected getFileStatus to throw FileNotFoundException\");\n } catch (FileNotFoundException e) {\n // ok\n ... | {
"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_231 | {
"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 testRemoveIndexPutOption() {\n testRemoveIndexPutOptions(\n new KVStore.PutOption[]{indexPutOption},\n new KVStore.PutOption[]{});\n }",
"class_method_signature": "KVStoreOptionUtilityTest.testRemoveIndexPutOption()",
"constructor": false,
"full_signature": "@Test p... | {
"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 KVStore.PutOption[] removeIndexPutOption(KVStore.PutOption... options) {\n if (null == options) {\n return null;\n }\n\n return Arrays\n .stream(options)\n .filter(option -> !(option instanceof IndexPutOption))\n .toArray(KVStore.PutOption[]::new);\n }",
"class... | {
"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_724 | {
"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 testStopCluster() throws Exception {\n assumeNonMaprProfile();\n\n Cluster myCluster = createCluster();\n myCluster.setState(ClusterState.RUNNING);\n myCluster.setStateChangeTime(System.currentTimeMillis());\n\n YarnController controller = Mockito.mock(YarnController.cla... | {
"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": "@Override\n public void stopCluster(Cluster cluster) throws YarnProvisioningHandlingException {\n stopClusterAsync(cluster);\n }",
"class_method_signature": "YarnService.stopCluster(Cluster cluster)",
"constructor": false,
"full_signature": "@Override public void stopCluster(Cluster cluster)",
... | {
"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_374 | {
"fields": [
{
"declarator": "schema",
"modifier": "private",
"original_string": "private Schema schema;",
"type": "Schema",
"var_name": "schema"
},
{
"declarator": "folder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n... | {
"body": "@Test\n public void testDoubleSpec() throws Exception{\n String columnName = \"d\";\n Double expectedValue = Double.valueOf(1.23f);\n PartitionSpec partitionSpec = PartitionSpec\n .builderFor(schema)\n .identity(columnName)\n .build();\n\n IcebergPartitionData icebergPartitionDa... | {
"fields": [
{
"declarator": "partitionType",
"modifier": "private final",
"original_string": "private final Types.StructType partitionType;",
"type": "Types.StructType",
"var_name": "partitionType"
},
{
"declarator": "size",
"modifier": "private final",
"o... | {
"body": "public void setDouble(int position, Double value) {\n set(position, value);\n }",
"class_method_signature": "IcebergPartitionData.setDouble(int position, Double value)",
"constructor": false,
"full_signature": "public void setDouble(int position, Double value)",
"identifier": "setDouble",
"in... | {
"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_6 | {
"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 testLegalUpgrade() throws Exception {\n final ByteString prevEdition = ByteString.copyFrom(\"OSS\".getBytes());\n final ConfigurationEntry configurationEntry = new ConfigurationEntry();\n configurationEntry.setValue(prevEdition);\n final LegacyKVStoreProvider kvStoreProvide... | {
"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_227 | {
"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 testGetCreateOrVersionOptionSingleVersion() {\n // Act\n final Optional<KVStore.PutOption> ret = KVStoreOptionUtility.getCreateOrVersionOption(new KVStore.PutOption[]{versionOption});\n\n // Assert\n assertEquals(versionOption, ret.get());\n }",
"class_method_signature":... | {
"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_677 | {
"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 testDeleteLocalFile() throws IOException {\n try {\n Path path = new Path(\"/foo/bar/file\");\n fs.delete(path, false);\n fail(\"Expected delete call to throw an exception\");\n } catch (IOException e) {\n // ok\n }\n }",
"class_method_signature": "TestP... | {
"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_698 | {
"fields": [],
"file": "plugins/hive3/plugin/src/test/java/com/dremio/exec/store/hive/exec/TestHiveScanBatchCreator.java",
"identifier": "TestHiveScanBatchCreator",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void ensureStoragePluginIsUsedForUsername() throws Exception {\n final String originalName = \"Test\";\n final String finalName = \"Replaced\";\n\n final HiveScanBatchCreator creator = new HiveScanBatchCreator();\n\n final Hive3StoragePlugin plugin = mock(Hive3StoragePlugin.clas... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(HiveScanBatchCreator.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(HiveScanBatchCreator.class);",
"type": "org.slf4j... | {
"body": "@VisibleForTesting\n public UserGroupInformation getUGI(Hive3StoragePlugin storagePlugin, HiveProxyingSubScan config) {\n final String userName = storagePlugin.getUsername(config.getProps().getUserName());\n return HiveImpersonationUtil.createProxyUgi(userName);\n }",
"class_method_signature": "H... | {
"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_732 | {
"fields": [
{
"declarator": "healthMonitorThread",
"modifier": "private",
"original_string": "private YarnContainerHealthMonitor.YarnContainerHealthMonitorThread healthMonitorThread;",
"type": "YarnContainerHealthMonitor.YarnContainerHealthMonitorThread",
"var_name": "healthMonitor... | {
"body": "@Test\n public void testHealthyContainer() throws Exception {\n String containerInfoJson = \"{\\\"container\\\":{\\\"user\\\":\\\"dremio\\\",\\\"state\\\":\\\"NEW\\\"}}\";\n InputStream targetStream = new ByteArrayInputStream(containerInfoJson.getBytes());\n when(connection.getInputStream()).then... | {
"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_159 | {
"fields": [],
"file": "services/jobtelemetry/server/src/test/java/com/dremio/service/jobtelemetry/server/TestProfileMerger.java",
"identifier": "TestProfileMerger",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFragmentCountFromPlanningProfile() {\n final UserBitShared.QueryProfile planningProfile =\n UserBitShared.QueryProfile.newBuilder()\n .setPlan(\"PLAN_VALUE\")\n .setQuery(\"Select * from plan\")\n .setState(UserBitShared.QueryResult.QueryState.COMPLETED... | {
"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_84 | {
"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 testFields() {\n VirtualDatasetState ds = extract(\n getQueryFromSQL(\"select s_suppkey, s_name, s_address from \" + table));\n assertEquals(\n new VirtualDatasetState()\n .setFrom(from)\n .setColumnsList(cols(\"s_suppkey\", \"s_name\", \"s... | {
"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_509 | {
"fields": [],
"file": "common/src/test/java/com/dremio/common/utils/TestUUIDAdapter.java",
"identifier": "TestUUIDAdapter",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGet16BytesFromUUID() {\n UUID uuid = UUID.randomUUID();\n byte[] result = UUIDAdapter.getBytesFromUUID(uuid);\n assertEquals(\"Expected result to be a byte array with 16 elements.\", 16, result.length);\n }",
"class_method_signature": "TestUUIDAdapter.testGet16BytesFrom... | {
"fields": [],
"file": "common/src/main/java/com/dremio/common/utils/UUIDAdapter.java",
"identifier": "UUIDAdapter",
"interfaces": "",
"methods": [
{
"class_method_signature": "UUIDAdapter.UUIDAdapter()",
"constructor": true,
"full_signature": "private UUIDAdapter()",
"identifier... | {
"body": "public static byte[] getBytesFromUUID(UUID uuid) {\n byte[] result = new byte[16];\n long msb = uuid.getMostSignificantBits();\n long lsb = uuid.getLeastSignificantBits();\n for (int i =15;i>=8;i--) {\n result[i] = (byte) (lsb & 0xFF);\n lsb >>= 8;\n }\n for (int i =7;i>=0;i--) ... | {
"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_620 | {
"fields": [],
"file": "plugins/s3/src/test/java/com/dremio/plugins/s3/store/TestS3FileSystem.java",
"identifier": "TestS3FileSystem",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test (expected = ContainerAccessDeniedException.class)\n public void testUnknownContainerExistsButNoPermissions() throws IOException {\n TestExtendedS3FileSystem fs = new TestExtendedS3FileSystem();\n AmazonS3 mockedS3Client = mock(AmazonS3.class);\n when(mockedS3Client.doesBucketExistV2(any(Str... | {
"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_270 | {
"fields": [],
"file": "services/namespace/src/test/java/com/dremio/service/namespace/file/TestFileFormat.java",
"identifier": "TestFileFormat",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefaultExcelFileFormatOptions() throws Exception {\n ExcelFileConfig fileFormat = new ExcelFileConfig();\n String tableOptions = fileFormat.toTableOptions();\n assertContains(\"type => 'excel'\", tableOptions);\n assertContains(\"extractHeader => false\", tableOptions);... | {
"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_335 | {
"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 testTableTypes() {\n Predicate<String> filter =\n MetadataProviderConditions.getTableTypePredicate(Arrays.asList(\"foo\", \"bar\"));\n\n assertTrue(filter.test(\"foo\"));\n assertTrue(filter.test(\"bar\"));\n assertFalse(filter.test(\"baz\"));\n assertFalse(filter.t... | {
"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> getTableTypePredicate(List<String> tableTypeFilter) {\n return tableTypeFilter.isEmpty() ? ALWAYS_TRUE : ImmutableSet.copyOf(tableTypeFilter)::contains;\n }",
"class_method_signature": "MetadataProviderConditions.getTableTypePredicate(List<String> tableTypeFilter)",
... | {
"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_342 | {
"fields": [],
"file": "sabot/kernel/src/test/java/com/dremio/exec/planner/sql/TestSQLConverter.java",
"identifier": "TestSQLConverter",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPassSemicolon() {\n ParserConfig config = new ParserConfig(ParserConfig.QUOTING, 100);\n SqlNode node = SqlConverter.parseSingleStatementImpl(\"select * from t1;\", config, false);\n assertEquals(\"SELECT *\\n\" +\n \"FROM \\\"t1\\\"\", node.toSqlString(CalciteSqlDial... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(SqlConverter.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SqlConverter.class);",
"type": "org.slf4j.Logger",
... | {
"body": "@VisibleForTesting\n static SqlNode parseSingleStatementImpl(String sql, ParserConfig parserConfig, boolean isInnerQuery) {\n SqlNodeList list = parseMultipleStatementsImpl(sql, parserConfig, isInnerQuery);\n if (list.size() > 1) {\n SqlParserPos pos = list.get(1).getParserPosition();\n in... | {
"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_712 | {
"fields": [
{
"declarator": "mockTempDir",
"modifier": "private static",
"original_string": "private static Path mockTempDir;",
"type": "Path",
"var_name": "mockTempDir"
},
{
"declarator": "mockNestedTempDir",
"modifier": "private static",
"original_string... | {
"body": "@Test(expected = IOException.class)\n public void validateZipDirectoryZipSlipTestUpMoreDirs() throws IOException {\n ZipEntry entry = new ZipEntry(\"../../../../../somefile\");\n NativeLibPluginClassLoader.validateZipDirectory(mockTempDir, entry);\n }",
"class_method_signature": "TestNativeLibPlu... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(NativeLibPluginClassLoader.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(NativeLibPluginClassLoader.class);",
"type"... | {
"body": "@VisibleForTesting\n static void validateZipDirectory(Path tempDirectory, final ZipEntry entry) throws IOException {\n final Path destinationPath = tempDirectory.resolve(entry.getName()).normalize();\n if (!destinationPath.startsWith(tempDirectory)) {\n throw new IOException(String.format(\"JAR... | {
"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_207 | {
"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 testValidateOptionsMultipleCreateWithIndex() {\n KVStoreOptionUtility.validateOptions(new KVStore.PutOption[]{createOption, indexPutOption, createOption});\n }",
"class_method_signature": "KVStoreOptionUtilityTest.testValidateOptionsMult... | {
"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_657 | {
"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 testGetFileStatusForUnaccessibleDirectory() throws IOException {\n doThrow(new AccessControlException()).when(mockRemoteFS).getFileStatus(new Path(\"/foo/baz\"));\n\n Path path = new Path(\"/foo/baz\");\n try {\n fs.getFileStatus(path);\n fail(\"Expected some IOExcep... | {
"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_591 | {
"fields": [],
"file": "client/jdbc/src/test/java/com/dremio/jdbc/impl/TypeConvertingSqlAccessorTest.java",
"identifier": "TypeConvertingSqlAccessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test( expected = SQLConversionOverflowException.class )\n public void test_getInt_on_FLOAT_thatOverflows_rejectsIt() throws\n InvalidAccessException {\n final SqlAccessor uut =\n new TypeConvertingSqlAccessor( new FloatStubAccessor( 1e10f ) );\n try {\n uut.getInt( 0 );\n }\n cat... | {
"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_315 | {
"fields": [],
"file": "sabot/kernel/src/test/java/com/dremio/exec/planner/logical/RexToExprTest.java",
"identifier": "RexToExprTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUnsupportedRexNode() {\n try {\n // Create the data type factory.\n RelDataTypeFactory relFactory = SqlTypeFactoryImpl.INSTANCE;\n // Create the rex builder\n RexBuilder rex = new DremioRexBuilder(relFactory);\n RelDataType anyType = relFactory.createSql... | {
"fields": [
{
"declarator": "UNSUPPORTED_REX_NODE_ERROR = \"Cannot convert RexNode to equivalent Dremio expression. \"",
"modifier": "public static final",
"original_string": "public static final String UNSUPPORTED_REX_NODE_ERROR = \"Cannot convert RexNode to equivalent Dremio expression. \";"... | {
"body": "public static LogicalExpression toExpr(ParseContext context, RelDataType rowType, RexBuilder rexBuilder, RexNode expr) {\n return toExpr(context, rowType, rexBuilder, expr, true);\n }",
"class_method_signature": "RexToExpr.toExpr(ParseContext context, RelDataType rowType, RexBuilder rexBuilder, RexNo... | {
"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_600 | {
"fields": [],
"file": "client/jdbc/src/test/java/com/dremio/jdbc/impl/TypeConvertingSqlAccessorTest.java",
"identifier": "TypeConvertingSqlAccessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test_getLong_on_DOUBLE_thatFits_getsIt() throws InvalidAccessException {\n final SqlAccessor uut =\n new TypeConvertingSqlAccessor(\n new DoubleStubAccessor( 9223372036854775807L * 1.0d ) );\n assertThat( uut.getLong( 0 ), equalTo( 9223372036854775807L ) );\n }... | {
"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 long getLong( int rowOffset ) throws InvalidAccessException {\n final long result;\n switch ( getType().getMinorType() ) {\n // 1. Regular type:\n case BIGINT:\n result = innerAccessor.getLong( 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_250 | {
"fields": [],
"file": "services/accelerator/src/test/java/com/dremio/service/reflection/TestReflectionGoalChecker.java",
"identifier": "TestReflectionGoalChecker",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testHashingWithUniqueIdGoal(){\n ReflectionGoal goal = new ReflectionGoal()\n .setId(new ReflectionId(\"xxx\"));\n\n ReflectionGoalHash actual = ReflectionGoalChecker.Instance.calculateReflectionGoalVersion(goal);\n assertEquals(\"a9171a2d1e967b50401388ba1271fba59386adac4... | {
"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_483 | {
"fields": [
{
"declarator": "tracer = new MockTracer()",
"modifier": "private",
"original_string": "private MockTracer tracer = new MockTracer();",
"type": "MockTracer",
"var_name": "tracer"
}
],
"file": "common/src/test/java/com/dremio/common/tracing/TestTracingUtils.java"... | {
"body": "@Test\n public void testTraceWrapperFunction() {\n MockSpan parent = tracer.buildSpan(\"parent\").start();\n final MockSpan[] child = new MockSpan[1];\n final int ret;\n try(Scope s = tracer.activateSpan(parent)) {\n ret = TracingUtils.trace(\n (span) -> {\n span.log(\"som... | {
"fields": [],
"file": "common/src/main/java/com/dremio/common/tracing/TracingUtils.java",
"identifier": "TracingUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "TracingUtils.TracingUtils()",
"constructor": true,
"full_signature": "private TracingUtils()",
"ide... | {
"body": "public static <R> R trace(Function<Span, R> work, Tracer tracer, String operation, String... tags) {\n Span span = TracingUtils.buildChildSpan(tracer, operation, tags);\n try (Scope s = tracer.activateSpan(span)) {\n return work.apply(span);\n } finally {\n span.finish();\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_179 | {
"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 testEqualsReturnsFalseWithBooleanFalseTrue() {\n assertFalse(KeyUtils.equals(Boolean.FALSE, Boolean.TRUE));\n }",
"class_method_signature": "KeyUtilsTest.testEqualsReturnsFalseWithBooleanFalseTrue()",
"constructor": false,
"full_signature": "@Test public void testEqualsReturn... | {
"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_196 | {
"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 testHashString() {\n assertEquals(1819279604, KeyUtils.hash(\"test hash string\"));\n }",
"class_method_signature": "KeyUtilsTest.testHashString()",
"constructor": false,
"full_signature": "@Test public void testHashString()",
"identifier": "testHashString",
"invocations"... | {
"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 int hash(Object... keys) {\n if (null == keys) {\n return 0;\n }\n\n int result = 1;\n for (Object key : keys) {\n result = 31 * result + hashCode(key);\n }\n return result;\n }",
"class_method_signature": "KeyUtils.hash(Object... keys)",
"constructor": false,... | {
"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_303 | {
"fields": [
{
"declarator": "WORD_BITS = 64",
"modifier": "private static final",
"original_string": "private static final int WORD_BITS = 64;",
"type": "int",
"var_name": "WORD_BITS"
}
],
"file": "sabot/kernel/src/test/java/com/dremio/sabot/op/join/vhash/TestMatchBitSet.ja... | {
"body": "@Test\n public void randomBits() throws Exception {\n final int count = 8*1024*1024;\n BitSet bitSet = new BitSet(count);\n final Random rand = new Random();\n try (MatchBitSet matchBitSet = new MatchBitSet(count, allocator)) {\n for (int i = 0; i < count; i ++)\n {\n\n int va... | {
"fields": [
{
"declarator": "LONG_TO_BITS_SHIFT = 6",
"modifier": "private final static",
"original_string": "private final static int LONG_TO_BITS_SHIFT = 6;",
"type": "int",
"var_name": "LONG_TO_BITS_SHIFT"
},
{
"declarator": "BIT_OFFSET_MUSK = (1 << LONG_TO_BITS_SH... | {
"body": "public void set(final int index) {\n final int wordNum = index >>> LONG_TO_BITS_SHIFT;\n final int bit = index & BIT_OFFSET_MUSK;\n final long bitMask = 1L << bit;\n\n final long wordAddr = bufferAddr + wordNum * BYTES_PER_WORD;\n PlatformDependent.putLong(wordAddr, PlatformDependent.getLong... | {
"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_246 | {
"fields": [],
"file": "services/accelerator/src/test/java/com/dremio/service/reflection/TestReflectionGoalChecker.java",
"identifier": "TestReflectionGoalChecker",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCheckHashAgainstNullHash(){\n ReflectionGoal goal = new ReflectionGoal();\n ReflectionEntry entry = new ReflectionEntry();\n\n assertFalse(ReflectionGoalChecker.Instance.checkHash(goal, entry));\n }",
"class_method_signature": "TestReflectionGoalChecker.testCheckHashAga... | {
"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 boolean checkHash(ReflectionGoal goal, ReflectionEntry entry){\n if(null == entry.getReflectionGoalHash()){\n return false;\n }\n return entry.getReflectionGoalHash().equals(calculateReflectionGoalVersion(goal));\n }",
"class_method_signature": "ReflectionGoalChecker.checkHash(Refle... | {
"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_616 | {
"fields": [],
"file": "plugins/s3/src/test/java/com/dremio/plugins/s3/store/TestS3FileSystem.java",
"identifier": "TestS3FileSystem",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testValidRegionFromEndpoint() {\n Region r = S3FileSystem.getAwsRegionFromEndpoint(\"s3-eu-central-1.amazonaws.com\");\n Assert.assertEquals(Region.EU_CENTRAL_1, r);\n\n r = S3FileSystem.getAwsRegionFromEndpoint(\"s3-us-gov-west-1.amazonaws.com\");\n Assert.assertEquals(Reg... | {
"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": "static software.amazon.awssdk.regions.Region getAwsRegionFromEndpoint(String endpoint) {\n // Determine if one of the known AWS regions is contained within the given endpoint, and return that region if so.\n return Optional.ofNullable(endpoint)\n .map(e -> e.toLowerCase(Locale.ROOT)) // lower-ca... | {
"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_495 | {
"fields": [],
"file": "common/src/test/java/com/dremio/common/utils/protos/TestBlackListOutput.java",
"identifier": "TestBlackListOutput",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void writeSInt64() 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.writeSInt64(1, 9, 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 writeSInt64(int fieldNumber, long value, boolean repeated) throws IOException {\n if(isBlackListed(fieldNumber)){\n return;\n }\n delegate.writeSInt64(fieldNumber, value, repeated);\n }",
"class_method_signature": "BlackListOutput.writeSInt64(int fieldNumber, long ... | {
"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_180 | {
"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 testEqualsReturnsTrueWithByteArrays() {\n byte[] left = new byte[]{0, 1, 2, 3, 4};\n byte[] right = new byte[]{0, 1, 2, 3, 4};\n\n assertTrue(KeyUtils.equals(left, right));\n }",
"class_method_signature": "KeyUtilsTest.testEqualsReturnsTrueWithByteArrays()",
"constructor"... | {
"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_704 | {
"fields": [
{
"declarator": "mockTempDir",
"modifier": "private static",
"original_string": "private static Path mockTempDir;",
"type": "Path",
"var_name": "mockTempDir"
},
{
"declarator": "mockNestedTempDir",
"modifier": "private static",
"original_string... | {
"body": "@Test\n public void validateZipDirectoryValidNestedUpdirThenCorrectDir() throws IOException {\n ZipEntry entry = new ZipEntry(\"../nestedTmpDir/somedir/somefile\");\n NativeLibPluginClassLoader.validateZipDirectory(mockNestedTempDir, entry);\n }",
"class_method_signature": "TestNativeLibPluginCla... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(NativeLibPluginClassLoader.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(NativeLibPluginClassLoader.class);",
"type"... | {
"body": "@VisibleForTesting\n static void validateZipDirectory(Path tempDirectory, final ZipEntry entry) throws IOException {\n final Path destinationPath = tempDirectory.resolve(entry.getName()).normalize();\n if (!destinationPath.startsWith(tempDirectory)) {\n throw new IOException(String.format(\"JAR... | {
"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_354 | {
"fields": [
{
"declarator": "folder = new TemporaryFolder()",
"modifier": "@ClassRule\n public static",
"original_string": "@ClassRule\n public static TemporaryFolder folder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "folder"
},
{
"declarator"... | {
"body": "@Test\n public void testExtractColumnName() throws Exception {\n assertEquals(\"foo\", GlobalDictionaryBuilder.getColumnFullPath(\"_foo.dict\"));\n assertEquals(\"a.b.c\", GlobalDictionaryBuilder.getColumnFullPath(\"_a.b.c.dict\"));\n }",
"class_method_signature": "TestGlobalDictionaryBuilder.tes... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(GlobalDictionaryBuilder.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(GlobalDictionaryBuilder.class);",
"type": "org... | {
"body": "public static String getColumnFullPath(String dictionaryFileName) {\n final Matcher matcher = DICTIONARY_FILES_PATTERN.matcher(dictionaryFileName);\n if (matcher.find()) {\n return matcher.group(1);\n }\n return null;\n }",
"class_method_signature": "GlobalDictionaryBuilder.getColumnFul... | {
"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_641 | {
"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 testListStatusRootOneByOne() throws Exception {\n {\n DFS.ListStatusContinuationHandle handle = DFS.ListStatusContinuationHandle.newBuilder().setId(\"test-handle\").build();\n\n DFS.ListStatusResponse listStatusInitialResponse = DFS.ListStatusResponse.newBuilder()\n ... | {
"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": "@Override\n public FileStatus[] listStatus(Path f) throws FileNotFoundException, IOException {\n RemoteIterator<FileStatus> remoteIterator = listStatusIterator(f);\n List<FileStatus> statuses = new ArrayList<>();\n while(remoteIterator.hasNext()) {\n statuses.add(remoteIterator.next());\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_211 | {
"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 testValidateOptionsMultipleVersion() {\n KVStoreOptionUtility.validateOptions(new KVStore.PutOption[]{versionOption, versionOption});\n }",
"class_method_signature": "KVStoreOptionUtilityTest.testValidateOptionsMultipleVersion()",
"con... | {
"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_138 | {
"fields": [
{
"declarator": "jobAttemptProtobuf",
"modifier": "private static",
"original_string": "private static JobProtobuf.JobAttempt jobAttemptProtobuf;",
"type": "JobProtobuf.JobAttempt",
"var_name": "jobAttemptProtobuf"
},
{
"declarator": "jobAttemptProtostuff"... | {
"body": "@Test\n public void testToBuf() {\n JobProtobuf.JobAttempt resultJobAttempt = toBuf(jobAttemptProtostuff);\n assertEquals(resultJobAttempt, jobAttemptProtobuf);\n\n //test for jobFailureInfo\n JobProtobuf.JobFailureInfo jobFailureInfo = toBuf(jobFailureInfoProtoStuff);\n assertEquals(jobFai... | {
"fields": [],
"file": "services/jobs/src/main/java/com/dremio/service/jobs/JobsProtoUtil.java",
"identifier": "JobsProtoUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "JobsProtoUtil.JobsProtoUtil()",
"constructor": true,
"full_signature": "private JobsProtoUtil()",
... | {
"body": "private static <M extends GeneratedMessageV3, T extends Message<T> & Schema<T>>\n M toBuf(Parser<M> protobufParser, T protostuff) {\n try {\n LinkedBuffer buffer = LinkedBuffer.allocate();\n byte[] bytes = ProtobufIOUtil.toByteArray(protostuff, protostuff.cachedSchema(), buffer);\n // Le... | {
"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_568 | {
"fields": [],
"file": "client/jdbc/src/test/java/com/dremio/jdbc/impl/TypeConvertingSqlAccessorTest.java",
"identifier": "TypeConvertingSqlAccessorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test( expected = SQLConversionOverflowException.class )\n public void test_getByte_on_INTEGER_thatOverflows_rejectsIt()\n throws InvalidAccessException {\n final SqlAccessor uut =\n new TypeConvertingSqlAccessor( new IntegerStubAccessor( -129 ) );\n try {\n uut.getByte( 0 );\n }... | {
"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_587 | {
"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_INTEGER_getsIt() throws InvalidAccessException {\n final SqlAccessor uut1 =\n new TypeConvertingSqlAccessor( new IntegerStubAccessor( 2147483647 ) );\n assertThat( uut1.getInt( 0 ), equalTo( 2147483647 ) );\n final SqlAccessor uut2 =\n new TypeConv... | {
"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_285 | {
"fields": [],
"file": "services/scheduler/src/test/java/com/dremio/service/scheduler/TestLocalSchedulerService.java",
"identifier": "TestLocalSchedulerService",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void newThread() {\n LocalSchedulerService service = new LocalSchedulerService(1);\n final Runnable runnable = mock(Runnable.class);\n final Thread thread = service.getExecutorService().getThreadFactory().newThread(runnable);\n\n assertTrue(\"thread should be a daemon thread\", ... | {
"fields": [
{
"declarator": "LOGGER = org.slf4j.LoggerFactory.getLogger(LocalSchedulerService.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(LocalSchedulerService.class);",
"type": "org.slf... | {
"body": "@VisibleForTesting\n public CloseableSchedulerThreadPool getExecutorService() {\n return executorService;\n }",
"class_method_signature": "LocalSchedulerService.getExecutorService()",
"constructor": false,
"full_signature": "@VisibleForTesting public CloseableSchedulerThreadPool getExecutorServi... | {
"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_71 | {
"fields": [
{
"declarator": "recommender = new ExtractMapRecommender()",
"modifier": "private",
"original_string": "private ExtractMapRecommender recommender = new ExtractMapRecommender();",
"type": "ExtractMapRecommender",
"var_name": "recommender"
}
],
"file": "dac/backen... | {
"body": "@Test\n public void testGenExtractMapRuleWrapper() throws Exception {\n TransformRuleWrapper<ExtractMapRule> wrapper = recommender.wrapRule(new ExtractMapRule(\"a\"));\n assertEquals(\"a\", wrapper.getRule().getPath());\n assertEquals(\"extract from map a\", wrapper.describe());\n assertEquals... | {
"fields": [],
"file": "dac/backend/src/main/java/com/dremio/dac/explore/ExtractMapRecommender.java",
"identifier": "ExtractMapRecommender",
"interfaces": "",
"methods": [
{
"class_method_signature": "ExtractMapRecommender.getRules(MapSelection selection, DataType selColType)",
"constructor":... | {
"body": "@Override\n public TransformRuleWrapper<ExtractMapRule> wrapRule(ExtractMapRule rule) {\n return new ExtractMapTransformRuleWrapper(rule);\n }",
"class_method_signature": "ExtractMapRecommender.wrapRule(ExtractMapRule rule)",
"constructor": false,
"full_signature": "@Override public TransformRul... | {
"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_456 | {
"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 testMergePaths() {\n checkMergePaths(Path.of(\"hdfs://hostname/base\"), Path.of(\"/foo/bar\"), Path.of(\"hdfs://hostname/base/foo/bar\"));\n checkMergePaths(Path.of(\"hdfs://hostname/base\"), Path.of(\"foo/bar\"), Path.of(\"hdfs://hostname/base/foo/bar\"));\n checkMergePaths(P... | {
"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 static Path mergePaths(Path path1, Path path2) {\n final String path1Path = path1.uri.getPath();\n final String path2Path = path2.uri.getPath();\n\n if (path2Path.isEmpty()) {\n return path1;\n }\n\n final StringBuilder finalPath = new StringBuilder(path1Path.length() + path2Path... | {
"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_143 | {
"fields": [
{
"declarator": "attemptsHelper",
"modifier": "private",
"original_string": "private AttemptsHelper attemptsHelper;",
"type": "AttemptsHelper",
"var_name": "attemptsHelper"
}
],
"file": "services/jobs/src/test/java/com/dremio/service/jobs/TestAttemptsHelper.java... | {
"body": "@Test\n public void testGetExecutionTime() {\n // enqueued job\n final ResourceSchedulingInfo schedulingInfo = new ResourceSchedulingInfo()\n .setResourceSchedulingStart(System.currentTimeMillis() - TimeUnit.HOURS.toMillis(3))\n .setResourceSchedulingEnd(0L);\n final JobInfo info = new ... | {
"fields": [
{
"declarator": "stateDurations",
"modifier": "private final",
"original_string": "private final Map<AttemptEvent.State, Long> stateDurations;",
"type": "Map<AttemptEvent.State, Long>",
"var_name": "stateDurations"
},
{
"declarator": "events",
"modif... | {
"body": "public static long getLegacyExecutionTime(JobAttempt jobAttempt) {\n final JobInfo jobInfo = jobAttempt.getInfo();\n if (jobInfo == null) {\n return 0;\n }\n final JobDetails jobDetails = jobAttempt.getDetails();\n if (jobDetails == null) {\n return 0;\n }\n\n final long star... | {
"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_513 | {
"fields": [],
"file": "common/src/test/java/com/dremio/common/utils/TestSqlUtils.java",
"identifier": "TestSqlUtils",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseSchemaPath() {\n assertEquals(asList(\"a\", \"b\", \"c\"), SqlUtils.parseSchemaPath(\"a.b.c\"));\n assertEquals(asList(\"a\"), SqlUtils.parseSchemaPath(\"a\"));\n assertEquals(asList(\"a\", \"b.c\", \"d\"), SqlUtils.parseSchemaPath(\"a.\\\"b.c\\\".d\"));\n assertEq... | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(SqlUtils.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SqlUtils.class);",
"type": "org.slf4j.Logger",
"var_nam... | {
"body": "public static List<String> parseSchemaPath(String schemaPath) {\n return new StrTokenizer(schemaPath, '.', SqlUtils.QUOTE)\n .setIgnoreEmptyTokens(true)\n .getTokenList();\n }",
"class_method_signature": "SqlUtils.parseSchemaPath(String schemaPath)",
"constructor": false,
"full_sign... | {
"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"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.