id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
124004218_84 | {
"fields": [
{
"declarator": "writer",
"modifier": "private static",
"original_string": "private static VectorContainerWriter writer;",
"type": "VectorContainerWriter",
"var_name": "writer"
},
{
"declarator": "mutator",
"modifier": "private static",
"original_string": "private static TestOutputMutator mutator;",
"type": "TestOutputMutator",
"var_name": "mutator"
},
{
"declarator": "bsonReader",
"modifier": "private static",
"original_string": "private static BsonRecordReader bsonReader;",
"type": "BsonRecordReader",
"var_name": "bsonReader"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java",
"identifier": "TestBsonRecordReader",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void testBooleanType() throws IOException {\n BsonDocument bsonDoc = new BsonDocument();\n bsonDoc.append(\"booleanKey\", new BsonBoolean(true));\n writer.reset();\n bsonReader.write(writer, new BsonDocumentReader(bsonDoc));\n SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();\n assertTrue(mapReader.reader(\"booleanKey\").readBoolean());\n }",
"class_method_signature": "TestBsonRecordReader.testBooleanType()",
"constructor": false,
"full_signature": "@Test public void testBooleanType()",
"identifier": "testBooleanType",
"invocations": [
"append",
"reset",
"write",
"getReader",
"getMapVector",
"assertTrue",
"readBoolean",
"reader"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testBooleanType()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class)",
"modifier": "static final",
"original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "MAX_RECORD_SIZE = 128 * 1024",
"modifier": "public final static",
"original_string": "public final static int MAX_RECORD_SIZE = 128 * 1024;",
"type": "int",
"var_name": "MAX_RECORD_SIZE"
},
{
"declarator": "columns",
"modifier": "private final",
"original_string": "private final List<SchemaPath> columns;",
"type": "List<SchemaPath>",
"var_name": "columns"
},
{
"declarator": "atLeastOneWrite = false",
"modifier": "private",
"original_string": "private boolean atLeastOneWrite = false;",
"type": "boolean",
"var_name": "atLeastOneWrite"
},
{
"declarator": "readNumbersAsDouble",
"modifier": "private final",
"original_string": "private final boolean readNumbersAsDouble;",
"type": "boolean",
"var_name": "readNumbersAsDouble"
},
{
"declarator": "workBuf",
"modifier": "protected",
"original_string": "protected DrillBuf workBuf;",
"type": "DrillBuf",
"var_name": "workBuf"
},
{
"declarator": "currentFieldName",
"modifier": "private",
"original_string": "private String currentFieldName;",
"type": "String",
"var_name": "currentFieldName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java",
"identifier": "BsonRecordReader",
"interfaces": "",
"methods": [
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"constructor": false,
"full_signature": "private void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"identifier": "writeToListOrMap",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"return": "void",
"signature": "void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeTimeStamp",
"modifiers": "private",
"parameters": "(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeString",
"modifiers": "private",
"parameters": "(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeObjectId",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDouble",
"modifiers": "private",
"parameters": "(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDateTime",
"modifiers": "private",
"parameters": "(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBoolean",
"modifiers": "private",
"parameters": "(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"constructor": false,
"full_signature": "private void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"return": "void",
"signature": "void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt64",
"modifiers": "private",
"parameters": "(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt32",
"modifiers": "private",
"parameters": "(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensureAtLeastOneField(ComplexWriter writer)",
"constructor": false,
"full_signature": "public void ensureAtLeastOneField(ComplexWriter writer)",
"identifier": "ensureAtLeastOneField",
"modifiers": "public",
"parameters": "(ComplexWriter writer)",
"return": "void",
"signature": "void ensureAtLeastOneField(ComplexWriter writer)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(Throwable exception, String field, String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensure(final int length)",
"constructor": false,
"full_signature": "private void ensure(final int length)",
"identifier": "ensure",
"modifiers": "private",
"parameters": "(final int length)",
"return": "void",
"signature": "void ensure(final int length)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void write(ComplexWriter writer, BsonReader reader) throws IOException {\n reader.readStartDocument();\n BsonType readBsonType = reader.getCurrentBsonType();\n switch (readBsonType) {\n case DOCUMENT:\n writeToListOrMap(reader, new MapOrListWriterImpl(writer.rootAsMap()), false, null);\n break;\n default:\n throw new DrillRuntimeException(\"Root object must be DOCUMENT type. Found: \" + readBsonType);\n }\n }",
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"invocations": [
"readStartDocument",
"getCurrentBsonType",
"writeToListOrMap",
"rootAsMap"
],
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_10 | {
"fields": [
{
"declarator": "N1_EP1 = newDrillbitEndpoint(\"node1\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP1 = newDrillbitEndpoint(\"node1\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP1"
},
{
"declarator": "N1_EP2 = newDrillbitEndpoint(\"node1\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP2 = newDrillbitEndpoint(\"node1\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP2"
},
{
"declarator": "N2_EP1 = newDrillbitEndpoint(\"node2\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP1 = newDrillbitEndpoint(\"node2\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP1"
},
{
"declarator": "N2_EP2 = newDrillbitEndpoint(\"node2\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP2 = newDrillbitEndpoint(\"node2\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP2"
},
{
"declarator": "N3_EP1 = newDrillbitEndpoint(\"node3\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP1 = newDrillbitEndpoint(\"node3\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP1"
},
{
"declarator": "N3_EP2 = newDrillbitEndpoint(\"node3\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP2 = newDrillbitEndpoint(\"node3\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP2"
},
{
"declarator": "N4_EP2 = newDrillbitEndpoint(\"node4\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N4_EP2 = newDrillbitEndpoint(\"node4\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N4_EP2"
},
{
"declarator": "fragment",
"modifier": "@Mocked private",
"original_string": "@Mocked private Fragment fragment;",
"type": "Fragment",
"var_name": "fragment"
},
{
"declarator": "root",
"modifier": "@Mocked private",
"original_string": "@Mocked private PhysicalOperator root;",
"type": "PhysicalOperator",
"var_name": "root"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/planner/fragment/TestHardAffinityFragmentParallelizer.java",
"identifier": "TestHardAffinityFragmentParallelizer",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void simpleCase1() throws Exception {\n final Wrapper wrapper = newWrapper(200, 1, 20, Collections.singletonList(new EndpointAffinity(N1_EP1, 1.0, true, MAX_VALUE)));\n INSTANCE.parallelizeFragment(wrapper, newParameters(SLICE_TARGET_DEFAULT, 5, 20), null);\n\n // Expect the fragment parallelization to be just one because:\n // The cost (200) is below the threshold (SLICE_TARGET_DEFAULT) (which gives width of 200/10000 = ~1) and\n assertEquals(1, wrapper.getWidth());\n\n final List<DrillbitEndpoint> assignedEps = wrapper.getAssignedEndpoints();\n assertEquals(1, assignedEps.size());\n assertEquals(N1_EP1, assignedEps.get(0));\n }",
"class_method_signature": "TestHardAffinityFragmentParallelizer.simpleCase1()",
"constructor": false,
"full_signature": "@Test public void simpleCase1()",
"identifier": "simpleCase1",
"invocations": [
"newWrapper",
"singletonList",
"parallelizeFragment",
"newParameters",
"assertEquals",
"getWidth",
"getAssignedEndpoints",
"assertEquals",
"size",
"assertEquals",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void simpleCase1()",
"testcase": true
} | {
"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);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "INSTANCE = new HardAffinityFragmentParallelizer()",
"modifier": "public static final",
"original_string": "public static final HardAffinityFragmentParallelizer INSTANCE = new HardAffinityFragmentParallelizer();",
"type": "HardAffinityFragmentParallelizer",
"var_name": "INSTANCE"
},
{
"declarator": "EOL = System.getProperty(\"line.separator\")",
"modifier": "private static",
"original_string": "private static String EOL = System.getProperty(\"line.separator\");",
"type": "String",
"var_name": "EOL"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/HardAffinityFragmentParallelizer.java",
"identifier": "HardAffinityFragmentParallelizer",
"interfaces": "implements FragmentParallelizer",
"methods": [
{
"class_method_signature": "HardAffinityFragmentParallelizer.HardAffinityFragmentParallelizer()",
"constructor": true,
"full_signature": "private HardAffinityFragmentParallelizer()",
"identifier": "HardAffinityFragmentParallelizer",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HardAffinityFragmentParallelizer()",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"constructor": false,
"full_signature": "private static void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"identifier": "checkOrThrow",
"modifiers": "private static",
"parameters": "(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"return": "void",
"signature": "void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints) throws PhysicalOperatorSetupException {\n\n final Stats stats = fragmentWrapper.getStats();\n final ParallelizationInfo pInfo = stats.getParallelizationInfo();\n\n int totalMaxWidth = 0;\n\n // Go through the affinity map and extract the endpoints that have mandatory assignment requirement\n final Map<DrillbitEndpoint, EndpointAffinity> endpointPool = Maps.newHashMap();\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : pInfo.getEndpointAffinityMap().entrySet()) {\n if (entry.getValue().isAssignmentRequired()) {\n endpointPool.put(entry.getKey(), entry.getValue());\n\n // Limit the max width of the endpoint to allowed max width.\n totalMaxWidth += Math.min(parameters.getMaxWidthPerNode(), entry.getValue().getMaxWidth());\n if (totalMaxWidth < 0) {\n // If the totalWidth overflows, just keep it at the max value.\n totalMaxWidth = Integer.MAX_VALUE;\n }\n }\n }\n\n // Step 1: Find the width taking into various parameters\n // 1.1. Find the parallelization based on cost. Use max cost of all operators in this fragment; this is consistent\n // with the calculation that ExcessiveExchangeRemover uses.\n int width = (int) Math.ceil(stats.getMaxCost() / parameters.getSliceTarget());\n\n // 1.2. Make sure the width is at least the number of endpoints that require an assignment\n width = Math.max(endpointPool.size(), width);\n\n // 1.3. Cap the parallelization width by fragment level width limit and system level per query width limit\n width = Math.max(1, Math.min(width, pInfo.getMaxWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed fragment max \" +\n \"width ({}).\", endpointPool.size(), pInfo.getMaxWidth());\n\n // 1.4 Cap the parallelization width by global max query width\n width = Math.max(1, Math.min(width, parameters.getMaxGlobalWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed global query \" +\n \"width ({}).\", endpointPool.size(), parameters.getMaxGlobalWidth());\n\n // 1.5 Cap the parallelization width by max allowed parallelization per node\n width = Math.max(1, Math.min(width, endpointPool.size()*parameters.getMaxWidthPerNode()));\n\n // 1.6 Cap the parallelization width by total of max allowed width per node. The reason is if we the width is more,\n // we end up allocating more work units to one or more endpoints that don't have those many work units.\n width = Math.min(totalMaxWidth, width);\n\n // Step 2: Select the endpoints\n final Map<DrillbitEndpoint, Integer> endpoints = Maps.newHashMap();\n\n // 2.1 First add each endpoint from the pool once so that the mandatory assignment requirement is fulfilled.\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : endpointPool.entrySet()) {\n endpoints.put(entry.getKey(), 1);\n }\n int totalAssigned = endpoints.size();\n\n // 2.2 Assign the remaining slots to endpoints proportional to the affinity of each endpoint\n int remainingSlots = width - endpoints.size();\n while (remainingSlots > 0) {\n for(EndpointAffinity epAf : endpointPool.values()) {\n final int moreAllocation = (int) Math.ceil(epAf.getAffinity() * remainingSlots);\n int currentAssignments = endpoints.get(epAf.getEndpoint());\n for(int i=0;\n i < moreAllocation &&\n totalAssigned < width &&\n currentAssignments < parameters.getMaxWidthPerNode() &&\n currentAssignments < epAf.getMaxWidth();\n i++) {\n totalAssigned++;\n currentAssignments++;\n }\n endpoints.put(epAf.getEndpoint(), currentAssignments);\n }\n final int previousRemainingSlots = remainingSlots;\n remainingSlots = width - totalAssigned;\n if (previousRemainingSlots == remainingSlots) {\n logger.error(\"Can't parallelize fragment: \" +\n \"Every mandatory node has exhausted the maximum width per node limit.\" + EOL +\n \"Endpoint pool: {}\" + EOL + \"Assignment so far: {}\" + EOL + \"Width: {}\", endpointPool, endpoints, width);\n throw new PhysicalOperatorSetupException(\"Can not parallelize fragment.\");\n }\n }\n\n final List<DrillbitEndpoint> assignedEndpoints = Lists.newArrayList();\n for(Entry<DrillbitEndpoint, Integer> entry : endpoints.entrySet()) {\n for(int i=0; i < entry.getValue(); i++) {\n assignedEndpoints.add(entry.getKey());\n }\n }\n\n fragmentWrapper.setWidth(width);\n fragmentWrapper.assignEndpoints(assignedEndpoints);\n }",
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"invocations": [
"getStats",
"getParallelizationInfo",
"newHashMap",
"entrySet",
"getEndpointAffinityMap",
"isAssignmentRequired",
"getValue",
"put",
"getKey",
"getValue",
"min",
"getMaxWidthPerNode",
"getMaxWidth",
"getValue",
"ceil",
"getMaxCost",
"getSliceTarget",
"max",
"size",
"max",
"min",
"getMaxWidth",
"checkOrThrow",
"size",
"size",
"getMaxWidth",
"max",
"min",
"getMaxGlobalWidth",
"checkOrThrow",
"size",
"size",
"getMaxGlobalWidth",
"max",
"min",
"size",
"getMaxWidthPerNode",
"min",
"newHashMap",
"entrySet",
"put",
"getKey",
"size",
"size",
"values",
"ceil",
"getAffinity",
"get",
"getEndpoint",
"getMaxWidthPerNode",
"getMaxWidth",
"put",
"getEndpoint",
"error",
"newArrayList",
"entrySet",
"getValue",
"add",
"getKey",
"setWidth",
"assignEndpoints"
],
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_51 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/work/metadata/TestMetadataProvider.java",
"identifier": "TestMetadataProvider",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void tables() throws Exception {\n // test(\"SELECT * FROM INFORMATION_SCHEMA.`TABLES`\"); // SQL equivalent\n\n GetTablesResp resp = client.getTables(null, null, null, null).get();\n\n assertEquals(RequestStatus.OK, resp.getStatus());\n List<TableMetadata> tables = resp.getTablesList();\n assertEquals(12, tables.size());\n\n verifyTable(\"INFORMATION_SCHEMA\", \"CATALOGS\", tables);\n verifyTable(\"INFORMATION_SCHEMA\", \"COLUMNS\", tables);\n verifyTable(\"INFORMATION_SCHEMA\", \"SCHEMATA\", tables);\n verifyTable(\"INFORMATION_SCHEMA\", \"TABLES\", tables);\n verifyTable(\"INFORMATION_SCHEMA\", \"VIEWS\", tables);\n verifyTable(\"sys\", \"boot\", tables);\n verifyTable(\"sys\", \"drillbits\", tables);\n verifyTable(\"sys\", \"memory\", tables);\n verifyTable(\"sys\", \"options\", tables);\n verifyTable(\"sys\", \"threads\", tables);\n verifyTable(\"sys\", \"version\", tables);\n }",
"class_method_signature": "TestMetadataProvider.tables()",
"constructor": false,
"full_signature": "@Test public void tables()",
"identifier": "tables",
"invocations": [
"get",
"getTables",
"assertEquals",
"getStatus",
"getTablesList",
"assertEquals",
"size",
"verifyTable",
"verifyTable",
"verifyTable",
"verifyTable",
"verifyTable",
"verifyTable",
"verifyTable",
"verifyTable",
"verifyTable",
"verifyTable",
"verifyTable"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void tables()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(MetadataProvider.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(MetadataProvider.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "IN_FUNCTION = \"in\"",
"modifier": "private static final",
"original_string": "private static final String IN_FUNCTION = \"in\";",
"type": "String",
"var_name": "IN_FUNCTION"
},
{
"declarator": "LIKE_FUNCTION = \"like\"",
"modifier": "private static final",
"original_string": "private static final String LIKE_FUNCTION = \"like\";",
"type": "String",
"var_name": "LIKE_FUNCTION"
},
{
"declarator": "AND_FUNCTION = \"booleanand\"",
"modifier": "private static final",
"original_string": "private static final String AND_FUNCTION = \"booleanand\";",
"type": "String",
"var_name": "AND_FUNCTION"
},
{
"declarator": "OR_FUNCTION = \"booleanor\"",
"modifier": "private static final",
"original_string": "private static final String OR_FUNCTION = \"booleanor\";",
"type": "String",
"var_name": "OR_FUNCTION"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/work/metadata/MetadataProvider.java",
"identifier": "MetadataProvider",
"interfaces": "",
"methods": [
{
"class_method_signature": "MetadataProvider.catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"identifier": "catalogs",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"identifier": "schemas",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"identifier": "tables",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"identifier": "columns",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"constructor": false,
"full_signature": "private static InfoSchemaFilter createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"identifier": "createInfoSchemaFilter",
"modifiers": "private static",
"parameters": "(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"return": "InfoSchemaFilter",
"signature": "InfoSchemaFilter createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"constructor": false,
"full_signature": "private static FunctionExprNode createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"identifier": "createLikeFunctionExprNode",
"modifiers": "private static",
"parameters": "(String fieldName, LikeFilter likeFilter)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"constructor": false,
"full_signature": "private static FunctionExprNode createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"identifier": "createInFunctionExprNode",
"modifiers": "private static",
"parameters": "(String fieldName, List<String> valuesFilter)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"constructor": false,
"full_signature": "private static FunctionExprNode combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"identifier": "combineFunctions",
"modifiers": "private static",
"parameters": "(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"constructor": false,
"full_signature": "private static PojoRecordReader<S> getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"identifier": "getPojoRecordReader",
"modifiers": "private static",
"parameters": "(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"return": "PojoRecordReader<S>",
"signature": "PojoRecordReader<S> getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"constructor": false,
"full_signature": "private static SchemaConfigInfoProvider newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"identifier": "newSchemaConfigInfoProvider",
"modifiers": "private static",
"parameters": "(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"return": "SchemaConfigInfoProvider",
"signature": "SchemaConfigInfoProvider newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createPBError(final String failedFunction, final Throwable ex)",
"constructor": false,
"full_signature": "static DrillPBError createPBError(final String failedFunction, final Throwable ex)",
"identifier": "createPBError",
"modifiers": "static",
"parameters": "(final String failedFunction, final Throwable ex)",
"return": "DrillPBError",
"signature": "DrillPBError createPBError(final String failedFunction, final Throwable ex)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Runnable tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender) {\n return new TablesProvider(session, dContext, req, responseSender);\n }",
"class_method_signature": "MetadataProvider.tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"identifier": "tables",
"invocations": [],
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_9 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/planner/logical/DrillOptiqTest.java",
"identifier": "DrillOptiqTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUnsupportedRexNode() {\n try {\n // Create the data type factory.\n RelDataTypeFactory relFactory = new SqlTypeFactoryImpl(DrillRelDataTypeSystem.DRILL_REL_DATATYPE_SYSTEM);\n // Create the rex builder\n RexBuilder rex = new RexBuilder(relFactory);\n RelDataType anyType = relFactory.createSqlType(SqlTypeName.ANY);\n List<RexNode> emptyList = new LinkedList<>();\n ImmutableList<RexFieldCollation> e = ImmutableList.copyOf(new RexFieldCollation[0]);\n\n // create a dummy RexOver object.\n RexNode window = rex.makeOver(anyType, SqlStdOperatorTable.AVG, emptyList, emptyList, e, null, null, true,\n false, false);\n DrillOptiq.toDrill(null, (RelNode) null, window);\n } catch (UserException e) {\n if (e.getMessage().contains(DrillOptiq.UNSUPPORTED_REX_NODE_ERROR)) {\n // got expected error return\n return;\n }\n Assert.fail(\"Hit exception with unexpected error message\");\n }\n\n Assert.fail(\"Failed to raise the expected exception\");\n }",
"class_method_signature": "DrillOptiqTest.testUnsupportedRexNode()",
"constructor": false,
"full_signature": "@Test public void testUnsupportedRexNode()",
"identifier": "testUnsupportedRexNode",
"invocations": [
"createSqlType",
"copyOf",
"makeOver",
"toDrill",
"contains",
"getMessage",
"fail",
"fail"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testUnsupportedRexNode()",
"testcase": true
} | {
"fields": [
{
"declarator": "UNSUPPORTED_REX_NODE_ERROR = \"Cannot convert RexNode to equivalent Drill expression. \"",
"modifier": "public static final",
"original_string": "public static final String UNSUPPORTED_REX_NODE_ERROR = \"Cannot convert RexNode to equivalent Drill expression. \";",
"type": "String",
"var_name": "UNSUPPORTED_REX_NODE_ERROR"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(DrillOptiq.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillOptiq.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java",
"identifier": "DrillOptiq",
"interfaces": "",
"methods": [
{
"class_method_signature": "DrillOptiq.toDrill(DrillParseContext context, RelNode input, RexNode expr)",
"constructor": false,
"full_signature": "public static LogicalExpression toDrill(DrillParseContext context, RelNode input, RexNode expr)",
"identifier": "toDrill",
"modifiers": "public static",
"parameters": "(DrillParseContext context, RelNode input, RexNode expr)",
"return": "LogicalExpression",
"signature": "LogicalExpression toDrill(DrillParseContext context, RelNode input, RexNode expr)",
"testcase": false
},
{
"class_method_signature": "DrillOptiq.toDrill(DrillParseContext context, List<RelNode> inputs, RexNode expr)",
"constructor": false,
"full_signature": "public static LogicalExpression toDrill(DrillParseContext context, List<RelNode> inputs, RexNode expr)",
"identifier": "toDrill",
"modifiers": "public static",
"parameters": "(DrillParseContext context, List<RelNode> inputs, RexNode expr)",
"return": "LogicalExpression",
"signature": "LogicalExpression toDrill(DrillParseContext context, List<RelNode> inputs, RexNode expr)",
"testcase": false
},
{
"class_method_signature": "DrillOptiq.isLiteralNull(RexLiteral literal)",
"constructor": false,
"full_signature": "public static boolean isLiteralNull(RexLiteral literal)",
"identifier": "isLiteralNull",
"modifiers": "public static",
"parameters": "(RexLiteral literal)",
"return": "boolean",
"signature": "boolean isLiteralNull(RexLiteral literal)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static LogicalExpression toDrill(DrillParseContext context, RelNode input, RexNode expr) {\n return toDrill(context, Lists.newArrayList(input), expr);\n }",
"class_method_signature": "DrillOptiq.toDrill(DrillParseContext context, RelNode input, RexNode expr)",
"constructor": false,
"full_signature": "public static LogicalExpression toDrill(DrillParseContext context, RelNode input, RexNode expr)",
"identifier": "toDrill",
"invocations": [
"toDrill",
"newArrayList"
],
"modifiers": "public static",
"parameters": "(DrillParseContext context, RelNode input, RexNode expr)",
"return": "LogicalExpression",
"signature": "LogicalExpression toDrill(DrillParseContext context, RelNode input, RexNode expr)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_71 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/dfs/TestFormatPluginOptionExtractor.java",
"identifier": "TestFormatPluginOptionExtractor",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() {\n DrillConfig config = DrillConfig.create();\n ScanResult scanResult = RunTimeScan.fromPrescan(config);\n FormatPluginOptionExtractor e = new FormatPluginOptionExtractor(scanResult);\n Collection<FormatPluginOptionsDescriptor> options = e.getOptions();\n for (FormatPluginOptionsDescriptor d : options) {\n assertEquals(d.pluginConfigClass.getAnnotation(JsonTypeName.class).value(), d.typeName);\n switch (d.typeName) {\n case \"text\":\n assertEquals(TextFormatConfig.class, d.pluginConfigClass);\n assertEquals(\n \"(type: String, lineDelimiter: String, fieldDelimiter: String, quote: String, escape: String, comment: String, skipFirstLine: boolean, extractHeader: boolean)\",\n d.presentParams()\n );\n break;\n case \"named\":\n assertEquals(NamedFormatPluginConfig.class, d.pluginConfigClass);\n assertEquals(\"(type: String, name: String)\", d.presentParams());\n break;\n case \"parquet\":\n assertEquals(d.typeName, \"(type: String, autoCorrectCorruptDates: boolean)\", d.presentParams());\n break;\n case \"json\":\n case \"sequencefile\":\n case \"pcap\":\n case \"avro\":\n assertEquals(d.typeName, \"(type: String)\", d.presentParams());\n break;\n case \"httpd\":\n assertEquals(\"(type: String, logFormat: String, timestampFormat: String)\", d.presentParams());\n break;\n default:\n fail(\"add validation for format plugin type \" + d.typeName);\n }\n }\n }",
"class_method_signature": "TestFormatPluginOptionExtractor.test()",
"constructor": false,
"full_signature": "@Test public void test()",
"identifier": "test",
"invocations": [
"create",
"fromPrescan",
"getOptions",
"assertEquals",
"value",
"getAnnotation",
"assertEquals",
"assertEquals",
"presentParams",
"assertEquals",
"assertEquals",
"presentParams",
"assertEquals",
"presentParams",
"assertEquals",
"presentParams",
"assertEquals",
"presentParams",
"fail"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void test()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(FormatPluginOptionExtractor.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = org.slf4j.LoggerFactory.getLogger(FormatPluginOptionExtractor.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "optionsByTypeName",
"modifier": "private final",
"original_string": "private final Map<String, FormatPluginOptionsDescriptor> optionsByTypeName;",
"type": "Map<String, FormatPluginOptionsDescriptor>",
"var_name": "optionsByTypeName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FormatPluginOptionExtractor.java",
"identifier": "FormatPluginOptionExtractor",
"interfaces": "",
"methods": [
{
"class_method_signature": "FormatPluginOptionExtractor.FormatPluginOptionExtractor(ScanResult scanResult)",
"constructor": true,
"full_signature": " FormatPluginOptionExtractor(ScanResult scanResult)",
"identifier": "FormatPluginOptionExtractor",
"modifiers": "",
"parameters": "(ScanResult scanResult)",
"return": "",
"signature": " FormatPluginOptionExtractor(ScanResult scanResult)",
"testcase": false
},
{
"class_method_signature": "FormatPluginOptionExtractor.getOptions()",
"constructor": false,
"full_signature": "@VisibleForTesting Collection<FormatPluginOptionsDescriptor> getOptions()",
"identifier": "getOptions",
"modifiers": "@VisibleForTesting",
"parameters": "()",
"return": "Collection<FormatPluginOptionsDescriptor>",
"signature": "Collection<FormatPluginOptionsDescriptor> getOptions()",
"testcase": false
},
{
"class_method_signature": "FormatPluginOptionExtractor.getTableSignatures(String tableName)",
"constructor": false,
"full_signature": " List<TableSignature> getTableSignatures(String tableName)",
"identifier": "getTableSignatures",
"modifiers": "",
"parameters": "(String tableName)",
"return": "List<TableSignature>",
"signature": "List<TableSignature> getTableSignatures(String tableName)",
"testcase": false
},
{
"class_method_signature": "FormatPluginOptionExtractor.createConfigForTable(TableInstance t)",
"constructor": false,
"full_signature": " FormatPluginConfig createConfigForTable(TableInstance t)",
"identifier": "createConfigForTable",
"modifiers": "",
"parameters": "(TableInstance t)",
"return": "FormatPluginConfig",
"signature": "FormatPluginConfig createConfigForTable(TableInstance t)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@VisibleForTesting\n Collection<FormatPluginOptionsDescriptor> getOptions() {\n return optionsByTypeName.values();\n }",
"class_method_signature": "FormatPluginOptionExtractor.getOptions()",
"constructor": false,
"full_signature": "@VisibleForTesting Collection<FormatPluginOptionsDescriptor> getOptions()",
"identifier": "getOptions",
"invocations": [
"values"
],
"modifiers": "@VisibleForTesting",
"parameters": "()",
"return": "Collection<FormatPluginOptionsDescriptor>",
"signature": "Collection<FormatPluginOptionsDescriptor> getOptions()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_26 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListAllWithoutFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listAll(fs, new Path(base, \"a\"), false);\n assertEquals(\"Directory and file count should match\", 4, statuses.size());\n }",
"class_method_signature": "FileSystemUtilTest.testListAllWithoutFilter()",
"constructor": false,
"full_signature": "@Test public void testListAllWithoutFilter()",
"identifier": "testListAllWithoutFilter",
"invocations": [
"listAll",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListAllWithoutFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listAll(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }",
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"invocations": [
"listAll",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_30 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListAllEmptyResult() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listAll(fs, base, false, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().startsWith(\"xyz\");\n }\n });\n assertEquals(\"Directory and file count should match\", 0, statuses.size());\n }",
"class_method_signature": "FileSystemUtilTest.testListAllEmptyResult()",
"constructor": false,
"full_signature": "@Test public void testListAllEmptyResult()",
"identifier": "testListAllEmptyResult",
"invocations": [
"listAll",
"startsWith",
"getName",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListAllEmptyResult()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listAll(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }",
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"invocations": [
"listAll",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_88 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/easy/text/compliant/TestHeaderBuilder.java",
"identifier": "TestHeaderBuilder",
"interfaces": "",
"superclass": "extends DrillTest"
} | {
"body": "@Test\n public void testUnicode() {\n HeaderBuilder hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"Αθήνα\");\n validateHeader(hb, new String[] {\"Αθήνα\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"Москва\");\n validateHeader(hb, new String[] {\"Москва\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"Paris,Αθήνα,Москва\");\n validateHeader(hb, new String[] {\"Paris\",\"Αθήνα\",\"Москва\"});\n }",
"class_method_signature": "TestHeaderBuilder.testUnicode()",
"constructor": false,
"full_signature": "@Test public void testUnicode()",
"identifier": "testUnicode",
"invocations": [
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testUnicode()",
"testcase": true
} | {
"fields": [
{
"declarator": "MAX_HEADER_LEN = 1024",
"modifier": "public static final",
"original_string": "public static final int MAX_HEADER_LEN = 1024;",
"type": "int",
"var_name": "MAX_HEADER_LEN"
},
{
"declarator": "COLUMN_PREFIX = \"col_\"",
"modifier": "public static final",
"original_string": "public static final String COLUMN_PREFIX = \"col_\";",
"type": "String",
"var_name": "COLUMN_PREFIX"
},
{
"declarator": "ANONYMOUS_COLUMN_PREFIX = \"column_\"",
"modifier": "public static final",
"original_string": "public static final String ANONYMOUS_COLUMN_PREFIX = \"column_\";",
"type": "String",
"var_name": "ANONYMOUS_COLUMN_PREFIX"
},
{
"declarator": "headers = new ArrayList<>()",
"modifier": "public final",
"original_string": "public final List<String> headers = new ArrayList<>();",
"type": "List<String>",
"var_name": "headers"
},
{
"declarator": "currentField = ByteBuffer.allocate(MAX_HEADER_LEN)",
"modifier": "public final",
"original_string": "public final ByteBuffer currentField = ByteBuffer.allocate(MAX_HEADER_LEN);",
"type": "ByteBuffer",
"var_name": "currentField"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/text/compliant/HeaderBuilder.java",
"identifier": "HeaderBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "HeaderBuilder.startField(int index)",
"constructor": false,
"full_signature": "@Override public void startField(int index)",
"identifier": "startField",
"modifiers": "@Override public",
"parameters": "(int index)",
"return": "void",
"signature": "void startField(int index)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.endField()",
"constructor": false,
"full_signature": "@Override public boolean endField()",
"identifier": "endField",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean endField()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.endEmptyField()",
"constructor": false,
"full_signature": "@Override public boolean endEmptyField()",
"identifier": "endEmptyField",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean endEmptyField()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.validateSymbol(String header)",
"constructor": false,
"full_signature": "private String validateSymbol(String header)",
"identifier": "validateSymbol",
"modifiers": "private",
"parameters": "(String header)",
"return": "String",
"signature": "String validateSymbol(String header)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.rewriteHeader(String header)",
"constructor": false,
"full_signature": "private String rewriteHeader(String header)",
"identifier": "rewriteHeader",
"modifiers": "private",
"parameters": "(String header)",
"return": "String",
"signature": "String rewriteHeader(String header)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.append(byte data)",
"constructor": false,
"full_signature": "@Override public void append(byte data)",
"identifier": "append",
"modifiers": "@Override public",
"parameters": "(byte data)",
"return": "void",
"signature": "void append(byte data)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.finishRecord()",
"constructor": false,
"full_signature": "@Override public void finishRecord()",
"identifier": "finishRecord",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void finishRecord()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.getRecordCount()",
"constructor": false,
"full_signature": "@Override public long getRecordCount()",
"identifier": "getRecordCount",
"modifiers": "@Override public",
"parameters": "()",
"return": "long",
"signature": "long getRecordCount()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.startBatch()",
"constructor": false,
"full_signature": "@Override public void startBatch()",
"identifier": "startBatch",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void startBatch()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.finishBatch()",
"constructor": false,
"full_signature": "@Override public void finishBatch()",
"identifier": "finishBatch",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void finishBatch()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.rowHasData()",
"constructor": false,
"full_signature": "@Override public boolean rowHasData()",
"identifier": "rowHasData",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean rowHasData()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.getHeaders()",
"constructor": false,
"full_signature": "public String[] getHeaders()",
"identifier": "getHeaders",
"modifiers": "public",
"parameters": "()",
"return": "String[]",
"signature": "String[] getHeaders()",
"testcase": false
}
],
"superclass": "extends TextOutput"
} | {
"body": "@Override\n public void startBatch() { }",
"class_method_signature": "HeaderBuilder.startBatch()",
"constructor": false,
"full_signature": "@Override public void startBatch()",
"identifier": "startBatch",
"invocations": [],
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void startBatch()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_111 | {
"fields": [
{
"declarator": "config = DrillConfig.create()",
"modifier": "private final",
"original_string": "private final DrillConfig config = DrillConfig.create();",
"type": "DrillConfig",
"var_name": "config"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/client/DrillClientTest.java",
"identifier": "DrillClientTest",
"interfaces": "",
"superclass": "extends DrillSystemTestBase"
} | {
"body": "@Test\n public void testParseAndVerifyEndpointsOnlyDelim() throws Exception{\n // Test to check when connection string has only delimiter coma\n final String drillBitConnection = \" , \";\n\n try{\n final List<CoordinationProtos.DrillbitEndpoint> endpointsList = DrillClient.parseAndVerifyEndpoints\n (drillBitConnection, config.getString(ExecConstants.INITIAL_USER_PORT));\n fail();\n } catch (InvalidConnectionInfoException e) {\n System.out.println(e.getMessage());\n }\n }",
"class_method_signature": "DrillClientTest.testParseAndVerifyEndpointsOnlyDelim()",
"constructor": false,
"full_signature": "@Test public void testParseAndVerifyEndpointsOnlyDelim()",
"identifier": "testParseAndVerifyEndpointsOnlyDelim",
"invocations": [
"parseAndVerifyEndpoints",
"getString",
"fail",
"println",
"getMessage"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testParseAndVerifyEndpointsOnlyDelim()",
"testcase": true
} | {
"fields": [
{
"declarator": "DEFAULT_CLIENT_NAME = \"Apache Drill Java client\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_CLIENT_NAME = \"Apache Drill Java client\";",
"type": "String",
"var_name": "DEFAULT_CLIENT_NAME"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "objectMapper = new ObjectMapper()",
"modifier": "private static final",
"original_string": "private static final ObjectMapper objectMapper = new ObjectMapper();",
"type": "ObjectMapper",
"var_name": "objectMapper"
},
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final DrillConfig config;",
"type": "DrillConfig",
"var_name": "config"
},
{
"declarator": "client",
"modifier": "private",
"original_string": "private UserClient client;",
"type": "UserClient",
"var_name": "client"
},
{
"declarator": "properties",
"modifier": "private",
"original_string": "private DrillProperties properties;",
"type": "DrillProperties",
"var_name": "properties"
},
{
"declarator": "clusterCoordinator",
"modifier": "private volatile",
"original_string": "private volatile ClusterCoordinator clusterCoordinator;",
"type": "ClusterCoordinator",
"var_name": "clusterCoordinator"
},
{
"declarator": "connected = false",
"modifier": "private volatile",
"original_string": "private volatile boolean connected = false;",
"type": "boolean",
"var_name": "connected"
},
{
"declarator": "allocator",
"modifier": "private final",
"original_string": "private final BufferAllocator allocator;",
"type": "BufferAllocator",
"var_name": "allocator"
},
{
"declarator": "reconnectTimes",
"modifier": "private",
"original_string": "private int reconnectTimes;",
"type": "int",
"var_name": "reconnectTimes"
},
{
"declarator": "reconnectDelay",
"modifier": "private",
"original_string": "private int reconnectDelay;",
"type": "int",
"var_name": "reconnectDelay"
},
{
"declarator": "supportComplexTypes",
"modifier": "private",
"original_string": "private boolean supportComplexTypes;",
"type": "boolean",
"var_name": "supportComplexTypes"
},
{
"declarator": "ownsZkConnection",
"modifier": "private final",
"original_string": "private final boolean ownsZkConnection;",
"type": "boolean",
"var_name": "ownsZkConnection"
},
{
"declarator": "ownsAllocator",
"modifier": "private final",
"original_string": "private final boolean ownsAllocator;",
"type": "boolean",
"var_name": "ownsAllocator"
},
{
"declarator": "isDirectConnection",
"modifier": "private final",
"original_string": "private final boolean isDirectConnection;",
"type": "boolean",
"var_name": "isDirectConnection"
},
{
"declarator": "eventLoopGroup",
"modifier": "private",
"original_string": "private EventLoopGroup eventLoopGroup;",
"type": "EventLoopGroup",
"var_name": "eventLoopGroup"
},
{
"declarator": "executor",
"modifier": "private",
"original_string": "private ExecutorService executor;",
"type": "ExecutorService",
"var_name": "executor"
},
{
"declarator": "clientName = DEFAULT_CLIENT_NAME",
"modifier": "private",
"original_string": "private String clientName = DEFAULT_CLIENT_NAME;",
"type": "String",
"var_name": "clientName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java",
"identifier": "DrillClient",
"interfaces": "implements Closeable, ConnectionThrottle",
"methods": [
{
"class_method_signature": "DrillClient.DrillClient()",
"constructor": true,
"full_signature": "public DrillClient()",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DrillClient()",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(boolean isDirect)",
"return": "",
"signature": " DrillClient(boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(String fileName)",
"constructor": true,
"full_signature": "public DrillClient(String fileName)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(String fileName)",
"return": "",
"signature": " DrillClient(String fileName)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config)",
"return": "",
"signature": " DrillClient(DrillConfig config)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getConfig()",
"constructor": false,
"full_signature": "public DrillConfig getConfig()",
"identifier": "getConfig",
"modifiers": "public",
"parameters": "()",
"return": "DrillConfig",
"signature": "DrillConfig getConfig()",
"testcase": false
},
{
"class_method_signature": "DrillClient.setAutoRead(boolean enableAutoRead)",
"constructor": false,
"full_signature": "@Override public void setAutoRead(boolean enableAutoRead)",
"identifier": "setAutoRead",
"modifiers": "@Override public",
"parameters": "(boolean enableAutoRead)",
"return": "void",
"signature": "void setAutoRead(boolean enableAutoRead)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setClientName(String name)",
"constructor": false,
"full_signature": "public void setClientName(String name)",
"identifier": "setClientName",
"modifiers": "public",
"parameters": "(String name)",
"return": "void",
"signature": "void setClientName(String name)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setSupportComplexTypes(boolean supportComplexTypes)",
"constructor": false,
"full_signature": "public void setSupportComplexTypes(boolean supportComplexTypes)",
"identifier": "setSupportComplexTypes",
"modifiers": "public",
"parameters": "(boolean supportComplexTypes)",
"return": "void",
"signature": "void setSupportComplexTypes(boolean supportComplexTypes)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect()",
"constructor": false,
"full_signature": "public void connect()",
"identifier": "connect",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void connect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(Properties props)",
"constructor": false,
"full_signature": "public void connect(Properties props)",
"identifier": "connect",
"modifiers": "public",
"parameters": "(Properties props)",
"return": "void",
"signature": "void connect(Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(String connect, Properties props)",
"constructor": false,
"full_signature": "public synchronized void connect(String connect, Properties props)",
"identifier": "connect",
"modifiers": "public synchronized",
"parameters": "(String connect, Properties props)",
"return": "void",
"signature": "void connect(String connect, Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createEventLoop(int size, String prefix)",
"constructor": false,
"full_signature": "protected static EventLoopGroup createEventLoop(int size, String prefix)",
"identifier": "createEventLoop",
"modifiers": "protected static",
"parameters": "(int size, String prefix)",
"return": "EventLoopGroup",
"signature": "EventLoopGroup createEventLoop(int size, String prefix)",
"testcase": false
},
{
"class_method_signature": "DrillClient.reconnect()",
"constructor": false,
"full_signature": "public synchronized boolean reconnect()",
"identifier": "reconnect",
"modifiers": "public synchronized",
"parameters": "()",
"return": "boolean",
"signature": "boolean reconnect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(DrillbitEndpoint endpoint)",
"constructor": false,
"full_signature": "private void connect(DrillbitEndpoint endpoint)",
"identifier": "connect",
"modifiers": "private",
"parameters": "(DrillbitEndpoint endpoint)",
"return": "void",
"signature": "void connect(DrillbitEndpoint endpoint)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getAllocator()",
"constructor": false,
"full_signature": "public BufferAllocator getAllocator()",
"identifier": "getAllocator",
"modifiers": "public",
"parameters": "()",
"return": "BufferAllocator",
"signature": "BufferAllocator getAllocator()",
"testcase": false
},
{
"class_method_signature": "DrillClient.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerInfos()",
"constructor": false,
"full_signature": "@Deprecated public RpcEndpointInfos getServerInfos()",
"identifier": "getServerInfos",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "RpcEndpointInfos",
"signature": "RpcEndpointInfos getServerInfos()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerName()",
"constructor": false,
"full_signature": "public String getServerName()",
"identifier": "getServerName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getServerName()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerVersion()",
"constructor": false,
"full_signature": "public Version getServerVersion()",
"identifier": "getServerVersion",
"modifiers": "public",
"parameters": "()",
"return": "Version",
"signature": "Version getServerVersion()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerMeta()",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"identifier": "getServerMeta",
"modifiers": "public",
"parameters": "()",
"return": "DrillRpcFuture<GetServerMetaResp>",
"signature": "DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSupportedMethods()",
"constructor": false,
"full_signature": "public Set<ServerMethod> getSupportedMethods()",
"identifier": "getSupportedMethods",
"modifiers": "public",
"parameters": "()",
"return": "Set<ServerMethod>",
"signature": "Set<ServerMethod> getSupportedMethods()",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan)",
"constructor": false,
"full_signature": "public List<QueryDataBatch> runQuery(QueryType type, String plan)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> runQuery(QueryType type, String plan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.planQuery(QueryType type, String query, boolean isSplitPlan)",
"constructor": false,
"full_signature": "public DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"identifier": "planQuery",
"modifiers": "public",
"parameters": "(QueryType type, String query, boolean isSplitPlan)",
"return": "DrillRpcFuture<QueryPlanFragments>",
"signature": "DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getUserCredentials()",
"constructor": false,
"full_signature": "private UserBitShared.UserCredentials getUserCredentials()",
"identifier": "getUserCredentials",
"modifiers": "private",
"parameters": "()",
"return": "UserBitShared.UserCredentials",
"signature": "UserBitShared.UserCredentials getUserCredentials()",
"testcase": false
},
{
"class_method_signature": "DrillClient.cancelQuery(QueryId id)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"identifier": "cancelQuery",
"modifiers": "public",
"parameters": "(QueryId id)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"testcase": false
},
{
"class_method_signature": "DrillClient.resumeQuery(final QueryId queryId)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"identifier": "resumeQuery",
"modifiers": "public",
"parameters": "(final QueryId queryId)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getCatalogs(LikeFilter catalogNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"identifier": "getCatalogs",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter)",
"return": "DrillRpcFuture<GetCatalogsResp>",
"signature": "DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"identifier": "getSchemas",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"return": "DrillRpcFuture<GetSchemasResp>",
"signature": "DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"identifier": "getTables",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"return": "DrillRpcFuture<GetTablesResp>",
"signature": "DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"identifier": "getColumns",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"return": "DrillRpcFuture<GetColumnsResp>",
"signature": "DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createPreparedStatement(final String query)",
"constructor": false,
"full_signature": "public DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"identifier": "createPreparedStatement",
"modifiers": "public",
"parameters": "(final String query)",
"return": "DrillRpcFuture<CreatePreparedStatementResp>",
"signature": "DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"identifier": "executePreparedStatement",
"modifiers": "public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"return": "void",
"signature": "void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"constructor": false,
"full_signature": "@VisibleForTesting public List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"identifier": "executePreparedStatement",
"modifiers": "@VisibleForTesting public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)\n throws InvalidConnectionInfoException {\n // If no drillbits is provided then throw exception\n drillbits = drillbits.trim();\n if (drillbits.isEmpty()) {\n throw new InvalidConnectionInfoException(\"No drillbit information specified in the connection string\");\n }\n\n final List<DrillbitEndpoint> endpointList = new ArrayList<>();\n final String[] connectInfo = drillbits.split(\",\");\n\n // Fetch ip address and port information for each drillbit and populate the list\n for (String drillbit : connectInfo) {\n\n // Trim all the empty spaces and check if the entry is empty string.\n // Ignore the empty ones.\n drillbit = drillbit.trim();\n\n if (!drillbit.isEmpty()) {\n // Verify if we have only \":\" or only \":port\" pattern\n if (drillbit.charAt(0) == ':') {\n // Invalid drillbit information\n throw new InvalidConnectionInfoException(\"Malformed connection string with drillbit hostname or \" +\n \"hostaddress missing for an entry: \" + drillbit);\n }\n\n // We are now sure that each ip:port entry will have both the values atleast once.\n // Split each drillbit connection string to get ip address and port value\n final String[] drillbitInfo = drillbit.split(\":\");\n\n // Check if we have more than one port\n if (drillbitInfo.length > 2) {\n throw new InvalidConnectionInfoException(\"Malformed connection string with more than one port in a \" +\n \"drillbit entry: \" + drillbit);\n }\n\n // At this point we are sure that drillbitInfo has atleast hostname or host address\n // trim all the empty spaces which might be present in front of hostname or\n // host address information\n final String ipAddress = drillbitInfo[0].trim();\n String port = defaultUserPort;\n\n if (drillbitInfo.length == 2) {\n // We have a port value also given by user. trim all the empty spaces between : and port value before\n // validating the correctness of value.\n port = drillbitInfo[1].trim();\n }\n\n try {\n final DrillbitEndpoint endpoint = DrillbitEndpoint.newBuilder()\n .setAddress(ipAddress)\n .setUserPort(Integer.parseInt(port))\n .build();\n\n endpointList.add(endpoint);\n } catch (NumberFormatException e) {\n throw new InvalidConnectionInfoException(\"Malformed port value in entry: \" + ipAddress + \":\" + port + \" \" +\n \"passed in connection string\");\n }\n }\n }\n if (endpointList.size() == 0) {\n throw new InvalidConnectionInfoException(\"No valid drillbit information specified in the connection string\");\n }\n return endpointList;\n }",
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"invocations": [
"trim",
"isEmpty",
"split",
"trim",
"isEmpty",
"charAt",
"split",
"trim",
"trim",
"build",
"setUserPort",
"setAddress",
"newBuilder",
"parseInt",
"add",
"size"
],
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_5 | {
"fields": [
{
"declarator": "MAX_ALLOCATION = 8 * 1024",
"modifier": "private final static",
"original_string": "private final static int MAX_ALLOCATION = 8 * 1024;",
"type": "int",
"var_name": "MAX_ALLOCATION"
}
],
"file": "exec/memory/base/src/test/java/org/apache/drill/exec/memory/TestBaseAllocator.java",
"identifier": "TestBaseAllocator",
"interfaces": "",
"superclass": ""
} | {
"body": "@Ignore // TODO(DRILL-2740)\n @Test(expected = IllegalStateException.class)\n public void testAllocator_unreleasedEmpty() throws Exception {\n try(final RootAllocator rootAllocator =\n new RootAllocator(MAX_ALLOCATION)) {\n @SuppressWarnings(\"unused\")\n final DrillBuf drillBuf = rootAllocator.buffer(0);\n }\n }",
"class_method_signature": "TestBaseAllocator.testAllocator_unreleasedEmpty()",
"constructor": false,
"full_signature": "@Ignore // TODO(DRILL-2740) @Test(expected = IllegalStateException.class) public void testAllocator_unreleasedEmpty()",
"identifier": "testAllocator_unreleasedEmpty",
"invocations": [
"buffer"
],
"modifiers": "@Ignore // TODO(DRILL-2740) @Test(expected = IllegalStateException.class) public",
"parameters": "()",
"return": "void",
"signature": "void testAllocator_unreleasedEmpty()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\"",
"modifier": "public static final",
"original_string": "public static final String DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\";",
"type": "String",
"var_name": "DEBUG_ALLOCATOR"
},
{
"declarator": "ID_GENERATOR = new AtomicLong(0)",
"modifier": "@SuppressWarnings(\"unused\")\n private static final",
"original_string": "@SuppressWarnings(\"unused\")\n private static final AtomicLong ID_GENERATOR = new AtomicLong(0);",
"type": "AtomicLong",
"var_name": "ID_GENERATOR"
},
{
"declarator": "CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize()",
"modifier": "private static final",
"original_string": "private static final int CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize();",
"type": "int",
"var_name": "CHUNK_SIZE"
},
{
"declarator": "DEBUG_LOG_LENGTH = 6",
"modifier": "public static final",
"original_string": "public static final int DEBUG_LOG_LENGTH = 6;",
"type": "int",
"var_name": "DEBUG_LOG_LENGTH"
},
{
"declarator": "DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"))",
"modifier": "public static final",
"original_string": "public static final boolean DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"));",
"type": "boolean",
"var_name": "DEBUG"
},
{
"declarator": "IO_BUFFER_SIZE = 32*1024",
"modifier": "private static final",
"original_string": "private static final int IO_BUFFER_SIZE = 32*1024;",
"type": "int",
"var_name": "IO_BUFFER_SIZE"
},
{
"declarator": "DEBUG_LOCK = DEBUG ? new Object() : null",
"modifier": "private final",
"original_string": "private final Object DEBUG_LOCK = DEBUG ? new Object() : null;",
"type": "Object",
"var_name": "DEBUG_LOCK"
},
{
"declarator": "parentAllocator",
"modifier": "private final",
"original_string": "private final BaseAllocator parentAllocator;",
"type": "BaseAllocator",
"var_name": "parentAllocator"
},
{
"declarator": "thisAsByteBufAllocator",
"modifier": "private final",
"original_string": "private final ByteBufAllocator thisAsByteBufAllocator;",
"type": "ByteBufAllocator",
"var_name": "thisAsByteBufAllocator"
},
{
"declarator": "childAllocators",
"modifier": "private final",
"original_string": "private final IdentityHashMap<BaseAllocator, Object> childAllocators;",
"type": "IdentityHashMap<BaseAllocator, Object>",
"var_name": "childAllocators"
},
{
"declarator": "empty",
"modifier": "private final",
"original_string": "private final DrillBuf empty;",
"type": "DrillBuf",
"var_name": "empty"
},
{
"declarator": "isClosed = false",
"modifier": "private volatile",
"original_string": "private volatile boolean isClosed = false;",
"type": "boolean",
"var_name": "isClosed"
},
{
"declarator": "name",
"modifier": "final",
"original_string": "final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "root",
"modifier": "final",
"original_string": "final RootAllocator root;",
"type": "RootAllocator",
"var_name": "root"
},
{
"declarator": "childLedgers",
"modifier": "private final",
"original_string": "private final IdentityHashMap<BufferLedger, Object> childLedgers;",
"type": "IdentityHashMap<BufferLedger, Object>",
"var_name": "childLedgers"
},
{
"declarator": "reservations",
"modifier": "private final",
"original_string": "private final IdentityHashMap<Reservation, Object> reservations;",
"type": "IdentityHashMap<Reservation, Object>",
"var_name": "reservations"
},
{
"declarator": "historicalLog",
"modifier": "private final",
"original_string": "private final HistoricalLog historicalLog;",
"type": "HistoricalLog",
"var_name": "historicalLog"
},
{
"declarator": "ioBuffer[]",
"modifier": "private",
"original_string": "private byte ioBuffer[];",
"type": "byte",
"var_name": "ioBuffer"
}
],
"file": "exec/memory/base/src/main/java/org/apache/drill/exec/memory/BaseAllocator.java",
"identifier": "BaseAllocator",
"interfaces": "implements BufferAllocator",
"methods": [
{
"class_method_signature": "BaseAllocator.BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"constructor": true,
"full_signature": "protected BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"identifier": "BaseAllocator",
"modifiers": "protected",
"parameters": "(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"return": "",
"signature": " BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.assertOpen()",
"constructor": false,
"full_signature": "@Override public void assertOpen()",
"identifier": "assertOpen",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void assertOpen()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getName()",
"constructor": false,
"full_signature": "@Override public String getName()",
"identifier": "getName",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String getName()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getEmpty()",
"constructor": false,
"full_signature": "@Override public DrillBuf getEmpty()",
"identifier": "getEmpty",
"modifiers": "@Override public",
"parameters": "()",
"return": "DrillBuf",
"signature": "DrillBuf getEmpty()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.associateLedger(BufferLedger ledger)",
"constructor": false,
"full_signature": " void associateLedger(BufferLedger ledger)",
"identifier": "associateLedger",
"modifiers": "",
"parameters": "(BufferLedger ledger)",
"return": "void",
"signature": "void associateLedger(BufferLedger ledger)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.dissociateLedger(BufferLedger ledger)",
"constructor": false,
"full_signature": " void dissociateLedger(BufferLedger ledger)",
"identifier": "dissociateLedger",
"modifiers": "",
"parameters": "(BufferLedger ledger)",
"return": "void",
"signature": "void dissociateLedger(BufferLedger ledger)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.childClosed(final BaseAllocator childAllocator)",
"constructor": false,
"full_signature": "private void childClosed(final BaseAllocator childAllocator)",
"identifier": "childClosed",
"modifiers": "private",
"parameters": "(final BaseAllocator childAllocator)",
"return": "void",
"signature": "void childClosed(final BaseAllocator childAllocator)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"constructor": false,
"full_signature": "private static String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"identifier": "createErrorMsg",
"modifiers": "private static",
"parameters": "(final BufferAllocator allocator, final int rounded, final int requested)",
"return": "String",
"signature": "String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize)",
"identifier": "buffer",
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.createEmpty()",
"constructor": false,
"full_signature": "private DrillBuf createEmpty()",
"identifier": "createEmpty",
"modifiers": "private",
"parameters": "()",
"return": "DrillBuf",
"signature": "DrillBuf createEmpty()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize, BufferManager manager)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize, BufferManager manager)",
"identifier": "buffer",
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize, BufferManager manager)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize, BufferManager manager)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.bufferWithoutReservation(final int size, BufferManager bufferManager)",
"constructor": false,
"full_signature": "private DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)",
"identifier": "bufferWithoutReservation",
"modifiers": "private",
"parameters": "(final int size, BufferManager bufferManager)",
"return": "DrillBuf",
"signature": "DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getAsByteBufAllocator()",
"constructor": false,
"full_signature": "@Override public ByteBufAllocator getAsByteBufAllocator()",
"identifier": "getAsByteBufAllocator",
"modifiers": "@Override public",
"parameters": "()",
"return": "ByteBufAllocator",
"signature": "ByteBufAllocator getAsByteBufAllocator()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"constructor": false,
"full_signature": "@Override public BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"identifier": "newChildAllocator",
"modifiers": "@Override public",
"parameters": "(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"return": "BufferAllocator",
"signature": "BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.newReservation()",
"constructor": false,
"full_signature": "@Override public AllocationReservation newReservation()",
"identifier": "newReservation",
"modifiers": "@Override public",
"parameters": "()",
"return": "AllocationReservation",
"signature": "AllocationReservation newReservation()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.close()",
"constructor": false,
"full_signature": "@Override public synchronized void close()",
"identifier": "close",
"modifiers": "@Override public synchronized",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.toVerboseString()",
"constructor": false,
"full_signature": "@Override public String toVerboseString()",
"identifier": "toVerboseString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toVerboseString()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.hist(String noteFormat, Object... args)",
"constructor": false,
"full_signature": "private void hist(String noteFormat, Object... args)",
"identifier": "hist",
"modifiers": "private",
"parameters": "(String noteFormat, Object... args)",
"return": "void",
"signature": "void hist(String noteFormat, Object... args)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.nextPowerOfTwo(int val)",
"constructor": false,
"full_signature": "public static int nextPowerOfTwo(int val)",
"identifier": "nextPowerOfTwo",
"modifiers": "public static",
"parameters": "(int val)",
"return": "int",
"signature": "int nextPowerOfTwo(int val)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.verifyAllocator()",
"constructor": false,
"full_signature": " void verifyAllocator()",
"identifier": "verifyAllocator",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void verifyAllocator()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"constructor": false,
"full_signature": "private void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"identifier": "verifyAllocator",
"modifiers": "private",
"parameters": "(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"return": "void",
"signature": "void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.print(StringBuilder sb, int level, Verbosity verbosity)",
"constructor": false,
"full_signature": " void print(StringBuilder sb, int level, Verbosity verbosity)",
"identifier": "print",
"modifiers": "",
"parameters": "(StringBuilder sb, int level, Verbosity verbosity)",
"return": "void",
"signature": "void print(StringBuilder sb, int level, Verbosity verbosity)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"constructor": false,
"full_signature": "private void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"identifier": "dumpBuffers",
"modifiers": "private",
"parameters": "(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"return": "void",
"signature": "void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.indent(StringBuilder sb, int indent)",
"constructor": false,
"full_signature": "public static StringBuilder indent(StringBuilder sb, int indent)",
"identifier": "indent",
"modifiers": "public static",
"parameters": "(StringBuilder sb, int indent)",
"return": "StringBuilder",
"signature": "StringBuilder indent(StringBuilder sb, int indent)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.isDebug()",
"constructor": false,
"full_signature": "public static boolean isDebug()",
"identifier": "isDebug",
"modifiers": "public static",
"parameters": "()",
"return": "boolean",
"signature": "boolean isDebug()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getIOBuffer()",
"constructor": false,
"full_signature": "public byte[] getIOBuffer()",
"identifier": "getIOBuffer",
"modifiers": "public",
"parameters": "()",
"return": "byte[]",
"signature": "byte[] getIOBuffer()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.read(DrillBuf buf, int length, InputStream in)",
"constructor": false,
"full_signature": "@Override public void read(DrillBuf buf, int length, InputStream in)",
"identifier": "read",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, int length, InputStream in)",
"return": "void",
"signature": "void read(DrillBuf buf, int length, InputStream in)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.read(int length, InputStream in)",
"constructor": false,
"full_signature": "public DrillBuf read(int length, InputStream in)",
"identifier": "read",
"modifiers": "public",
"parameters": "(int length, InputStream in)",
"return": "DrillBuf",
"signature": "DrillBuf read(int length, InputStream in)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.write(DrillBuf buf, OutputStream out)",
"constructor": false,
"full_signature": "@Override public void write(DrillBuf buf, OutputStream out)",
"identifier": "write",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, OutputStream out)",
"return": "void",
"signature": "void write(DrillBuf buf, OutputStream out)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.write(DrillBuf buf, int length, OutputStream out)",
"constructor": false,
"full_signature": "@Override public void write(DrillBuf buf, int length, OutputStream out)",
"identifier": "write",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, int length, OutputStream out)",
"return": "void",
"signature": "void write(DrillBuf buf, int length, OutputStream out)",
"testcase": false
}
],
"superclass": "extends Accountant"
} | {
"body": "@Override\n public DrillBuf buffer(final int initialRequestSize) {\n assertOpen();\n\n return buffer(initialRequestSize, null);\n }",
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize)",
"identifier": "buffer",
"invocations": [
"assertOpen",
"buffer"
],
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_4 | {
"fields": [
{
"declarator": "MAX_ALLOCATION = 8 * 1024",
"modifier": "private final static",
"original_string": "private final static int MAX_ALLOCATION = 8 * 1024;",
"type": "int",
"var_name": "MAX_ALLOCATION"
}
],
"file": "exec/memory/base/src/test/java/org/apache/drill/exec/memory/TestBaseAllocator.java",
"identifier": "TestBaseAllocator",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRootAllocator_getEmpty() throws Exception {\n try(final RootAllocator rootAllocator =\n new RootAllocator(MAX_ALLOCATION)) {\n final DrillBuf drillBuf = rootAllocator.buffer(0);\n assertNotNull(\"allocation failed\", drillBuf);\n assertEquals(\"capacity was non-zero\", 0, drillBuf.capacity());\n drillBuf.release();\n }\n }",
"class_method_signature": "TestBaseAllocator.testRootAllocator_getEmpty()",
"constructor": false,
"full_signature": "@Test public void testRootAllocator_getEmpty()",
"identifier": "testRootAllocator_getEmpty",
"invocations": [
"buffer",
"assertNotNull",
"assertEquals",
"capacity",
"release"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testRootAllocator_getEmpty()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\"",
"modifier": "public static final",
"original_string": "public static final String DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\";",
"type": "String",
"var_name": "DEBUG_ALLOCATOR"
},
{
"declarator": "ID_GENERATOR = new AtomicLong(0)",
"modifier": "@SuppressWarnings(\"unused\")\n private static final",
"original_string": "@SuppressWarnings(\"unused\")\n private static final AtomicLong ID_GENERATOR = new AtomicLong(0);",
"type": "AtomicLong",
"var_name": "ID_GENERATOR"
},
{
"declarator": "CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize()",
"modifier": "private static final",
"original_string": "private static final int CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize();",
"type": "int",
"var_name": "CHUNK_SIZE"
},
{
"declarator": "DEBUG_LOG_LENGTH = 6",
"modifier": "public static final",
"original_string": "public static final int DEBUG_LOG_LENGTH = 6;",
"type": "int",
"var_name": "DEBUG_LOG_LENGTH"
},
{
"declarator": "DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"))",
"modifier": "public static final",
"original_string": "public static final boolean DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"));",
"type": "boolean",
"var_name": "DEBUG"
},
{
"declarator": "IO_BUFFER_SIZE = 32*1024",
"modifier": "private static final",
"original_string": "private static final int IO_BUFFER_SIZE = 32*1024;",
"type": "int",
"var_name": "IO_BUFFER_SIZE"
},
{
"declarator": "DEBUG_LOCK = DEBUG ? new Object() : null",
"modifier": "private final",
"original_string": "private final Object DEBUG_LOCK = DEBUG ? new Object() : null;",
"type": "Object",
"var_name": "DEBUG_LOCK"
},
{
"declarator": "parentAllocator",
"modifier": "private final",
"original_string": "private final BaseAllocator parentAllocator;",
"type": "BaseAllocator",
"var_name": "parentAllocator"
},
{
"declarator": "thisAsByteBufAllocator",
"modifier": "private final",
"original_string": "private final ByteBufAllocator thisAsByteBufAllocator;",
"type": "ByteBufAllocator",
"var_name": "thisAsByteBufAllocator"
},
{
"declarator": "childAllocators",
"modifier": "private final",
"original_string": "private final IdentityHashMap<BaseAllocator, Object> childAllocators;",
"type": "IdentityHashMap<BaseAllocator, Object>",
"var_name": "childAllocators"
},
{
"declarator": "empty",
"modifier": "private final",
"original_string": "private final DrillBuf empty;",
"type": "DrillBuf",
"var_name": "empty"
},
{
"declarator": "isClosed = false",
"modifier": "private volatile",
"original_string": "private volatile boolean isClosed = false;",
"type": "boolean",
"var_name": "isClosed"
},
{
"declarator": "name",
"modifier": "final",
"original_string": "final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "root",
"modifier": "final",
"original_string": "final RootAllocator root;",
"type": "RootAllocator",
"var_name": "root"
},
{
"declarator": "childLedgers",
"modifier": "private final",
"original_string": "private final IdentityHashMap<BufferLedger, Object> childLedgers;",
"type": "IdentityHashMap<BufferLedger, Object>",
"var_name": "childLedgers"
},
{
"declarator": "reservations",
"modifier": "private final",
"original_string": "private final IdentityHashMap<Reservation, Object> reservations;",
"type": "IdentityHashMap<Reservation, Object>",
"var_name": "reservations"
},
{
"declarator": "historicalLog",
"modifier": "private final",
"original_string": "private final HistoricalLog historicalLog;",
"type": "HistoricalLog",
"var_name": "historicalLog"
},
{
"declarator": "ioBuffer[]",
"modifier": "private",
"original_string": "private byte ioBuffer[];",
"type": "byte",
"var_name": "ioBuffer"
}
],
"file": "exec/memory/base/src/main/java/org/apache/drill/exec/memory/BaseAllocator.java",
"identifier": "BaseAllocator",
"interfaces": "implements BufferAllocator",
"methods": [
{
"class_method_signature": "BaseAllocator.BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"constructor": true,
"full_signature": "protected BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"identifier": "BaseAllocator",
"modifiers": "protected",
"parameters": "(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"return": "",
"signature": " BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.assertOpen()",
"constructor": false,
"full_signature": "@Override public void assertOpen()",
"identifier": "assertOpen",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void assertOpen()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getName()",
"constructor": false,
"full_signature": "@Override public String getName()",
"identifier": "getName",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String getName()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getEmpty()",
"constructor": false,
"full_signature": "@Override public DrillBuf getEmpty()",
"identifier": "getEmpty",
"modifiers": "@Override public",
"parameters": "()",
"return": "DrillBuf",
"signature": "DrillBuf getEmpty()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.associateLedger(BufferLedger ledger)",
"constructor": false,
"full_signature": " void associateLedger(BufferLedger ledger)",
"identifier": "associateLedger",
"modifiers": "",
"parameters": "(BufferLedger ledger)",
"return": "void",
"signature": "void associateLedger(BufferLedger ledger)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.dissociateLedger(BufferLedger ledger)",
"constructor": false,
"full_signature": " void dissociateLedger(BufferLedger ledger)",
"identifier": "dissociateLedger",
"modifiers": "",
"parameters": "(BufferLedger ledger)",
"return": "void",
"signature": "void dissociateLedger(BufferLedger ledger)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.childClosed(final BaseAllocator childAllocator)",
"constructor": false,
"full_signature": "private void childClosed(final BaseAllocator childAllocator)",
"identifier": "childClosed",
"modifiers": "private",
"parameters": "(final BaseAllocator childAllocator)",
"return": "void",
"signature": "void childClosed(final BaseAllocator childAllocator)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"constructor": false,
"full_signature": "private static String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"identifier": "createErrorMsg",
"modifiers": "private static",
"parameters": "(final BufferAllocator allocator, final int rounded, final int requested)",
"return": "String",
"signature": "String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize)",
"identifier": "buffer",
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.createEmpty()",
"constructor": false,
"full_signature": "private DrillBuf createEmpty()",
"identifier": "createEmpty",
"modifiers": "private",
"parameters": "()",
"return": "DrillBuf",
"signature": "DrillBuf createEmpty()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize, BufferManager manager)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize, BufferManager manager)",
"identifier": "buffer",
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize, BufferManager manager)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize, BufferManager manager)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.bufferWithoutReservation(final int size, BufferManager bufferManager)",
"constructor": false,
"full_signature": "private DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)",
"identifier": "bufferWithoutReservation",
"modifiers": "private",
"parameters": "(final int size, BufferManager bufferManager)",
"return": "DrillBuf",
"signature": "DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getAsByteBufAllocator()",
"constructor": false,
"full_signature": "@Override public ByteBufAllocator getAsByteBufAllocator()",
"identifier": "getAsByteBufAllocator",
"modifiers": "@Override public",
"parameters": "()",
"return": "ByteBufAllocator",
"signature": "ByteBufAllocator getAsByteBufAllocator()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"constructor": false,
"full_signature": "@Override public BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"identifier": "newChildAllocator",
"modifiers": "@Override public",
"parameters": "(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"return": "BufferAllocator",
"signature": "BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.newReservation()",
"constructor": false,
"full_signature": "@Override public AllocationReservation newReservation()",
"identifier": "newReservation",
"modifiers": "@Override public",
"parameters": "()",
"return": "AllocationReservation",
"signature": "AllocationReservation newReservation()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.close()",
"constructor": false,
"full_signature": "@Override public synchronized void close()",
"identifier": "close",
"modifiers": "@Override public synchronized",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.toVerboseString()",
"constructor": false,
"full_signature": "@Override public String toVerboseString()",
"identifier": "toVerboseString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toVerboseString()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.hist(String noteFormat, Object... args)",
"constructor": false,
"full_signature": "private void hist(String noteFormat, Object... args)",
"identifier": "hist",
"modifiers": "private",
"parameters": "(String noteFormat, Object... args)",
"return": "void",
"signature": "void hist(String noteFormat, Object... args)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.nextPowerOfTwo(int val)",
"constructor": false,
"full_signature": "public static int nextPowerOfTwo(int val)",
"identifier": "nextPowerOfTwo",
"modifiers": "public static",
"parameters": "(int val)",
"return": "int",
"signature": "int nextPowerOfTwo(int val)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.verifyAllocator()",
"constructor": false,
"full_signature": " void verifyAllocator()",
"identifier": "verifyAllocator",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void verifyAllocator()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"constructor": false,
"full_signature": "private void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"identifier": "verifyAllocator",
"modifiers": "private",
"parameters": "(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"return": "void",
"signature": "void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.print(StringBuilder sb, int level, Verbosity verbosity)",
"constructor": false,
"full_signature": " void print(StringBuilder sb, int level, Verbosity verbosity)",
"identifier": "print",
"modifiers": "",
"parameters": "(StringBuilder sb, int level, Verbosity verbosity)",
"return": "void",
"signature": "void print(StringBuilder sb, int level, Verbosity verbosity)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"constructor": false,
"full_signature": "private void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"identifier": "dumpBuffers",
"modifiers": "private",
"parameters": "(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"return": "void",
"signature": "void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.indent(StringBuilder sb, int indent)",
"constructor": false,
"full_signature": "public static StringBuilder indent(StringBuilder sb, int indent)",
"identifier": "indent",
"modifiers": "public static",
"parameters": "(StringBuilder sb, int indent)",
"return": "StringBuilder",
"signature": "StringBuilder indent(StringBuilder sb, int indent)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.isDebug()",
"constructor": false,
"full_signature": "public static boolean isDebug()",
"identifier": "isDebug",
"modifiers": "public static",
"parameters": "()",
"return": "boolean",
"signature": "boolean isDebug()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getIOBuffer()",
"constructor": false,
"full_signature": "public byte[] getIOBuffer()",
"identifier": "getIOBuffer",
"modifiers": "public",
"parameters": "()",
"return": "byte[]",
"signature": "byte[] getIOBuffer()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.read(DrillBuf buf, int length, InputStream in)",
"constructor": false,
"full_signature": "@Override public void read(DrillBuf buf, int length, InputStream in)",
"identifier": "read",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, int length, InputStream in)",
"return": "void",
"signature": "void read(DrillBuf buf, int length, InputStream in)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.read(int length, InputStream in)",
"constructor": false,
"full_signature": "public DrillBuf read(int length, InputStream in)",
"identifier": "read",
"modifiers": "public",
"parameters": "(int length, InputStream in)",
"return": "DrillBuf",
"signature": "DrillBuf read(int length, InputStream in)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.write(DrillBuf buf, OutputStream out)",
"constructor": false,
"full_signature": "@Override public void write(DrillBuf buf, OutputStream out)",
"identifier": "write",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, OutputStream out)",
"return": "void",
"signature": "void write(DrillBuf buf, OutputStream out)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.write(DrillBuf buf, int length, OutputStream out)",
"constructor": false,
"full_signature": "@Override public void write(DrillBuf buf, int length, OutputStream out)",
"identifier": "write",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, int length, OutputStream out)",
"return": "void",
"signature": "void write(DrillBuf buf, int length, OutputStream out)",
"testcase": false
}
],
"superclass": "extends Accountant"
} | {
"body": "@Override\n public DrillBuf buffer(final int initialRequestSize) {\n assertOpen();\n\n return buffer(initialRequestSize, null);\n }",
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize)",
"identifier": "buffer",
"invocations": [
"assertOpen",
"buffer"
],
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_110 | {
"fields": [
{
"declarator": "config = DrillConfig.create()",
"modifier": "private final",
"original_string": "private final DrillConfig config = DrillConfig.create();",
"type": "DrillConfig",
"var_name": "config"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/client/DrillClientTest.java",
"identifier": "DrillClientTest",
"interfaces": "",
"superclass": "extends DrillSystemTestBase"
} | {
"body": "@Test\n public void testParseAndVerifyEndpointsNonNumericPort() throws Exception{\n // Test to check when connection string has non-numeric port\n final String drillBitConnection = \"10.10.100.161:5ab0\";\n\n try{\n final List<CoordinationProtos.DrillbitEndpoint> endpointsList = DrillClient.parseAndVerifyEndpoints\n (drillBitConnection, config.getString(ExecConstants.INITIAL_USER_PORT));\n fail();\n } catch (InvalidConnectionInfoException e) {\n System.out.println(e.getMessage());\n }\n }",
"class_method_signature": "DrillClientTest.testParseAndVerifyEndpointsNonNumericPort()",
"constructor": false,
"full_signature": "@Test public void testParseAndVerifyEndpointsNonNumericPort()",
"identifier": "testParseAndVerifyEndpointsNonNumericPort",
"invocations": [
"parseAndVerifyEndpoints",
"getString",
"fail",
"println",
"getMessage"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testParseAndVerifyEndpointsNonNumericPort()",
"testcase": true
} | {
"fields": [
{
"declarator": "DEFAULT_CLIENT_NAME = \"Apache Drill Java client\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_CLIENT_NAME = \"Apache Drill Java client\";",
"type": "String",
"var_name": "DEFAULT_CLIENT_NAME"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "objectMapper = new ObjectMapper()",
"modifier": "private static final",
"original_string": "private static final ObjectMapper objectMapper = new ObjectMapper();",
"type": "ObjectMapper",
"var_name": "objectMapper"
},
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final DrillConfig config;",
"type": "DrillConfig",
"var_name": "config"
},
{
"declarator": "client",
"modifier": "private",
"original_string": "private UserClient client;",
"type": "UserClient",
"var_name": "client"
},
{
"declarator": "properties",
"modifier": "private",
"original_string": "private DrillProperties properties;",
"type": "DrillProperties",
"var_name": "properties"
},
{
"declarator": "clusterCoordinator",
"modifier": "private volatile",
"original_string": "private volatile ClusterCoordinator clusterCoordinator;",
"type": "ClusterCoordinator",
"var_name": "clusterCoordinator"
},
{
"declarator": "connected = false",
"modifier": "private volatile",
"original_string": "private volatile boolean connected = false;",
"type": "boolean",
"var_name": "connected"
},
{
"declarator": "allocator",
"modifier": "private final",
"original_string": "private final BufferAllocator allocator;",
"type": "BufferAllocator",
"var_name": "allocator"
},
{
"declarator": "reconnectTimes",
"modifier": "private",
"original_string": "private int reconnectTimes;",
"type": "int",
"var_name": "reconnectTimes"
},
{
"declarator": "reconnectDelay",
"modifier": "private",
"original_string": "private int reconnectDelay;",
"type": "int",
"var_name": "reconnectDelay"
},
{
"declarator": "supportComplexTypes",
"modifier": "private",
"original_string": "private boolean supportComplexTypes;",
"type": "boolean",
"var_name": "supportComplexTypes"
},
{
"declarator": "ownsZkConnection",
"modifier": "private final",
"original_string": "private final boolean ownsZkConnection;",
"type": "boolean",
"var_name": "ownsZkConnection"
},
{
"declarator": "ownsAllocator",
"modifier": "private final",
"original_string": "private final boolean ownsAllocator;",
"type": "boolean",
"var_name": "ownsAllocator"
},
{
"declarator": "isDirectConnection",
"modifier": "private final",
"original_string": "private final boolean isDirectConnection;",
"type": "boolean",
"var_name": "isDirectConnection"
},
{
"declarator": "eventLoopGroup",
"modifier": "private",
"original_string": "private EventLoopGroup eventLoopGroup;",
"type": "EventLoopGroup",
"var_name": "eventLoopGroup"
},
{
"declarator": "executor",
"modifier": "private",
"original_string": "private ExecutorService executor;",
"type": "ExecutorService",
"var_name": "executor"
},
{
"declarator": "clientName = DEFAULT_CLIENT_NAME",
"modifier": "private",
"original_string": "private String clientName = DEFAULT_CLIENT_NAME;",
"type": "String",
"var_name": "clientName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java",
"identifier": "DrillClient",
"interfaces": "implements Closeable, ConnectionThrottle",
"methods": [
{
"class_method_signature": "DrillClient.DrillClient()",
"constructor": true,
"full_signature": "public DrillClient()",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DrillClient()",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(boolean isDirect)",
"return": "",
"signature": " DrillClient(boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(String fileName)",
"constructor": true,
"full_signature": "public DrillClient(String fileName)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(String fileName)",
"return": "",
"signature": " DrillClient(String fileName)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config)",
"return": "",
"signature": " DrillClient(DrillConfig config)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getConfig()",
"constructor": false,
"full_signature": "public DrillConfig getConfig()",
"identifier": "getConfig",
"modifiers": "public",
"parameters": "()",
"return": "DrillConfig",
"signature": "DrillConfig getConfig()",
"testcase": false
},
{
"class_method_signature": "DrillClient.setAutoRead(boolean enableAutoRead)",
"constructor": false,
"full_signature": "@Override public void setAutoRead(boolean enableAutoRead)",
"identifier": "setAutoRead",
"modifiers": "@Override public",
"parameters": "(boolean enableAutoRead)",
"return": "void",
"signature": "void setAutoRead(boolean enableAutoRead)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setClientName(String name)",
"constructor": false,
"full_signature": "public void setClientName(String name)",
"identifier": "setClientName",
"modifiers": "public",
"parameters": "(String name)",
"return": "void",
"signature": "void setClientName(String name)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setSupportComplexTypes(boolean supportComplexTypes)",
"constructor": false,
"full_signature": "public void setSupportComplexTypes(boolean supportComplexTypes)",
"identifier": "setSupportComplexTypes",
"modifiers": "public",
"parameters": "(boolean supportComplexTypes)",
"return": "void",
"signature": "void setSupportComplexTypes(boolean supportComplexTypes)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect()",
"constructor": false,
"full_signature": "public void connect()",
"identifier": "connect",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void connect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(Properties props)",
"constructor": false,
"full_signature": "public void connect(Properties props)",
"identifier": "connect",
"modifiers": "public",
"parameters": "(Properties props)",
"return": "void",
"signature": "void connect(Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(String connect, Properties props)",
"constructor": false,
"full_signature": "public synchronized void connect(String connect, Properties props)",
"identifier": "connect",
"modifiers": "public synchronized",
"parameters": "(String connect, Properties props)",
"return": "void",
"signature": "void connect(String connect, Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createEventLoop(int size, String prefix)",
"constructor": false,
"full_signature": "protected static EventLoopGroup createEventLoop(int size, String prefix)",
"identifier": "createEventLoop",
"modifiers": "protected static",
"parameters": "(int size, String prefix)",
"return": "EventLoopGroup",
"signature": "EventLoopGroup createEventLoop(int size, String prefix)",
"testcase": false
},
{
"class_method_signature": "DrillClient.reconnect()",
"constructor": false,
"full_signature": "public synchronized boolean reconnect()",
"identifier": "reconnect",
"modifiers": "public synchronized",
"parameters": "()",
"return": "boolean",
"signature": "boolean reconnect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(DrillbitEndpoint endpoint)",
"constructor": false,
"full_signature": "private void connect(DrillbitEndpoint endpoint)",
"identifier": "connect",
"modifiers": "private",
"parameters": "(DrillbitEndpoint endpoint)",
"return": "void",
"signature": "void connect(DrillbitEndpoint endpoint)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getAllocator()",
"constructor": false,
"full_signature": "public BufferAllocator getAllocator()",
"identifier": "getAllocator",
"modifiers": "public",
"parameters": "()",
"return": "BufferAllocator",
"signature": "BufferAllocator getAllocator()",
"testcase": false
},
{
"class_method_signature": "DrillClient.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerInfos()",
"constructor": false,
"full_signature": "@Deprecated public RpcEndpointInfos getServerInfos()",
"identifier": "getServerInfos",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "RpcEndpointInfos",
"signature": "RpcEndpointInfos getServerInfos()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerName()",
"constructor": false,
"full_signature": "public String getServerName()",
"identifier": "getServerName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getServerName()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerVersion()",
"constructor": false,
"full_signature": "public Version getServerVersion()",
"identifier": "getServerVersion",
"modifiers": "public",
"parameters": "()",
"return": "Version",
"signature": "Version getServerVersion()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerMeta()",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"identifier": "getServerMeta",
"modifiers": "public",
"parameters": "()",
"return": "DrillRpcFuture<GetServerMetaResp>",
"signature": "DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSupportedMethods()",
"constructor": false,
"full_signature": "public Set<ServerMethod> getSupportedMethods()",
"identifier": "getSupportedMethods",
"modifiers": "public",
"parameters": "()",
"return": "Set<ServerMethod>",
"signature": "Set<ServerMethod> getSupportedMethods()",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan)",
"constructor": false,
"full_signature": "public List<QueryDataBatch> runQuery(QueryType type, String plan)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> runQuery(QueryType type, String plan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.planQuery(QueryType type, String query, boolean isSplitPlan)",
"constructor": false,
"full_signature": "public DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"identifier": "planQuery",
"modifiers": "public",
"parameters": "(QueryType type, String query, boolean isSplitPlan)",
"return": "DrillRpcFuture<QueryPlanFragments>",
"signature": "DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getUserCredentials()",
"constructor": false,
"full_signature": "private UserBitShared.UserCredentials getUserCredentials()",
"identifier": "getUserCredentials",
"modifiers": "private",
"parameters": "()",
"return": "UserBitShared.UserCredentials",
"signature": "UserBitShared.UserCredentials getUserCredentials()",
"testcase": false
},
{
"class_method_signature": "DrillClient.cancelQuery(QueryId id)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"identifier": "cancelQuery",
"modifiers": "public",
"parameters": "(QueryId id)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"testcase": false
},
{
"class_method_signature": "DrillClient.resumeQuery(final QueryId queryId)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"identifier": "resumeQuery",
"modifiers": "public",
"parameters": "(final QueryId queryId)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getCatalogs(LikeFilter catalogNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"identifier": "getCatalogs",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter)",
"return": "DrillRpcFuture<GetCatalogsResp>",
"signature": "DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"identifier": "getSchemas",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"return": "DrillRpcFuture<GetSchemasResp>",
"signature": "DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"identifier": "getTables",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"return": "DrillRpcFuture<GetTablesResp>",
"signature": "DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"identifier": "getColumns",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"return": "DrillRpcFuture<GetColumnsResp>",
"signature": "DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createPreparedStatement(final String query)",
"constructor": false,
"full_signature": "public DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"identifier": "createPreparedStatement",
"modifiers": "public",
"parameters": "(final String query)",
"return": "DrillRpcFuture<CreatePreparedStatementResp>",
"signature": "DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"identifier": "executePreparedStatement",
"modifiers": "public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"return": "void",
"signature": "void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"constructor": false,
"full_signature": "@VisibleForTesting public List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"identifier": "executePreparedStatement",
"modifiers": "@VisibleForTesting public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)\n throws InvalidConnectionInfoException {\n // If no drillbits is provided then throw exception\n drillbits = drillbits.trim();\n if (drillbits.isEmpty()) {\n throw new InvalidConnectionInfoException(\"No drillbit information specified in the connection string\");\n }\n\n final List<DrillbitEndpoint> endpointList = new ArrayList<>();\n final String[] connectInfo = drillbits.split(\",\");\n\n // Fetch ip address and port information for each drillbit and populate the list\n for (String drillbit : connectInfo) {\n\n // Trim all the empty spaces and check if the entry is empty string.\n // Ignore the empty ones.\n drillbit = drillbit.trim();\n\n if (!drillbit.isEmpty()) {\n // Verify if we have only \":\" or only \":port\" pattern\n if (drillbit.charAt(0) == ':') {\n // Invalid drillbit information\n throw new InvalidConnectionInfoException(\"Malformed connection string with drillbit hostname or \" +\n \"hostaddress missing for an entry: \" + drillbit);\n }\n\n // We are now sure that each ip:port entry will have both the values atleast once.\n // Split each drillbit connection string to get ip address and port value\n final String[] drillbitInfo = drillbit.split(\":\");\n\n // Check if we have more than one port\n if (drillbitInfo.length > 2) {\n throw new InvalidConnectionInfoException(\"Malformed connection string with more than one port in a \" +\n \"drillbit entry: \" + drillbit);\n }\n\n // At this point we are sure that drillbitInfo has atleast hostname or host address\n // trim all the empty spaces which might be present in front of hostname or\n // host address information\n final String ipAddress = drillbitInfo[0].trim();\n String port = defaultUserPort;\n\n if (drillbitInfo.length == 2) {\n // We have a port value also given by user. trim all the empty spaces between : and port value before\n // validating the correctness of value.\n port = drillbitInfo[1].trim();\n }\n\n try {\n final DrillbitEndpoint endpoint = DrillbitEndpoint.newBuilder()\n .setAddress(ipAddress)\n .setUserPort(Integer.parseInt(port))\n .build();\n\n endpointList.add(endpoint);\n } catch (NumberFormatException e) {\n throw new InvalidConnectionInfoException(\"Malformed port value in entry: \" + ipAddress + \":\" + port + \" \" +\n \"passed in connection string\");\n }\n }\n }\n if (endpointList.size() == 0) {\n throw new InvalidConnectionInfoException(\"No valid drillbit information specified in the connection string\");\n }\n return endpointList;\n }",
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"invocations": [
"trim",
"isEmpty",
"split",
"trim",
"isEmpty",
"charAt",
"split",
"trim",
"trim",
"build",
"setUserPort",
"setAddress",
"newBuilder",
"parseInt",
"add",
"size"
],
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_89 | {
"fields": [
{
"declarator": "FULL_PERMISSION = FsPermission.getDirDefault()",
"modifier": "private static final",
"original_string": "private static final FsPermission FULL_PERMISSION = FsPermission.getDirDefault();",
"type": "FsPermission",
"var_name": "FULL_PERMISSION"
},
{
"declarator": "PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false)",
"modifier": "private static final",
"original_string": "private static final StorageStrategy PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false);",
"type": "StorageStrategy",
"var_name": "PERSISTENT_STRATEGY"
},
{
"declarator": "TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true)",
"modifier": "private static final",
"original_string": "private static final StorageStrategy TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true);",
"type": "StorageStrategy",
"var_name": "TEMPORARY_STRATEGY"
},
{
"declarator": "fs",
"modifier": "private static",
"original_string": "private static FileSystem fs;",
"type": "FileSystem",
"var_name": "fs"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/StorageStrategyTest.java",
"identifier": "StorageStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPermissionAndDeleteOnExitFalseForFileWithParent() throws Exception {\n Path initialPath = prepareStorageDirectory();\n Path file = addNLevelsAndFile(initialPath, 2, true);\n Path firstCreatedParentPath = addNLevelsAndFile(initialPath, 1, false);\n\n Path createdParentPath = PERSISTENT_STRATEGY.createFileAndApply(fs, file);\n\n assertEquals(\"Path should match\", firstCreatedParentPath, createdParentPath);\n checkPathAndPermission(initialPath, file, true, 2, PERSISTENT_STRATEGY);\n checkDeleteOnExit(firstCreatedParentPath, false);\n }",
"class_method_signature": "StorageStrategyTest.testPermissionAndDeleteOnExitFalseForFileWithParent()",
"constructor": false,
"full_signature": "@Test public void testPermissionAndDeleteOnExitFalseForFileWithParent()",
"identifier": "testPermissionAndDeleteOnExitFalseForFileWithParent",
"invocations": [
"prepareStorageDirectory",
"addNLevelsAndFile",
"addNLevelsAndFile",
"createFileAndApply",
"assertEquals",
"checkPathAndPermission",
"checkDeleteOnExit"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testPermissionAndDeleteOnExitFalseForFileWithParent()",
"testcase": true
} | {
"fields": [
{
"declarator": "DEFAULT = new StorageStrategy(\"002\", false)",
"modifier": "public static final",
"original_string": "public static final StorageStrategy DEFAULT = new StorageStrategy(\"002\", false);",
"type": "StorageStrategy",
"var_name": "DEFAULT"
},
{
"declarator": "TEMPORARY = new StorageStrategy(\"077\", true)",
"modifier": "public static final",
"original_string": "public static final StorageStrategy TEMPORARY = new StorageStrategy(\"077\", true);",
"type": "StorageStrategy",
"var_name": "TEMPORARY"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "umask",
"modifier": "private final",
"original_string": "private final String umask;",
"type": "String",
"var_name": "umask"
},
{
"declarator": "deleteOnExit",
"modifier": "private final",
"original_string": "private final boolean deleteOnExit;",
"type": "boolean",
"var_name": "deleteOnExit"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/StorageStrategy.java",
"identifier": "StorageStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "StorageStrategy.StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"constructor": true,
"full_signature": "@JsonCreator public StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"identifier": "StorageStrategy",
"modifiers": "@JsonCreator public",
"parameters": "(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"return": "",
"signature": " StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getUmask()",
"constructor": false,
"full_signature": "public String getUmask()",
"identifier": "getUmask",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getUmask()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.isDeleteOnExit()",
"constructor": false,
"full_signature": "public boolean isDeleteOnExit()",
"identifier": "isDeleteOnExit",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isDeleteOnExit()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getFolderPermission()",
"constructor": false,
"full_signature": "@JsonIgnore public FsPermission getFolderPermission()",
"identifier": "getFolderPermission",
"modifiers": "@JsonIgnore public",
"parameters": "()",
"return": "FsPermission",
"signature": "FsPermission getFolderPermission()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getFilePermission()",
"constructor": false,
"full_signature": "@JsonIgnore public FsPermission getFilePermission()",
"identifier": "getFilePermission",
"modifiers": "@JsonIgnore public",
"parameters": "()",
"return": "FsPermission",
"signature": "FsPermission getFilePermission()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.createPathAndApply(FileSystem fs, Path path)",
"constructor": false,
"full_signature": "public Path createPathAndApply(FileSystem fs, Path path)",
"identifier": "createPathAndApply",
"modifiers": "public",
"parameters": "(FileSystem fs, Path path)",
"return": "Path",
"signature": "Path createPathAndApply(FileSystem fs, Path path)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public Path createFileAndApply(FileSystem fs, Path file)",
"identifier": "createFileAndApply",
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "Path",
"signature": "Path createFileAndApply(FileSystem fs, Path file)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.applyToFile(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public void applyToFile(FileSystem fs, Path file)",
"identifier": "applyToFile",
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "void",
"signature": "void applyToFile(FileSystem fs, Path file)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.validateUmask(String umask)",
"constructor": false,
"full_signature": "private String validateUmask(String umask)",
"identifier": "validateUmask",
"modifiers": "private",
"parameters": "(String umask)",
"return": "String",
"signature": "String validateUmask(String umask)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getNonExistentLocations(FileSystem fs, Path path)",
"constructor": false,
"full_signature": "private List<Path> getNonExistentLocations(FileSystem fs, Path path)",
"identifier": "getNonExistentLocations",
"modifiers": "private",
"parameters": "(FileSystem fs, Path path)",
"return": "List<Path>",
"signature": "List<Path> getNonExistentLocations(FileSystem fs, Path path)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"constructor": false,
"full_signature": "private void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"identifier": "applyStrategy",
"modifiers": "private",
"parameters": "(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"return": "void",
"signature": "void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Path createFileAndApply(FileSystem fs, Path file) throws IOException {\n List<Path> locations = getNonExistentLocations(fs, file.getParent());\n if (!fs.createNewFile(file)) {\n throw new IOException(String.format(\"File [%s] already exists on file system [%s].\",\n file.toUri().getPath(), fs.getUri()));\n }\n applyToFile(fs, file);\n\n if (locations.isEmpty()) {\n return file;\n }\n\n for (Path location : locations) {\n applyStrategy(fs, location, getFolderPermission(), deleteOnExit);\n }\n return locations.get(locations.size() - 1);\n }",
"class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public Path createFileAndApply(FileSystem fs, Path file)",
"identifier": "createFileAndApply",
"invocations": [
"getNonExistentLocations",
"getParent",
"createNewFile",
"format",
"getPath",
"toUri",
"getUri",
"applyToFile",
"isEmpty",
"applyStrategy",
"getFolderPermission",
"get",
"size"
],
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "Path",
"signature": "Path createFileAndApply(FileSystem fs, Path file)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_66 | {
"fields": [
{
"declarator": "built_in = \"built-in\"",
"modifier": "private static final",
"original_string": "private static final String built_in = \"built-in\";",
"type": "String",
"var_name": "built_in"
},
{
"declarator": "udf_jar = \"DrillUDF-1.0.jar\"",
"modifier": "private static final",
"original_string": "private static final String udf_jar = \"DrillUDF-1.0.jar\";",
"type": "String",
"var_name": "udf_jar"
},
{
"declarator": "newJars",
"modifier": "private static",
"original_string": "private static Map<String, List<FunctionHolder>> newJars;",
"type": "Map<String, List<FunctionHolder>>",
"var_name": "newJars"
},
{
"declarator": "registryHolder",
"modifier": "private",
"original_string": "private FunctionRegistryHolder registryHolder;",
"type": "FunctionRegistryHolder",
"var_name": "registryHolder"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolderTest.java",
"identifier": "FunctionRegistryHolderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testJarNameByFunctionSignature() {\n FunctionHolder functionHolder = newJars.get(built_in).get(0);\n assertEquals(\"Jar name should match\",\n built_in, registryHolder.getJarNameByFunctionSignature(functionHolder.getName(), functionHolder.getSignature()));\n assertNull(\"Jar name should be null\",\n registryHolder.getJarNameByFunctionSignature(\"unknown_function\", \"unknown_function(unknown-input)\"));\n }",
"class_method_signature": "FunctionRegistryHolderTest.testJarNameByFunctionSignature()",
"constructor": false,
"full_signature": "@Test public void testJarNameByFunctionSignature()",
"identifier": "testJarNameByFunctionSignature",
"invocations": [
"get",
"get",
"assertEquals",
"getJarNameByFunctionSignature",
"getName",
"getSignature",
"assertNull",
"getJarNameByFunctionSignature"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testJarNameByFunctionSignature()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "readWriteLock = new ReentrantReadWriteLock()",
"modifier": "private final",
"original_string": "private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();",
"type": "ReadWriteLock",
"var_name": "readWriteLock"
},
{
"declarator": "readLock = new AutoCloseableLock(readWriteLock.readLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock());",
"type": "AutoCloseableLock",
"var_name": "readLock"
},
{
"declarator": "writeLock = new AutoCloseableLock(readWriteLock.writeLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock());",
"type": "AutoCloseableLock",
"var_name": "writeLock"
},
{
"declarator": "version",
"modifier": "private",
"original_string": "private long version;",
"type": "long",
"var_name": "version"
},
{
"declarator": "jars",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, Queue<String>>> jars;",
"type": "Map<String, Map<String, Queue<String>>>",
"var_name": "jars"
},
{
"declarator": "functions",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, DrillFuncHolder>> functions;",
"type": "Map<String, Map<String, DrillFuncHolder>>",
"var_name": "functions"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolder.java",
"identifier": "FunctionRegistryHolder",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionRegistryHolder.FunctionRegistryHolder()",
"constructor": true,
"full_signature": "public FunctionRegistryHolder()",
"identifier": "FunctionRegistryHolder",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " FunctionRegistryHolder()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getVersion()",
"constructor": false,
"full_signature": "public long getVersion()",
"identifier": "getVersion",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getVersion()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"constructor": false,
"full_signature": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"identifier": "addJars",
"modifiers": "public",
"parameters": "(Map<String, List<FunctionHolder>> newJars, long version)",
"return": "void",
"signature": "void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeJar(String jarName)",
"constructor": false,
"full_signature": "public void removeJar(String jarName)",
"identifier": "removeJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllJarNames()",
"constructor": false,
"full_signature": "public List<String> getAllJarNames()",
"identifier": "getAllJarNames",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getAllJarNames()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getFunctionNamesByJar(String jarName)",
"constructor": false,
"full_signature": "public List<String> getFunctionNamesByJar(String jarName)",
"identifier": "getFunctionNamesByJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "List<String>",
"signature": "List<String> getFunctionNamesByJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders(AtomicLong version)",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "(AtomicLong version)",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders()",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithSignatures()",
"constructor": false,
"full_signature": "public ListMultimap<String, String> getAllFunctionsWithSignatures()",
"identifier": "getAllFunctionsWithSignatures",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, String>",
"signature": "ListMultimap<String, String> getAllFunctionsWithSignatures()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName, AtomicLong version)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName, AtomicLong version)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.containsJar(String jarName)",
"constructor": false,
"full_signature": "public boolean containsJar(String jarName)",
"identifier": "containsJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "boolean",
"signature": "boolean containsJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.functionsSize()",
"constructor": false,
"full_signature": "public int functionsSize()",
"identifier": "functionsSize",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int functionsSize()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getJarNameByFunctionSignature(String functionName, String functionSignature)",
"constructor": false,
"full_signature": "public String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"identifier": "getJarNameByFunctionSignature",
"modifiers": "public",
"parameters": "(String functionName, String functionSignature)",
"return": "String",
"signature": "String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"constructor": false,
"full_signature": "private void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"identifier": "addFunctions",
"modifiers": "private",
"parameters": "(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"return": "void",
"signature": "void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeAllByJar(String jarName)",
"constructor": false,
"full_signature": "private void removeAllByJar(String jarName)",
"identifier": "removeAllByJar",
"modifiers": "private",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeAllByJar(String jarName)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public String getJarNameByFunctionSignature(String functionName, String functionSignature) {\n try (AutoCloseableLock lock = readLock.open()) {\n for (Map.Entry<String, Map<String, Queue<String>>> jar : jars.entrySet()) {\n Queue<String> functionSignatures = jar.getValue().get(functionName);\n if (functionSignatures != null && functionSignatures.contains(functionSignature)) {\n return jar.getKey();\n }\n }\n }\n return null;\n }",
"class_method_signature": "FunctionRegistryHolder.getJarNameByFunctionSignature(String functionName, String functionSignature)",
"constructor": false,
"full_signature": "public String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"identifier": "getJarNameByFunctionSignature",
"invocations": [
"open",
"entrySet",
"get",
"getValue",
"contains",
"getKey"
],
"modifiers": "public",
"parameters": "(String functionName, String functionSignature)",
"return": "String",
"signature": "String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_31 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testMergeFiltersWithMissingParameters() {\n PathFilter filter = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().startsWith(\"a\");\n }\n };\n\n assertEquals(\"Should have returned initial filter\", filter, FileSystemUtil.mergeFilters(filter, null));\n assertEquals(\"Should have returned initial filter\", filter, FileSystemUtil.mergeFilters(filter, new PathFilter[]{}));\n assertEquals(\"Should have returned dummy filter\", FileSystemUtil.DUMMY_FILTER, FileSystemUtil.mergeFilters());\n }",
"class_method_signature": "FileSystemUtilTest.testMergeFiltersWithMissingParameters()",
"constructor": false,
"full_signature": "@Test public void testMergeFiltersWithMissingParameters()",
"identifier": "testMergeFiltersWithMissingParameters",
"invocations": [
"startsWith",
"getName",
"assertEquals",
"mergeFilters",
"assertEquals",
"mergeFilters",
"assertEquals",
"mergeFilters"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testMergeFiltersWithMissingParameters()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters) {\n if (filters == null || filters.length == 0) {\n return filter;\n }\n\n int length = filters.length;\n PathFilter[] newFilters = Arrays.copyOf(filters, length + 1);\n newFilters[length] = filter;\n return mergeFilters(newFilters);\n }",
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"invocations": [
"copyOf",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_27 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListAllWithFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listAll(fs, new Path(base, \"a\"), false, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\"a\") || path.getName().endsWith(\".txt\");\n }\n });\n assertEquals(\"Directory and file count should match\", 4, statuses.size());\n }",
"class_method_signature": "FileSystemUtilTest.testListAllWithFilter()",
"constructor": false,
"full_signature": "@Test public void testListAllWithFilter()",
"identifier": "testListAllWithFilter",
"invocations": [
"listAll",
"endsWith",
"getName",
"endsWith",
"getName",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListAllWithFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listAll(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }",
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"invocations": [
"listAll",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_70 | {
"fields": [
{
"declarator": "EMPTY_STATUSES = ImmutableList.of()",
"modifier": "private static final",
"original_string": "private static final List<FileStatus> EMPTY_STATUSES = ImmutableList.of();",
"type": "List<FileStatus>",
"var_name": "EMPTY_STATUSES"
},
{
"declarator": "EMPTY_FILES = ImmutableList.of()",
"modifier": "private static final",
"original_string": "private static final List<String> EMPTY_FILES = ImmutableList.of();",
"type": "List<String>",
"var_name": "EMPTY_FILES"
},
{
"declarator": "EMPTY_ROOT = \"\"",
"modifier": "private static final",
"original_string": "private static final String EMPTY_ROOT = \"\";",
"type": "String",
"var_name": "EMPTY_ROOT"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/dfs/TestFileSelection.java",
"identifier": "TestFileSelection",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void testCreateReturnsNullWhenArgumentsAreIllegal() {\n for (final Object statuses : new Object[] { null, EMPTY_STATUSES}) {\n for (final Object files : new Object[]{null, EMPTY_FILES}) {\n for (final Object root : new Object[]{null, EMPTY_ROOT}) {\n final FileSelection selection = FileSelection.create((List<FileStatus>) statuses, (List<String>) files,\n (String)root);\n assertNull(selection);\n }\n }\n }\n }",
"class_method_signature": "TestFileSelection.testCreateReturnsNullWhenArgumentsAreIllegal()",
"constructor": false,
"full_signature": "@Test public void testCreateReturnsNullWhenArgumentsAreIllegal()",
"identifier": "testCreateReturnsNullWhenArgumentsAreIllegal",
"invocations": [
"create",
"assertNull"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testCreateReturnsNullWhenArgumentsAreIllegal()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(FileSelection.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FileSelection.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "PATH_SEPARATOR = System.getProperty(\"file.separator\")",
"modifier": "private static final",
"original_string": "private static final String PATH_SEPARATOR = System.getProperty(\"file.separator\");",
"type": "String",
"var_name": "PATH_SEPARATOR"
},
{
"declarator": "WILD_CARD = \"*\"",
"modifier": "private static final",
"original_string": "private static final String WILD_CARD = \"*\";",
"type": "String",
"var_name": "WILD_CARD"
},
{
"declarator": "statuses",
"modifier": "private",
"original_string": "private List<FileStatus> statuses;",
"type": "List<FileStatus>",
"var_name": "statuses"
},
{
"declarator": "files",
"modifier": "public",
"original_string": "public List<String> files;",
"type": "List<String>",
"var_name": "files"
},
{
"declarator": "selectionRoot",
"modifier": "public final",
"original_string": "public final String selectionRoot;",
"type": "String",
"var_name": "selectionRoot"
},
{
"declarator": "cacheFileRoot",
"modifier": "public final",
"original_string": "public final String cacheFileRoot;",
"type": "String",
"var_name": "cacheFileRoot"
},
{
"declarator": "metaContext = null",
"modifier": "private",
"original_string": "private MetadataContext metaContext = null;",
"type": "MetadataContext",
"var_name": "metaContext"
},
{
"declarator": "dirStatus",
"modifier": "private",
"original_string": "private StatusType dirStatus;",
"type": "StatusType",
"var_name": "dirStatus"
},
{
"declarator": "hadWildcard = false",
"modifier": "private",
"original_string": "private boolean hadWildcard = false;",
"type": "boolean",
"var_name": "hadWildcard"
},
{
"declarator": "wasAllPartitionsPruned = false",
"modifier": "private",
"original_string": "private boolean wasAllPartitionsPruned = false;",
"type": "boolean",
"var_name": "wasAllPartitionsPruned"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSelection.java",
"identifier": "FileSelection",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSelection.FileSelection(final List<FileStatus> statuses, final List<String> files, final String selectionRoot)",
"constructor": true,
"full_signature": "public FileSelection(final List<FileStatus> statuses, final List<String> files, final String selectionRoot)",
"identifier": "FileSelection",
"modifiers": "public",
"parameters": "(final List<FileStatus> statuses, final List<String> files, final String selectionRoot)",
"return": "",
"signature": " FileSelection(final List<FileStatus> statuses, final List<String> files, final String selectionRoot)",
"testcase": false
},
{
"class_method_signature": "FileSelection.FileSelection(final List<FileStatus> statuses, final List<String> files, final String selectionRoot,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned)",
"constructor": true,
"full_signature": "public FileSelection(final List<FileStatus> statuses, final List<String> files, final String selectionRoot,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned)",
"identifier": "FileSelection",
"modifiers": "public",
"parameters": "(final List<FileStatus> statuses, final List<String> files, final String selectionRoot,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned)",
"return": "",
"signature": " FileSelection(final List<FileStatus> statuses, final List<String> files, final String selectionRoot,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned)",
"testcase": false
},
{
"class_method_signature": "FileSelection.FileSelection(final List<FileStatus> statuses, final List<String> files, final String selectionRoot,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned, final StatusType dirStatus)",
"constructor": true,
"full_signature": "public FileSelection(final List<FileStatus> statuses, final List<String> files, final String selectionRoot,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned, final StatusType dirStatus)",
"identifier": "FileSelection",
"modifiers": "public",
"parameters": "(final List<FileStatus> statuses, final List<String> files, final String selectionRoot,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned, final StatusType dirStatus)",
"return": "",
"signature": " FileSelection(final List<FileStatus> statuses, final List<String> files, final String selectionRoot,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned, final StatusType dirStatus)",
"testcase": false
},
{
"class_method_signature": "FileSelection.FileSelection(final FileSelection selection)",
"constructor": true,
"full_signature": "protected FileSelection(final FileSelection selection)",
"identifier": "FileSelection",
"modifiers": "protected",
"parameters": "(final FileSelection selection)",
"return": "",
"signature": " FileSelection(final FileSelection selection)",
"testcase": false
},
{
"class_method_signature": "FileSelection.getSelectionRoot()",
"constructor": false,
"full_signature": "public String getSelectionRoot()",
"identifier": "getSelectionRoot",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getSelectionRoot()",
"testcase": false
},
{
"class_method_signature": "FileSelection.getStatuses(final DrillFileSystem fs)",
"constructor": false,
"full_signature": "public List<FileStatus> getStatuses(final DrillFileSystem fs)",
"identifier": "getStatuses",
"modifiers": "public",
"parameters": "(final DrillFileSystem fs)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> getStatuses(final DrillFileSystem fs)",
"testcase": false
},
{
"class_method_signature": "FileSelection.getFiles()",
"constructor": false,
"full_signature": "public List<String> getFiles()",
"identifier": "getFiles",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getFiles()",
"testcase": false
},
{
"class_method_signature": "FileSelection.containsDirectories(DrillFileSystem fs)",
"constructor": false,
"full_signature": "public boolean containsDirectories(DrillFileSystem fs)",
"identifier": "containsDirectories",
"modifiers": "public",
"parameters": "(DrillFileSystem fs)",
"return": "boolean",
"signature": "boolean containsDirectories(DrillFileSystem fs)",
"testcase": false
},
{
"class_method_signature": "FileSelection.minusDirectories(DrillFileSystem fs)",
"constructor": false,
"full_signature": "public FileSelection minusDirectories(DrillFileSystem fs)",
"identifier": "minusDirectories",
"modifiers": "public",
"parameters": "(DrillFileSystem fs)",
"return": "FileSelection",
"signature": "FileSelection minusDirectories(DrillFileSystem fs)",
"testcase": false
},
{
"class_method_signature": "FileSelection.getFirstPath(DrillFileSystem fs)",
"constructor": false,
"full_signature": "public FileStatus getFirstPath(DrillFileSystem fs)",
"identifier": "getFirstPath",
"modifiers": "public",
"parameters": "(DrillFileSystem fs)",
"return": "FileStatus",
"signature": "FileStatus getFirstPath(DrillFileSystem fs)",
"testcase": false
},
{
"class_method_signature": "FileSelection.setExpandedFully()",
"constructor": false,
"full_signature": "public void setExpandedFully()",
"identifier": "setExpandedFully",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void setExpandedFully()",
"testcase": false
},
{
"class_method_signature": "FileSelection.isExpandedFully()",
"constructor": false,
"full_signature": "public boolean isExpandedFully()",
"identifier": "isExpandedFully",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isExpandedFully()",
"testcase": false
},
{
"class_method_signature": "FileSelection.setExpandedPartial()",
"constructor": false,
"full_signature": "public void setExpandedPartial()",
"identifier": "setExpandedPartial",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void setExpandedPartial()",
"testcase": false
},
{
"class_method_signature": "FileSelection.isExpandedPartial()",
"constructor": false,
"full_signature": "public boolean isExpandedPartial()",
"identifier": "isExpandedPartial",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isExpandedPartial()",
"testcase": false
},
{
"class_method_signature": "FileSelection.getDirStatus()",
"constructor": false,
"full_signature": "public StatusType getDirStatus()",
"identifier": "getDirStatus",
"modifiers": "public",
"parameters": "()",
"return": "StatusType",
"signature": "StatusType getDirStatus()",
"testcase": false
},
{
"class_method_signature": "FileSelection.wasAllPartitionsPruned()",
"constructor": false,
"full_signature": "public boolean wasAllPartitionsPruned()",
"identifier": "wasAllPartitionsPruned",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean wasAllPartitionsPruned()",
"testcase": false
},
{
"class_method_signature": "FileSelection.commonPath(final List<FileStatus> statuses)",
"constructor": false,
"full_signature": "private static String commonPath(final List<FileStatus> statuses)",
"identifier": "commonPath",
"modifiers": "private static",
"parameters": "(final List<FileStatus> statuses)",
"return": "String",
"signature": "String commonPath(final List<FileStatus> statuses)",
"testcase": false
},
{
"class_method_signature": "FileSelection.commonPathForFiles(final List<String> files)",
"constructor": false,
"full_signature": "private static String commonPathForFiles(final List<String> files)",
"identifier": "commonPathForFiles",
"modifiers": "private static",
"parameters": "(final List<String> files)",
"return": "String",
"signature": "String commonPathForFiles(final List<String> files)",
"testcase": false
},
{
"class_method_signature": "FileSelection.buildPath(final String[] path, final int folderIndex)",
"constructor": false,
"full_signature": "private static String buildPath(final String[] path, final int folderIndex)",
"identifier": "buildPath",
"modifiers": "private static",
"parameters": "(final String[] path, final int folderIndex)",
"return": "String",
"signature": "String buildPath(final String[] path, final int folderIndex)",
"testcase": false
},
{
"class_method_signature": "FileSelection.create(final DrillFileSystem fs, final String parent, final String path)",
"constructor": false,
"full_signature": "public static FileSelection create(final DrillFileSystem fs, final String parent, final String path)",
"identifier": "create",
"modifiers": "public static",
"parameters": "(final DrillFileSystem fs, final String parent, final String path)",
"return": "FileSelection",
"signature": "FileSelection create(final DrillFileSystem fs, final String parent, final String path)",
"testcase": false
},
{
"class_method_signature": "FileSelection.create(final List<FileStatus> statuses, final List<String> files, final String root,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned)",
"constructor": false,
"full_signature": "public static FileSelection create(final List<FileStatus> statuses, final List<String> files, final String root,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned)",
"identifier": "create",
"modifiers": "public static",
"parameters": "(final List<FileStatus> statuses, final List<String> files, final String root,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned)",
"return": "FileSelection",
"signature": "FileSelection create(final List<FileStatus> statuses, final List<String> files, final String root,\n final String cacheFileRoot, final boolean wasAllPartitionsPruned)",
"testcase": false
},
{
"class_method_signature": "FileSelection.create(final List<FileStatus> statuses, final List<String> files, final String root)",
"constructor": false,
"full_signature": "public static FileSelection create(final List<FileStatus> statuses, final List<String> files, final String root)",
"identifier": "create",
"modifiers": "public static",
"parameters": "(final List<FileStatus> statuses, final List<String> files, final String root)",
"return": "FileSelection",
"signature": "FileSelection create(final List<FileStatus> statuses, final List<String> files, final String root)",
"testcase": false
},
{
"class_method_signature": "FileSelection.createFromDirectories(final List<String> dirPaths, final FileSelection selection,\n final String cacheFileRoot)",
"constructor": false,
"full_signature": "public static FileSelection createFromDirectories(final List<String> dirPaths, final FileSelection selection,\n final String cacheFileRoot)",
"identifier": "createFromDirectories",
"modifiers": "public static",
"parameters": "(final List<String> dirPaths, final FileSelection selection,\n final String cacheFileRoot)",
"return": "FileSelection",
"signature": "FileSelection createFromDirectories(final List<String> dirPaths, final FileSelection selection,\n final String cacheFileRoot)",
"testcase": false
},
{
"class_method_signature": "FileSelection.handleWildCard(final String root)",
"constructor": false,
"full_signature": "private static Path handleWildCard(final String root)",
"identifier": "handleWildCard",
"modifiers": "private static",
"parameters": "(final String root)",
"return": "Path",
"signature": "Path handleWildCard(final String root)",
"testcase": false
},
{
"class_method_signature": "FileSelection.removeLeadingSlash(String path)",
"constructor": false,
"full_signature": "private static String removeLeadingSlash(String path)",
"identifier": "removeLeadingSlash",
"modifiers": "private static",
"parameters": "(String path)",
"return": "String",
"signature": "String removeLeadingSlash(String path)",
"testcase": false
},
{
"class_method_signature": "FileSelection.getFileStatuses()",
"constructor": false,
"full_signature": "public List<FileStatus> getFileStatuses()",
"identifier": "getFileStatuses",
"modifiers": "public",
"parameters": "()",
"return": "List<FileStatus>",
"signature": "List<FileStatus> getFileStatuses()",
"testcase": false
},
{
"class_method_signature": "FileSelection.supportDirPrunig()",
"constructor": false,
"full_signature": "public boolean supportDirPrunig()",
"identifier": "supportDirPrunig",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean supportDirPrunig()",
"testcase": false
},
{
"class_method_signature": "FileSelection.setHadWildcard(boolean wc)",
"constructor": false,
"full_signature": "public void setHadWildcard(boolean wc)",
"identifier": "setHadWildcard",
"modifiers": "public",
"parameters": "(boolean wc)",
"return": "void",
"signature": "void setHadWildcard(boolean wc)",
"testcase": false
},
{
"class_method_signature": "FileSelection.hadWildcard()",
"constructor": false,
"full_signature": "public boolean hadWildcard()",
"identifier": "hadWildcard",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean hadWildcard()",
"testcase": false
},
{
"class_method_signature": "FileSelection.getCacheFileRoot()",
"constructor": false,
"full_signature": "public String getCacheFileRoot()",
"identifier": "getCacheFileRoot",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getCacheFileRoot()",
"testcase": false
},
{
"class_method_signature": "FileSelection.setMetaContext(MetadataContext context)",
"constructor": false,
"full_signature": "public void setMetaContext(MetadataContext context)",
"identifier": "setMetaContext",
"modifiers": "public",
"parameters": "(MetadataContext context)",
"return": "void",
"signature": "void setMetaContext(MetadataContext context)",
"testcase": false
},
{
"class_method_signature": "FileSelection.getMetaContext()",
"constructor": false,
"full_signature": "public MetadataContext getMetaContext()",
"identifier": "getMetaContext",
"modifiers": "public",
"parameters": "()",
"return": "MetadataContext",
"signature": "MetadataContext getMetaContext()",
"testcase": false
},
{
"class_method_signature": "FileSelection.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static FileSelection create(final DrillFileSystem fs, final String parent, final String path) throws IOException {\n Stopwatch timer = Stopwatch.createStarted();\n boolean hasWildcard = path.contains(WILD_CARD);\n\n final Path combined = new Path(parent, removeLeadingSlash(path));\n final FileStatus[] statuses = fs.globStatus(combined); // note: this would expand wildcards\n if (statuses == null) {\n return null;\n }\n final FileSelection fileSel = create(Lists.newArrayList(statuses), null, combined.toUri().getPath());\n logger.debug(\"FileSelection.create() took {} ms \", timer.elapsed(TimeUnit.MILLISECONDS));\n if (fileSel == null) {\n return null;\n }\n fileSel.setHadWildcard(hasWildcard);\n return fileSel;\n\n }",
"class_method_signature": "FileSelection.create(final DrillFileSystem fs, final String parent, final String path)",
"constructor": false,
"full_signature": "public static FileSelection create(final DrillFileSystem fs, final String parent, final String path)",
"identifier": "create",
"invocations": [
"createStarted",
"contains",
"removeLeadingSlash",
"globStatus",
"create",
"newArrayList",
"getPath",
"toUri",
"debug",
"elapsed",
"setHadWildcard"
],
"modifiers": "public static",
"parameters": "(final DrillFileSystem fs, final String parent, final String path)",
"return": "FileSelection",
"signature": "FileSelection create(final DrillFileSystem fs, final String parent, final String path)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_8 | {
"fields": [
{
"declarator": "MAX_ALLOCATION = 8 * 1024",
"modifier": "private final static",
"original_string": "private final static int MAX_ALLOCATION = 8 * 1024;",
"type": "int",
"var_name": "MAX_ALLOCATION"
}
],
"file": "exec/memory/base/src/test/java/org/apache/drill/exec/memory/TestBaseAllocator.java",
"identifier": "TestBaseAllocator",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAllocator_slicesOfSlices() throws Exception {\n// final AllocatorOwner allocatorOwner = new NamedOwner(\"slicesOfSlices\");\n try(final RootAllocator rootAllocator =\n new RootAllocator(MAX_ALLOCATION)) {\n // Populate a buffer with byte values corresponding to their indices.\n final DrillBuf drillBuf = rootAllocator.buffer(256);\n for(int i = 0; i < 256; ++i) {\n drillBuf.writeByte(i);\n }\n\n // Slice it up.\n final DrillBuf slice0 = drillBuf.slice(0, drillBuf.capacity());\n for(int i = 0; i < 256; ++i) {\n assertEquals((byte) i, drillBuf.getByte(i));\n }\n\n final DrillBuf slice10 = slice0.slice(10, drillBuf.capacity() - 10);\n for(int i = 10; i < 256; ++i) {\n assertEquals((byte) i, slice10.getByte(i - 10));\n }\n\n final DrillBuf slice20 = slice10.slice(10, drillBuf.capacity() - 20);\n for(int i = 20; i < 256; ++i) {\n assertEquals((byte) i, slice20.getByte(i - 20));\n }\n\n final DrillBuf slice30 = slice20.slice(10, drillBuf.capacity() - 30);\n for(int i = 30; i < 256; ++i) {\n assertEquals((byte) i, slice30.getByte(i - 30));\n }\n\n drillBuf.release();\n }\n }",
"class_method_signature": "TestBaseAllocator.testAllocator_slicesOfSlices()",
"constructor": false,
"full_signature": "@Test public void testAllocator_slicesOfSlices()",
"identifier": "testAllocator_slicesOfSlices",
"invocations": [
"buffer",
"writeByte",
"slice",
"capacity",
"assertEquals",
"getByte",
"slice",
"capacity",
"assertEquals",
"getByte",
"slice",
"capacity",
"assertEquals",
"getByte",
"slice",
"capacity",
"assertEquals",
"getByte",
"release"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testAllocator_slicesOfSlices()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\"",
"modifier": "public static final",
"original_string": "public static final String DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\";",
"type": "String",
"var_name": "DEBUG_ALLOCATOR"
},
{
"declarator": "ID_GENERATOR = new AtomicLong(0)",
"modifier": "@SuppressWarnings(\"unused\")\n private static final",
"original_string": "@SuppressWarnings(\"unused\")\n private static final AtomicLong ID_GENERATOR = new AtomicLong(0);",
"type": "AtomicLong",
"var_name": "ID_GENERATOR"
},
{
"declarator": "CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize()",
"modifier": "private static final",
"original_string": "private static final int CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize();",
"type": "int",
"var_name": "CHUNK_SIZE"
},
{
"declarator": "DEBUG_LOG_LENGTH = 6",
"modifier": "public static final",
"original_string": "public static final int DEBUG_LOG_LENGTH = 6;",
"type": "int",
"var_name": "DEBUG_LOG_LENGTH"
},
{
"declarator": "DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"))",
"modifier": "public static final",
"original_string": "public static final boolean DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"));",
"type": "boolean",
"var_name": "DEBUG"
},
{
"declarator": "IO_BUFFER_SIZE = 32*1024",
"modifier": "private static final",
"original_string": "private static final int IO_BUFFER_SIZE = 32*1024;",
"type": "int",
"var_name": "IO_BUFFER_SIZE"
},
{
"declarator": "DEBUG_LOCK = DEBUG ? new Object() : null",
"modifier": "private final",
"original_string": "private final Object DEBUG_LOCK = DEBUG ? new Object() : null;",
"type": "Object",
"var_name": "DEBUG_LOCK"
},
{
"declarator": "parentAllocator",
"modifier": "private final",
"original_string": "private final BaseAllocator parentAllocator;",
"type": "BaseAllocator",
"var_name": "parentAllocator"
},
{
"declarator": "thisAsByteBufAllocator",
"modifier": "private final",
"original_string": "private final ByteBufAllocator thisAsByteBufAllocator;",
"type": "ByteBufAllocator",
"var_name": "thisAsByteBufAllocator"
},
{
"declarator": "childAllocators",
"modifier": "private final",
"original_string": "private final IdentityHashMap<BaseAllocator, Object> childAllocators;",
"type": "IdentityHashMap<BaseAllocator, Object>",
"var_name": "childAllocators"
},
{
"declarator": "empty",
"modifier": "private final",
"original_string": "private final DrillBuf empty;",
"type": "DrillBuf",
"var_name": "empty"
},
{
"declarator": "isClosed = false",
"modifier": "private volatile",
"original_string": "private volatile boolean isClosed = false;",
"type": "boolean",
"var_name": "isClosed"
},
{
"declarator": "name",
"modifier": "final",
"original_string": "final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "root",
"modifier": "final",
"original_string": "final RootAllocator root;",
"type": "RootAllocator",
"var_name": "root"
},
{
"declarator": "childLedgers",
"modifier": "private final",
"original_string": "private final IdentityHashMap<BufferLedger, Object> childLedgers;",
"type": "IdentityHashMap<BufferLedger, Object>",
"var_name": "childLedgers"
},
{
"declarator": "reservations",
"modifier": "private final",
"original_string": "private final IdentityHashMap<Reservation, Object> reservations;",
"type": "IdentityHashMap<Reservation, Object>",
"var_name": "reservations"
},
{
"declarator": "historicalLog",
"modifier": "private final",
"original_string": "private final HistoricalLog historicalLog;",
"type": "HistoricalLog",
"var_name": "historicalLog"
},
{
"declarator": "ioBuffer[]",
"modifier": "private",
"original_string": "private byte ioBuffer[];",
"type": "byte",
"var_name": "ioBuffer"
}
],
"file": "exec/memory/base/src/main/java/org/apache/drill/exec/memory/BaseAllocator.java",
"identifier": "BaseAllocator",
"interfaces": "implements BufferAllocator",
"methods": [
{
"class_method_signature": "BaseAllocator.BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"constructor": true,
"full_signature": "protected BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"identifier": "BaseAllocator",
"modifiers": "protected",
"parameters": "(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"return": "",
"signature": " BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.assertOpen()",
"constructor": false,
"full_signature": "@Override public void assertOpen()",
"identifier": "assertOpen",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void assertOpen()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getName()",
"constructor": false,
"full_signature": "@Override public String getName()",
"identifier": "getName",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String getName()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getEmpty()",
"constructor": false,
"full_signature": "@Override public DrillBuf getEmpty()",
"identifier": "getEmpty",
"modifiers": "@Override public",
"parameters": "()",
"return": "DrillBuf",
"signature": "DrillBuf getEmpty()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.associateLedger(BufferLedger ledger)",
"constructor": false,
"full_signature": " void associateLedger(BufferLedger ledger)",
"identifier": "associateLedger",
"modifiers": "",
"parameters": "(BufferLedger ledger)",
"return": "void",
"signature": "void associateLedger(BufferLedger ledger)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.dissociateLedger(BufferLedger ledger)",
"constructor": false,
"full_signature": " void dissociateLedger(BufferLedger ledger)",
"identifier": "dissociateLedger",
"modifiers": "",
"parameters": "(BufferLedger ledger)",
"return": "void",
"signature": "void dissociateLedger(BufferLedger ledger)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.childClosed(final BaseAllocator childAllocator)",
"constructor": false,
"full_signature": "private void childClosed(final BaseAllocator childAllocator)",
"identifier": "childClosed",
"modifiers": "private",
"parameters": "(final BaseAllocator childAllocator)",
"return": "void",
"signature": "void childClosed(final BaseAllocator childAllocator)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"constructor": false,
"full_signature": "private static String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"identifier": "createErrorMsg",
"modifiers": "private static",
"parameters": "(final BufferAllocator allocator, final int rounded, final int requested)",
"return": "String",
"signature": "String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize)",
"identifier": "buffer",
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.createEmpty()",
"constructor": false,
"full_signature": "private DrillBuf createEmpty()",
"identifier": "createEmpty",
"modifiers": "private",
"parameters": "()",
"return": "DrillBuf",
"signature": "DrillBuf createEmpty()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize, BufferManager manager)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize, BufferManager manager)",
"identifier": "buffer",
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize, BufferManager manager)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize, BufferManager manager)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.bufferWithoutReservation(final int size, BufferManager bufferManager)",
"constructor": false,
"full_signature": "private DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)",
"identifier": "bufferWithoutReservation",
"modifiers": "private",
"parameters": "(final int size, BufferManager bufferManager)",
"return": "DrillBuf",
"signature": "DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getAsByteBufAllocator()",
"constructor": false,
"full_signature": "@Override public ByteBufAllocator getAsByteBufAllocator()",
"identifier": "getAsByteBufAllocator",
"modifiers": "@Override public",
"parameters": "()",
"return": "ByteBufAllocator",
"signature": "ByteBufAllocator getAsByteBufAllocator()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"constructor": false,
"full_signature": "@Override public BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"identifier": "newChildAllocator",
"modifiers": "@Override public",
"parameters": "(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"return": "BufferAllocator",
"signature": "BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.newReservation()",
"constructor": false,
"full_signature": "@Override public AllocationReservation newReservation()",
"identifier": "newReservation",
"modifiers": "@Override public",
"parameters": "()",
"return": "AllocationReservation",
"signature": "AllocationReservation newReservation()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.close()",
"constructor": false,
"full_signature": "@Override public synchronized void close()",
"identifier": "close",
"modifiers": "@Override public synchronized",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.toVerboseString()",
"constructor": false,
"full_signature": "@Override public String toVerboseString()",
"identifier": "toVerboseString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toVerboseString()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.hist(String noteFormat, Object... args)",
"constructor": false,
"full_signature": "private void hist(String noteFormat, Object... args)",
"identifier": "hist",
"modifiers": "private",
"parameters": "(String noteFormat, Object... args)",
"return": "void",
"signature": "void hist(String noteFormat, Object... args)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.nextPowerOfTwo(int val)",
"constructor": false,
"full_signature": "public static int nextPowerOfTwo(int val)",
"identifier": "nextPowerOfTwo",
"modifiers": "public static",
"parameters": "(int val)",
"return": "int",
"signature": "int nextPowerOfTwo(int val)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.verifyAllocator()",
"constructor": false,
"full_signature": " void verifyAllocator()",
"identifier": "verifyAllocator",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void verifyAllocator()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"constructor": false,
"full_signature": "private void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"identifier": "verifyAllocator",
"modifiers": "private",
"parameters": "(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"return": "void",
"signature": "void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.print(StringBuilder sb, int level, Verbosity verbosity)",
"constructor": false,
"full_signature": " void print(StringBuilder sb, int level, Verbosity verbosity)",
"identifier": "print",
"modifiers": "",
"parameters": "(StringBuilder sb, int level, Verbosity verbosity)",
"return": "void",
"signature": "void print(StringBuilder sb, int level, Verbosity verbosity)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"constructor": false,
"full_signature": "private void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"identifier": "dumpBuffers",
"modifiers": "private",
"parameters": "(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"return": "void",
"signature": "void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.indent(StringBuilder sb, int indent)",
"constructor": false,
"full_signature": "public static StringBuilder indent(StringBuilder sb, int indent)",
"identifier": "indent",
"modifiers": "public static",
"parameters": "(StringBuilder sb, int indent)",
"return": "StringBuilder",
"signature": "StringBuilder indent(StringBuilder sb, int indent)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.isDebug()",
"constructor": false,
"full_signature": "public static boolean isDebug()",
"identifier": "isDebug",
"modifiers": "public static",
"parameters": "()",
"return": "boolean",
"signature": "boolean isDebug()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getIOBuffer()",
"constructor": false,
"full_signature": "public byte[] getIOBuffer()",
"identifier": "getIOBuffer",
"modifiers": "public",
"parameters": "()",
"return": "byte[]",
"signature": "byte[] getIOBuffer()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.read(DrillBuf buf, int length, InputStream in)",
"constructor": false,
"full_signature": "@Override public void read(DrillBuf buf, int length, InputStream in)",
"identifier": "read",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, int length, InputStream in)",
"return": "void",
"signature": "void read(DrillBuf buf, int length, InputStream in)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.read(int length, InputStream in)",
"constructor": false,
"full_signature": "public DrillBuf read(int length, InputStream in)",
"identifier": "read",
"modifiers": "public",
"parameters": "(int length, InputStream in)",
"return": "DrillBuf",
"signature": "DrillBuf read(int length, InputStream in)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.write(DrillBuf buf, OutputStream out)",
"constructor": false,
"full_signature": "@Override public void write(DrillBuf buf, OutputStream out)",
"identifier": "write",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, OutputStream out)",
"return": "void",
"signature": "void write(DrillBuf buf, OutputStream out)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.write(DrillBuf buf, int length, OutputStream out)",
"constructor": false,
"full_signature": "@Override public void write(DrillBuf buf, int length, OutputStream out)",
"identifier": "write",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, int length, OutputStream out)",
"return": "void",
"signature": "void write(DrillBuf buf, int length, OutputStream out)",
"testcase": false
}
],
"superclass": "extends Accountant"
} | {
"body": "@Override\n public DrillBuf buffer(final int initialRequestSize) {\n assertOpen();\n\n return buffer(initialRequestSize, null);\n }",
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize)",
"identifier": "buffer",
"invocations": [
"assertOpen",
"buffer"
],
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_50 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/work/metadata/TestMetadataProvider.java",
"identifier": "TestMetadataProvider",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void schemas() throws Exception {\n // test(\"SELECT * FROM INFORMATION_SCHEMA.SCHEMATA\"); // SQL equivalent\n\n GetSchemasResp resp = client.getSchemas(null, null).get();\n\n assertEquals(RequestStatus.OK, resp.getStatus());\n List<SchemaMetadata> schemas = resp.getSchemasList();\n assertEquals(9, schemas.size());\n\n verifySchema(\"INFORMATION_SCHEMA\", schemas);\n verifySchema(\"cp.default\", schemas);\n verifySchema(\"dfs.default\", schemas);\n verifySchema(\"dfs.root\", schemas);\n verifySchema(\"dfs.tmp\", schemas);\n verifySchema(\"dfs_test.default\", schemas);\n verifySchema(\"dfs_test.home\", schemas);\n verifySchema(\"dfs_test.tmp\", schemas);\n verifySchema(\"sys\", schemas);\n }",
"class_method_signature": "TestMetadataProvider.schemas()",
"constructor": false,
"full_signature": "@Test public void schemas()",
"identifier": "schemas",
"invocations": [
"get",
"getSchemas",
"assertEquals",
"getStatus",
"getSchemasList",
"assertEquals",
"size",
"verifySchema",
"verifySchema",
"verifySchema",
"verifySchema",
"verifySchema",
"verifySchema",
"verifySchema",
"verifySchema",
"verifySchema"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void schemas()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(MetadataProvider.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(MetadataProvider.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "IN_FUNCTION = \"in\"",
"modifier": "private static final",
"original_string": "private static final String IN_FUNCTION = \"in\";",
"type": "String",
"var_name": "IN_FUNCTION"
},
{
"declarator": "LIKE_FUNCTION = \"like\"",
"modifier": "private static final",
"original_string": "private static final String LIKE_FUNCTION = \"like\";",
"type": "String",
"var_name": "LIKE_FUNCTION"
},
{
"declarator": "AND_FUNCTION = \"booleanand\"",
"modifier": "private static final",
"original_string": "private static final String AND_FUNCTION = \"booleanand\";",
"type": "String",
"var_name": "AND_FUNCTION"
},
{
"declarator": "OR_FUNCTION = \"booleanor\"",
"modifier": "private static final",
"original_string": "private static final String OR_FUNCTION = \"booleanor\";",
"type": "String",
"var_name": "OR_FUNCTION"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/work/metadata/MetadataProvider.java",
"identifier": "MetadataProvider",
"interfaces": "",
"methods": [
{
"class_method_signature": "MetadataProvider.catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"identifier": "catalogs",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"identifier": "schemas",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"identifier": "tables",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"identifier": "columns",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"constructor": false,
"full_signature": "private static InfoSchemaFilter createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"identifier": "createInfoSchemaFilter",
"modifiers": "private static",
"parameters": "(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"return": "InfoSchemaFilter",
"signature": "InfoSchemaFilter createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"constructor": false,
"full_signature": "private static FunctionExprNode createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"identifier": "createLikeFunctionExprNode",
"modifiers": "private static",
"parameters": "(String fieldName, LikeFilter likeFilter)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"constructor": false,
"full_signature": "private static FunctionExprNode createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"identifier": "createInFunctionExprNode",
"modifiers": "private static",
"parameters": "(String fieldName, List<String> valuesFilter)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"constructor": false,
"full_signature": "private static FunctionExprNode combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"identifier": "combineFunctions",
"modifiers": "private static",
"parameters": "(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"constructor": false,
"full_signature": "private static PojoRecordReader<S> getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"identifier": "getPojoRecordReader",
"modifiers": "private static",
"parameters": "(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"return": "PojoRecordReader<S>",
"signature": "PojoRecordReader<S> getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"constructor": false,
"full_signature": "private static SchemaConfigInfoProvider newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"identifier": "newSchemaConfigInfoProvider",
"modifiers": "private static",
"parameters": "(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"return": "SchemaConfigInfoProvider",
"signature": "SchemaConfigInfoProvider newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createPBError(final String failedFunction, final Throwable ex)",
"constructor": false,
"full_signature": "static DrillPBError createPBError(final String failedFunction, final Throwable ex)",
"identifier": "createPBError",
"modifiers": "static",
"parameters": "(final String failedFunction, final Throwable ex)",
"return": "DrillPBError",
"signature": "DrillPBError createPBError(final String failedFunction, final Throwable ex)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Runnable schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender) {\n return new SchemasProvider(session, dContext, req, responseSender);\n }",
"class_method_signature": "MetadataProvider.schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"identifier": "schemas",
"invocations": [],
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_11 | {
"fields": [
{
"declarator": "N1_EP1 = newDrillbitEndpoint(\"node1\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP1 = newDrillbitEndpoint(\"node1\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP1"
},
{
"declarator": "N1_EP2 = newDrillbitEndpoint(\"node1\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP2 = newDrillbitEndpoint(\"node1\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP2"
},
{
"declarator": "N2_EP1 = newDrillbitEndpoint(\"node2\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP1 = newDrillbitEndpoint(\"node2\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP1"
},
{
"declarator": "N2_EP2 = newDrillbitEndpoint(\"node2\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP2 = newDrillbitEndpoint(\"node2\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP2"
},
{
"declarator": "N3_EP1 = newDrillbitEndpoint(\"node3\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP1 = newDrillbitEndpoint(\"node3\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP1"
},
{
"declarator": "N3_EP2 = newDrillbitEndpoint(\"node3\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP2 = newDrillbitEndpoint(\"node3\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP2"
},
{
"declarator": "N4_EP2 = newDrillbitEndpoint(\"node4\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N4_EP2 = newDrillbitEndpoint(\"node4\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N4_EP2"
},
{
"declarator": "fragment",
"modifier": "@Mocked private",
"original_string": "@Mocked private Fragment fragment;",
"type": "Fragment",
"var_name": "fragment"
},
{
"declarator": "root",
"modifier": "@Mocked private",
"original_string": "@Mocked private PhysicalOperator root;",
"type": "PhysicalOperator",
"var_name": "root"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/planner/fragment/TestHardAffinityFragmentParallelizer.java",
"identifier": "TestHardAffinityFragmentParallelizer",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void simpleCase2() throws Exception {\n // Set the slice target to 1\n final Wrapper wrapper = newWrapper(200, 1, 20, Collections.singletonList(new EndpointAffinity(N1_EP1, 1.0, true, MAX_VALUE)));\n INSTANCE.parallelizeFragment(wrapper, newParameters(1, 5, 20), null);\n\n // Expect the fragment parallelization to be 5:\n // 1. the cost (200) is above the threshold (SLICE_TARGET_DEFAULT) (which gives 200/1=200 width) and\n // 2. Max width per node is 5 (limits the width 200 to 5)\n assertEquals(5, wrapper.getWidth());\n\n final List<DrillbitEndpoint> assignedEps = wrapper.getAssignedEndpoints();\n assertEquals(5, assignedEps.size());\n for (DrillbitEndpoint ep : assignedEps) {\n assertEquals(N1_EP1, ep);\n }\n }",
"class_method_signature": "TestHardAffinityFragmentParallelizer.simpleCase2()",
"constructor": false,
"full_signature": "@Test public void simpleCase2()",
"identifier": "simpleCase2",
"invocations": [
"newWrapper",
"singletonList",
"parallelizeFragment",
"newParameters",
"assertEquals",
"getWidth",
"getAssignedEndpoints",
"assertEquals",
"size",
"assertEquals"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void simpleCase2()",
"testcase": true
} | {
"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);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "INSTANCE = new HardAffinityFragmentParallelizer()",
"modifier": "public static final",
"original_string": "public static final HardAffinityFragmentParallelizer INSTANCE = new HardAffinityFragmentParallelizer();",
"type": "HardAffinityFragmentParallelizer",
"var_name": "INSTANCE"
},
{
"declarator": "EOL = System.getProperty(\"line.separator\")",
"modifier": "private static",
"original_string": "private static String EOL = System.getProperty(\"line.separator\");",
"type": "String",
"var_name": "EOL"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/HardAffinityFragmentParallelizer.java",
"identifier": "HardAffinityFragmentParallelizer",
"interfaces": "implements FragmentParallelizer",
"methods": [
{
"class_method_signature": "HardAffinityFragmentParallelizer.HardAffinityFragmentParallelizer()",
"constructor": true,
"full_signature": "private HardAffinityFragmentParallelizer()",
"identifier": "HardAffinityFragmentParallelizer",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HardAffinityFragmentParallelizer()",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"constructor": false,
"full_signature": "private static void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"identifier": "checkOrThrow",
"modifiers": "private static",
"parameters": "(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"return": "void",
"signature": "void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints) throws PhysicalOperatorSetupException {\n\n final Stats stats = fragmentWrapper.getStats();\n final ParallelizationInfo pInfo = stats.getParallelizationInfo();\n\n int totalMaxWidth = 0;\n\n // Go through the affinity map and extract the endpoints that have mandatory assignment requirement\n final Map<DrillbitEndpoint, EndpointAffinity> endpointPool = Maps.newHashMap();\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : pInfo.getEndpointAffinityMap().entrySet()) {\n if (entry.getValue().isAssignmentRequired()) {\n endpointPool.put(entry.getKey(), entry.getValue());\n\n // Limit the max width of the endpoint to allowed max width.\n totalMaxWidth += Math.min(parameters.getMaxWidthPerNode(), entry.getValue().getMaxWidth());\n if (totalMaxWidth < 0) {\n // If the totalWidth overflows, just keep it at the max value.\n totalMaxWidth = Integer.MAX_VALUE;\n }\n }\n }\n\n // Step 1: Find the width taking into various parameters\n // 1.1. Find the parallelization based on cost. Use max cost of all operators in this fragment; this is consistent\n // with the calculation that ExcessiveExchangeRemover uses.\n int width = (int) Math.ceil(stats.getMaxCost() / parameters.getSliceTarget());\n\n // 1.2. Make sure the width is at least the number of endpoints that require an assignment\n width = Math.max(endpointPool.size(), width);\n\n // 1.3. Cap the parallelization width by fragment level width limit and system level per query width limit\n width = Math.max(1, Math.min(width, pInfo.getMaxWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed fragment max \" +\n \"width ({}).\", endpointPool.size(), pInfo.getMaxWidth());\n\n // 1.4 Cap the parallelization width by global max query width\n width = Math.max(1, Math.min(width, parameters.getMaxGlobalWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed global query \" +\n \"width ({}).\", endpointPool.size(), parameters.getMaxGlobalWidth());\n\n // 1.5 Cap the parallelization width by max allowed parallelization per node\n width = Math.max(1, Math.min(width, endpointPool.size()*parameters.getMaxWidthPerNode()));\n\n // 1.6 Cap the parallelization width by total of max allowed width per node. The reason is if we the width is more,\n // we end up allocating more work units to one or more endpoints that don't have those many work units.\n width = Math.min(totalMaxWidth, width);\n\n // Step 2: Select the endpoints\n final Map<DrillbitEndpoint, Integer> endpoints = Maps.newHashMap();\n\n // 2.1 First add each endpoint from the pool once so that the mandatory assignment requirement is fulfilled.\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : endpointPool.entrySet()) {\n endpoints.put(entry.getKey(), 1);\n }\n int totalAssigned = endpoints.size();\n\n // 2.2 Assign the remaining slots to endpoints proportional to the affinity of each endpoint\n int remainingSlots = width - endpoints.size();\n while (remainingSlots > 0) {\n for(EndpointAffinity epAf : endpointPool.values()) {\n final int moreAllocation = (int) Math.ceil(epAf.getAffinity() * remainingSlots);\n int currentAssignments = endpoints.get(epAf.getEndpoint());\n for(int i=0;\n i < moreAllocation &&\n totalAssigned < width &&\n currentAssignments < parameters.getMaxWidthPerNode() &&\n currentAssignments < epAf.getMaxWidth();\n i++) {\n totalAssigned++;\n currentAssignments++;\n }\n endpoints.put(epAf.getEndpoint(), currentAssignments);\n }\n final int previousRemainingSlots = remainingSlots;\n remainingSlots = width - totalAssigned;\n if (previousRemainingSlots == remainingSlots) {\n logger.error(\"Can't parallelize fragment: \" +\n \"Every mandatory node has exhausted the maximum width per node limit.\" + EOL +\n \"Endpoint pool: {}\" + EOL + \"Assignment so far: {}\" + EOL + \"Width: {}\", endpointPool, endpoints, width);\n throw new PhysicalOperatorSetupException(\"Can not parallelize fragment.\");\n }\n }\n\n final List<DrillbitEndpoint> assignedEndpoints = Lists.newArrayList();\n for(Entry<DrillbitEndpoint, Integer> entry : endpoints.entrySet()) {\n for(int i=0; i < entry.getValue(); i++) {\n assignedEndpoints.add(entry.getKey());\n }\n }\n\n fragmentWrapper.setWidth(width);\n fragmentWrapper.assignEndpoints(assignedEndpoints);\n }",
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"invocations": [
"getStats",
"getParallelizationInfo",
"newHashMap",
"entrySet",
"getEndpointAffinityMap",
"isAssignmentRequired",
"getValue",
"put",
"getKey",
"getValue",
"min",
"getMaxWidthPerNode",
"getMaxWidth",
"getValue",
"ceil",
"getMaxCost",
"getSliceTarget",
"max",
"size",
"max",
"min",
"getMaxWidth",
"checkOrThrow",
"size",
"size",
"getMaxWidth",
"max",
"min",
"getMaxGlobalWidth",
"checkOrThrow",
"size",
"size",
"getMaxGlobalWidth",
"max",
"min",
"size",
"getMaxWidthPerNode",
"min",
"newHashMap",
"entrySet",
"put",
"getKey",
"size",
"size",
"values",
"ceil",
"getAffinity",
"get",
"getEndpoint",
"getMaxWidthPerNode",
"getMaxWidth",
"put",
"getEndpoint",
"error",
"newArrayList",
"entrySet",
"getValue",
"add",
"getKey",
"setWidth",
"assignEndpoints"
],
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_85 | {
"fields": [
{
"declarator": "writer",
"modifier": "private static",
"original_string": "private static VectorContainerWriter writer;",
"type": "VectorContainerWriter",
"var_name": "writer"
},
{
"declarator": "mutator",
"modifier": "private static",
"original_string": "private static TestOutputMutator mutator;",
"type": "TestOutputMutator",
"var_name": "mutator"
},
{
"declarator": "bsonReader",
"modifier": "private static",
"original_string": "private static BsonRecordReader bsonReader;",
"type": "BsonRecordReader",
"var_name": "bsonReader"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java",
"identifier": "TestBsonRecordReader",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void testBinaryTypes() throws IOException {\n // test with different binary types\n BsonDocument bsonDoc = new BsonDocument();\n // Binary\n // String\n byte[] bytes = \"binaryValue\".getBytes();\n bsonDoc.append(\"binaryKey\", new BsonBinary(BsonBinarySubType.BINARY, bytes));\n // String\n byte[] bytesString = \"binaryStringValue\".getBytes();\n bsonDoc.append(\"binaryStringKey\", new BsonBinary((byte) 2, bytesString));\n // Double\n byte[] bytesDouble = new byte[8];\n java.nio.ByteBuffer.wrap(bytesDouble).putDouble(23.0123);\n BsonBinary bsonDouble = new BsonBinary((byte) 1, bytesDouble);\n bsonDoc.append(\"binaryDouble\", bsonDouble);\n // Boolean\n byte[] booleanBytes = new byte[8];\n java.nio.ByteBuffer.wrap(booleanBytes).put((byte) 1);\n BsonBinary bsonBoolean = new BsonBinary((byte) 8, booleanBytes);\n bsonDoc.append(\"bsonBoolean\", bsonBoolean);\n writer.reset();\n bsonReader.write(writer, new BsonDocumentReader(bsonDoc));\n SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();\n assertTrue(Arrays.equals(bytes, mapReader.reader(\"binaryKey\").readByteArray()));\n assertEquals(\"binaryStringValue\", mapReader.reader(\"binaryStringKey\").readText().toString());\n assertEquals(23.0123, mapReader.reader(\"binaryDouble\").readDouble().doubleValue(), 0);\n FieldReader reader = mapReader.reader(\"bsonBoolean\");\n assertEquals(true, reader.readBoolean().booleanValue());\n }",
"class_method_signature": "TestBsonRecordReader.testBinaryTypes()",
"constructor": false,
"full_signature": "@Test public void testBinaryTypes()",
"identifier": "testBinaryTypes",
"invocations": [
"getBytes",
"append",
"getBytes",
"append",
"putDouble",
"wrap",
"append",
"put",
"wrap",
"append",
"reset",
"write",
"getReader",
"getMapVector",
"assertTrue",
"equals",
"readByteArray",
"reader",
"assertEquals",
"toString",
"readText",
"reader",
"assertEquals",
"doubleValue",
"readDouble",
"reader",
"reader",
"assertEquals",
"booleanValue",
"readBoolean"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testBinaryTypes()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class)",
"modifier": "static final",
"original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "MAX_RECORD_SIZE = 128 * 1024",
"modifier": "public final static",
"original_string": "public final static int MAX_RECORD_SIZE = 128 * 1024;",
"type": "int",
"var_name": "MAX_RECORD_SIZE"
},
{
"declarator": "columns",
"modifier": "private final",
"original_string": "private final List<SchemaPath> columns;",
"type": "List<SchemaPath>",
"var_name": "columns"
},
{
"declarator": "atLeastOneWrite = false",
"modifier": "private",
"original_string": "private boolean atLeastOneWrite = false;",
"type": "boolean",
"var_name": "atLeastOneWrite"
},
{
"declarator": "readNumbersAsDouble",
"modifier": "private final",
"original_string": "private final boolean readNumbersAsDouble;",
"type": "boolean",
"var_name": "readNumbersAsDouble"
},
{
"declarator": "workBuf",
"modifier": "protected",
"original_string": "protected DrillBuf workBuf;",
"type": "DrillBuf",
"var_name": "workBuf"
},
{
"declarator": "currentFieldName",
"modifier": "private",
"original_string": "private String currentFieldName;",
"type": "String",
"var_name": "currentFieldName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java",
"identifier": "BsonRecordReader",
"interfaces": "",
"methods": [
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"constructor": false,
"full_signature": "private void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"identifier": "writeToListOrMap",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"return": "void",
"signature": "void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeTimeStamp",
"modifiers": "private",
"parameters": "(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeString",
"modifiers": "private",
"parameters": "(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeObjectId",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDouble",
"modifiers": "private",
"parameters": "(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDateTime",
"modifiers": "private",
"parameters": "(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBoolean",
"modifiers": "private",
"parameters": "(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"constructor": false,
"full_signature": "private void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"return": "void",
"signature": "void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt64",
"modifiers": "private",
"parameters": "(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt32",
"modifiers": "private",
"parameters": "(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensureAtLeastOneField(ComplexWriter writer)",
"constructor": false,
"full_signature": "public void ensureAtLeastOneField(ComplexWriter writer)",
"identifier": "ensureAtLeastOneField",
"modifiers": "public",
"parameters": "(ComplexWriter writer)",
"return": "void",
"signature": "void ensureAtLeastOneField(ComplexWriter writer)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(Throwable exception, String field, String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensure(final int length)",
"constructor": false,
"full_signature": "private void ensure(final int length)",
"identifier": "ensure",
"modifiers": "private",
"parameters": "(final int length)",
"return": "void",
"signature": "void ensure(final int length)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void write(ComplexWriter writer, BsonReader reader) throws IOException {\n reader.readStartDocument();\n BsonType readBsonType = reader.getCurrentBsonType();\n switch (readBsonType) {\n case DOCUMENT:\n writeToListOrMap(reader, new MapOrListWriterImpl(writer.rootAsMap()), false, null);\n break;\n default:\n throw new DrillRuntimeException(\"Root object must be DOCUMENT type. Found: \" + readBsonType);\n }\n }",
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"invocations": [
"readStartDocument",
"getCurrentBsonType",
"writeToListOrMap",
"rootAsMap"
],
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_93 | {
"fields": [
{
"declarator": "FULL_PERMISSION = FsPermission.getDirDefault()",
"modifier": "private static final",
"original_string": "private static final FsPermission FULL_PERMISSION = FsPermission.getDirDefault();",
"type": "FsPermission",
"var_name": "FULL_PERMISSION"
},
{
"declarator": "PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false)",
"modifier": "private static final",
"original_string": "private static final StorageStrategy PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false);",
"type": "StorageStrategy",
"var_name": "PERSISTENT_STRATEGY"
},
{
"declarator": "TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true)",
"modifier": "private static final",
"original_string": "private static final StorageStrategy TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true);",
"type": "StorageStrategy",
"var_name": "TEMPORARY_STRATEGY"
},
{
"declarator": "fs",
"modifier": "private static",
"original_string": "private static FileSystem fs;",
"type": "FileSystem",
"var_name": "fs"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/StorageStrategyTest.java",
"identifier": "StorageStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IOException.class)\n public void testFailureOnExistentFile() throws Exception {\n Path initialPath = prepareStorageDirectory();\n Path file = addNLevelsAndFile(initialPath, 0, true);\n fs.createNewFile(file);\n assertTrue(\"File should exist\", fs.exists(file));\n try {\n PERSISTENT_STRATEGY.createFileAndApply(fs, file);\n } catch (IOException e) {\n assertEquals(\"Error message should match\", String.format(\"File [%s] already exists on file system [%s].\",\n file.toUri().getPath(), fs.getUri()), e.getMessage());\n throw e;\n }\n }",
"class_method_signature": "StorageStrategyTest.testFailureOnExistentFile()",
"constructor": false,
"full_signature": "@Test(expected = IOException.class) public void testFailureOnExistentFile()",
"identifier": "testFailureOnExistentFile",
"invocations": [
"prepareStorageDirectory",
"addNLevelsAndFile",
"createNewFile",
"assertTrue",
"exists",
"createFileAndApply",
"assertEquals",
"format",
"getPath",
"toUri",
"getUri",
"getMessage"
],
"modifiers": "@Test(expected = IOException.class) public",
"parameters": "()",
"return": "void",
"signature": "void testFailureOnExistentFile()",
"testcase": true
} | {
"fields": [
{
"declarator": "DEFAULT = new StorageStrategy(\"002\", false)",
"modifier": "public static final",
"original_string": "public static final StorageStrategy DEFAULT = new StorageStrategy(\"002\", false);",
"type": "StorageStrategy",
"var_name": "DEFAULT"
},
{
"declarator": "TEMPORARY = new StorageStrategy(\"077\", true)",
"modifier": "public static final",
"original_string": "public static final StorageStrategy TEMPORARY = new StorageStrategy(\"077\", true);",
"type": "StorageStrategy",
"var_name": "TEMPORARY"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "umask",
"modifier": "private final",
"original_string": "private final String umask;",
"type": "String",
"var_name": "umask"
},
{
"declarator": "deleteOnExit",
"modifier": "private final",
"original_string": "private final boolean deleteOnExit;",
"type": "boolean",
"var_name": "deleteOnExit"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/StorageStrategy.java",
"identifier": "StorageStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "StorageStrategy.StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"constructor": true,
"full_signature": "@JsonCreator public StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"identifier": "StorageStrategy",
"modifiers": "@JsonCreator public",
"parameters": "(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"return": "",
"signature": " StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getUmask()",
"constructor": false,
"full_signature": "public String getUmask()",
"identifier": "getUmask",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getUmask()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.isDeleteOnExit()",
"constructor": false,
"full_signature": "public boolean isDeleteOnExit()",
"identifier": "isDeleteOnExit",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isDeleteOnExit()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getFolderPermission()",
"constructor": false,
"full_signature": "@JsonIgnore public FsPermission getFolderPermission()",
"identifier": "getFolderPermission",
"modifiers": "@JsonIgnore public",
"parameters": "()",
"return": "FsPermission",
"signature": "FsPermission getFolderPermission()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getFilePermission()",
"constructor": false,
"full_signature": "@JsonIgnore public FsPermission getFilePermission()",
"identifier": "getFilePermission",
"modifiers": "@JsonIgnore public",
"parameters": "()",
"return": "FsPermission",
"signature": "FsPermission getFilePermission()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.createPathAndApply(FileSystem fs, Path path)",
"constructor": false,
"full_signature": "public Path createPathAndApply(FileSystem fs, Path path)",
"identifier": "createPathAndApply",
"modifiers": "public",
"parameters": "(FileSystem fs, Path path)",
"return": "Path",
"signature": "Path createPathAndApply(FileSystem fs, Path path)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public Path createFileAndApply(FileSystem fs, Path file)",
"identifier": "createFileAndApply",
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "Path",
"signature": "Path createFileAndApply(FileSystem fs, Path file)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.applyToFile(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public void applyToFile(FileSystem fs, Path file)",
"identifier": "applyToFile",
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "void",
"signature": "void applyToFile(FileSystem fs, Path file)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.validateUmask(String umask)",
"constructor": false,
"full_signature": "private String validateUmask(String umask)",
"identifier": "validateUmask",
"modifiers": "private",
"parameters": "(String umask)",
"return": "String",
"signature": "String validateUmask(String umask)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getNonExistentLocations(FileSystem fs, Path path)",
"constructor": false,
"full_signature": "private List<Path> getNonExistentLocations(FileSystem fs, Path path)",
"identifier": "getNonExistentLocations",
"modifiers": "private",
"parameters": "(FileSystem fs, Path path)",
"return": "List<Path>",
"signature": "List<Path> getNonExistentLocations(FileSystem fs, Path path)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"constructor": false,
"full_signature": "private void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"identifier": "applyStrategy",
"modifiers": "private",
"parameters": "(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"return": "void",
"signature": "void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Path createFileAndApply(FileSystem fs, Path file) throws IOException {\n List<Path> locations = getNonExistentLocations(fs, file.getParent());\n if (!fs.createNewFile(file)) {\n throw new IOException(String.format(\"File [%s] already exists on file system [%s].\",\n file.toUri().getPath(), fs.getUri()));\n }\n applyToFile(fs, file);\n\n if (locations.isEmpty()) {\n return file;\n }\n\n for (Path location : locations) {\n applyStrategy(fs, location, getFolderPermission(), deleteOnExit);\n }\n return locations.get(locations.size() - 1);\n }",
"class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public Path createFileAndApply(FileSystem fs, Path file)",
"identifier": "createFileAndApply",
"invocations": [
"getNonExistentLocations",
"getParent",
"createNewFile",
"format",
"getPath",
"toUri",
"getUri",
"applyToFile",
"isEmpty",
"applyStrategy",
"getFolderPermission",
"get",
"size"
],
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "Path",
"signature": "Path createFileAndApply(FileSystem fs, Path file)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_45 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java",
"identifier": "DrillFileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListAllRecursiveWithFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listAll(fs, new Path(base, \"a\"), true, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().startsWith(\"a\") || path.getName().endsWith(\".txt\");\n }\n });\n assertEquals(\"Directory and file count should match\", 3, statuses.size());\n\n Collections.sort(statuses);\n assertEquals(\"Directory name should match\", \"aa\", statuses.get(0).getPath().getName());\n assertEquals(\"File name should match\", \"f.txt\", statuses.get(1).getPath().getName());\n assertEquals(\"File name should match\", \"f.txt\", statuses.get(2).getPath().getName());\n }",
"class_method_signature": "DrillFileSystemUtilTest.testListAllRecursiveWithFilter()",
"constructor": false,
"full_signature": "@Test public void testListAllRecursiveWithFilter()",
"identifier": "testListAllRecursiveWithFilter",
"invocations": [
"listAll",
"startsWith",
"getName",
"endsWith",
"getName",
"assertEquals",
"size",
"sort",
"assertEquals",
"getName",
"getPath",
"get",
"assertEquals",
"getName",
"getPath",
"get",
"assertEquals",
"getName",
"getPath",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListAllRecursiveWithFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };",
"type": "PathFilter",
"var_name": "DRILL_SYSTEM_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java",
"identifier": "DrillFileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listAll(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }",
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"invocations": [
"listAll",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_12 | {
"fields": [
{
"declarator": "N1_EP1 = newDrillbitEndpoint(\"node1\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP1 = newDrillbitEndpoint(\"node1\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP1"
},
{
"declarator": "N1_EP2 = newDrillbitEndpoint(\"node1\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP2 = newDrillbitEndpoint(\"node1\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP2"
},
{
"declarator": "N2_EP1 = newDrillbitEndpoint(\"node2\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP1 = newDrillbitEndpoint(\"node2\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP1"
},
{
"declarator": "N2_EP2 = newDrillbitEndpoint(\"node2\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP2 = newDrillbitEndpoint(\"node2\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP2"
},
{
"declarator": "N3_EP1 = newDrillbitEndpoint(\"node3\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP1 = newDrillbitEndpoint(\"node3\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP1"
},
{
"declarator": "N3_EP2 = newDrillbitEndpoint(\"node3\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP2 = newDrillbitEndpoint(\"node3\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP2"
},
{
"declarator": "N4_EP2 = newDrillbitEndpoint(\"node4\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N4_EP2 = newDrillbitEndpoint(\"node4\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N4_EP2"
},
{
"declarator": "fragment",
"modifier": "@Mocked private",
"original_string": "@Mocked private Fragment fragment;",
"type": "Fragment",
"var_name": "fragment"
},
{
"declarator": "root",
"modifier": "@Mocked private",
"original_string": "@Mocked private PhysicalOperator root;",
"type": "PhysicalOperator",
"var_name": "root"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/planner/fragment/TestHardAffinityFragmentParallelizer.java",
"identifier": "TestHardAffinityFragmentParallelizer",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void multiNodeCluster1() throws Exception {\n final Wrapper wrapper = newWrapper(200, 1, 20,\n ImmutableList.of(\n new EndpointAffinity(N1_EP1, 0.15, true, MAX_VALUE),\n new EndpointAffinity(N1_EP2, 0.15, true, MAX_VALUE),\n new EndpointAffinity(N2_EP1, 0.10, true, MAX_VALUE),\n new EndpointAffinity(N3_EP2, 0.20, true, MAX_VALUE),\n new EndpointAffinity(N4_EP2, 0.20, true, MAX_VALUE)\n ));\n INSTANCE.parallelizeFragment(wrapper, newParameters(SLICE_TARGET_DEFAULT, 5, 20), null);\n\n // Expect the fragment parallelization to be 5 because:\n // 1. The cost (200) is below the threshold (SLICE_TARGET_DEFAULT) (which gives width of 200/10000 = ~1) and\n // 2. Number of mandoatory node assignments are 5 which overrides the cost based width of 1.\n assertEquals(5, wrapper.getWidth());\n\n // As there are 5 required eps and the width is 5, everyone gets assigned 1.\n final List<DrillbitEndpoint> assignedEps = wrapper.getAssignedEndpoints();\n assertEquals(5, assignedEps.size());\n assertTrue(assignedEps.contains(N1_EP1));\n assertTrue(assignedEps.contains(N1_EP2));\n assertTrue(assignedEps.contains(N2_EP1));\n assertTrue(assignedEps.contains(N3_EP2));\n assertTrue(assignedEps.contains(N4_EP2));\n }",
"class_method_signature": "TestHardAffinityFragmentParallelizer.multiNodeCluster1()",
"constructor": false,
"full_signature": "@Test public void multiNodeCluster1()",
"identifier": "multiNodeCluster1",
"invocations": [
"newWrapper",
"of",
"parallelizeFragment",
"newParameters",
"assertEquals",
"getWidth",
"getAssignedEndpoints",
"assertEquals",
"size",
"assertTrue",
"contains",
"assertTrue",
"contains",
"assertTrue",
"contains",
"assertTrue",
"contains",
"assertTrue",
"contains"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void multiNodeCluster1()",
"testcase": true
} | {
"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);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "INSTANCE = new HardAffinityFragmentParallelizer()",
"modifier": "public static final",
"original_string": "public static final HardAffinityFragmentParallelizer INSTANCE = new HardAffinityFragmentParallelizer();",
"type": "HardAffinityFragmentParallelizer",
"var_name": "INSTANCE"
},
{
"declarator": "EOL = System.getProperty(\"line.separator\")",
"modifier": "private static",
"original_string": "private static String EOL = System.getProperty(\"line.separator\");",
"type": "String",
"var_name": "EOL"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/HardAffinityFragmentParallelizer.java",
"identifier": "HardAffinityFragmentParallelizer",
"interfaces": "implements FragmentParallelizer",
"methods": [
{
"class_method_signature": "HardAffinityFragmentParallelizer.HardAffinityFragmentParallelizer()",
"constructor": true,
"full_signature": "private HardAffinityFragmentParallelizer()",
"identifier": "HardAffinityFragmentParallelizer",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HardAffinityFragmentParallelizer()",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"constructor": false,
"full_signature": "private static void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"identifier": "checkOrThrow",
"modifiers": "private static",
"parameters": "(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"return": "void",
"signature": "void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints) throws PhysicalOperatorSetupException {\n\n final Stats stats = fragmentWrapper.getStats();\n final ParallelizationInfo pInfo = stats.getParallelizationInfo();\n\n int totalMaxWidth = 0;\n\n // Go through the affinity map and extract the endpoints that have mandatory assignment requirement\n final Map<DrillbitEndpoint, EndpointAffinity> endpointPool = Maps.newHashMap();\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : pInfo.getEndpointAffinityMap().entrySet()) {\n if (entry.getValue().isAssignmentRequired()) {\n endpointPool.put(entry.getKey(), entry.getValue());\n\n // Limit the max width of the endpoint to allowed max width.\n totalMaxWidth += Math.min(parameters.getMaxWidthPerNode(), entry.getValue().getMaxWidth());\n if (totalMaxWidth < 0) {\n // If the totalWidth overflows, just keep it at the max value.\n totalMaxWidth = Integer.MAX_VALUE;\n }\n }\n }\n\n // Step 1: Find the width taking into various parameters\n // 1.1. Find the parallelization based on cost. Use max cost of all operators in this fragment; this is consistent\n // with the calculation that ExcessiveExchangeRemover uses.\n int width = (int) Math.ceil(stats.getMaxCost() / parameters.getSliceTarget());\n\n // 1.2. Make sure the width is at least the number of endpoints that require an assignment\n width = Math.max(endpointPool.size(), width);\n\n // 1.3. Cap the parallelization width by fragment level width limit and system level per query width limit\n width = Math.max(1, Math.min(width, pInfo.getMaxWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed fragment max \" +\n \"width ({}).\", endpointPool.size(), pInfo.getMaxWidth());\n\n // 1.4 Cap the parallelization width by global max query width\n width = Math.max(1, Math.min(width, parameters.getMaxGlobalWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed global query \" +\n \"width ({}).\", endpointPool.size(), parameters.getMaxGlobalWidth());\n\n // 1.5 Cap the parallelization width by max allowed parallelization per node\n width = Math.max(1, Math.min(width, endpointPool.size()*parameters.getMaxWidthPerNode()));\n\n // 1.6 Cap the parallelization width by total of max allowed width per node. The reason is if we the width is more,\n // we end up allocating more work units to one or more endpoints that don't have those many work units.\n width = Math.min(totalMaxWidth, width);\n\n // Step 2: Select the endpoints\n final Map<DrillbitEndpoint, Integer> endpoints = Maps.newHashMap();\n\n // 2.1 First add each endpoint from the pool once so that the mandatory assignment requirement is fulfilled.\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : endpointPool.entrySet()) {\n endpoints.put(entry.getKey(), 1);\n }\n int totalAssigned = endpoints.size();\n\n // 2.2 Assign the remaining slots to endpoints proportional to the affinity of each endpoint\n int remainingSlots = width - endpoints.size();\n while (remainingSlots > 0) {\n for(EndpointAffinity epAf : endpointPool.values()) {\n final int moreAllocation = (int) Math.ceil(epAf.getAffinity() * remainingSlots);\n int currentAssignments = endpoints.get(epAf.getEndpoint());\n for(int i=0;\n i < moreAllocation &&\n totalAssigned < width &&\n currentAssignments < parameters.getMaxWidthPerNode() &&\n currentAssignments < epAf.getMaxWidth();\n i++) {\n totalAssigned++;\n currentAssignments++;\n }\n endpoints.put(epAf.getEndpoint(), currentAssignments);\n }\n final int previousRemainingSlots = remainingSlots;\n remainingSlots = width - totalAssigned;\n if (previousRemainingSlots == remainingSlots) {\n logger.error(\"Can't parallelize fragment: \" +\n \"Every mandatory node has exhausted the maximum width per node limit.\" + EOL +\n \"Endpoint pool: {}\" + EOL + \"Assignment so far: {}\" + EOL + \"Width: {}\", endpointPool, endpoints, width);\n throw new PhysicalOperatorSetupException(\"Can not parallelize fragment.\");\n }\n }\n\n final List<DrillbitEndpoint> assignedEndpoints = Lists.newArrayList();\n for(Entry<DrillbitEndpoint, Integer> entry : endpoints.entrySet()) {\n for(int i=0; i < entry.getValue(); i++) {\n assignedEndpoints.add(entry.getKey());\n }\n }\n\n fragmentWrapper.setWidth(width);\n fragmentWrapper.assignEndpoints(assignedEndpoints);\n }",
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"invocations": [
"getStats",
"getParallelizationInfo",
"newHashMap",
"entrySet",
"getEndpointAffinityMap",
"isAssignmentRequired",
"getValue",
"put",
"getKey",
"getValue",
"min",
"getMaxWidthPerNode",
"getMaxWidth",
"getValue",
"ceil",
"getMaxCost",
"getSliceTarget",
"max",
"size",
"max",
"min",
"getMaxWidth",
"checkOrThrow",
"size",
"size",
"getMaxWidth",
"max",
"min",
"getMaxGlobalWidth",
"checkOrThrow",
"size",
"size",
"getMaxGlobalWidth",
"max",
"min",
"size",
"getMaxWidthPerNode",
"min",
"newHashMap",
"entrySet",
"put",
"getKey",
"size",
"size",
"values",
"ceil",
"getAffinity",
"get",
"getEndpoint",
"getMaxWidthPerNode",
"getMaxWidth",
"put",
"getEndpoint",
"error",
"newArrayList",
"entrySet",
"getValue",
"add",
"getKey",
"setWidth",
"assignEndpoints"
],
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_69 | {
"fields": [
{
"declarator": "CLASS_NAME = \"com.drill.udf.CustomLowerFunction\"",
"modifier": "private static final",
"original_string": "private static final String CLASS_NAME = \"com.drill.udf.CustomLowerFunction\";",
"type": "String",
"var_name": "CLASS_NAME"
},
{
"declarator": "classLoader",
"modifier": "private static",
"original_string": "private static URLClassLoader classLoader;",
"type": "URLClassLoader",
"var_name": "classLoader"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/FunctionInitializerTest.java",
"identifier": "FunctionInitializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConcurrentFunctionBodyLoad() throws Exception {\n final FunctionInitializer functionInitializer = new FunctionInitializer(CLASS_NAME, classLoader);\n\n final AtomicInteger counter = new AtomicInteger();\n new MockUp<FunctionInitializer>() {\n @Mock\n Java.CompilationUnit convertToCompilationUnit(Invocation inv, Class<?> clazz) {\n counter.incrementAndGet();\n return inv.proceed();\n }\n };\n\n int threadsNumber = 5;\n ExecutorService executor = Executors.newFixedThreadPool(threadsNumber);\n\n try {\n List<Future<String>> results = executor.invokeAll(Collections.nCopies(threadsNumber, new Callable<String>() {\n @Override\n public String call() throws Exception {\n return functionInitializer.getMethod(\"eval\");\n }\n }));\n\n final Set<String> uniqueResults = new HashSet<>();\n for (Future<String> result : results) {\n uniqueResults.add(result.get());\n }\n\n assertEquals(\"All threads should have received the same result\", 1, uniqueResults.size());\n assertEquals(\"Number of function body loads should match\", 1, counter.intValue());\n\n } finally {\n executor.shutdownNow();\n }\n }",
"class_method_signature": "FunctionInitializerTest.testConcurrentFunctionBodyLoad()",
"constructor": false,
"full_signature": "@Test public void testConcurrentFunctionBodyLoad()",
"identifier": "testConcurrentFunctionBodyLoad",
"invocations": [
"incrementAndGet",
"proceed",
"newFixedThreadPool",
"invokeAll",
"nCopies",
"getMethod",
"add",
"get",
"assertEquals",
"size",
"assertEquals",
"intValue",
"shutdownNow"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testConcurrentFunctionBodyLoad()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(FunctionInitializer.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionInitializer.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "className",
"modifier": "private final",
"original_string": "private final String className;",
"type": "String",
"var_name": "className"
},
{
"declarator": "classLoader",
"modifier": "private final",
"original_string": "private final ClassLoader classLoader;",
"type": "ClassLoader",
"var_name": "classLoader"
},
{
"declarator": "methods",
"modifier": "private",
"original_string": "private Map<String, String> methods;",
"type": "Map<String, String>",
"var_name": "methods"
},
{
"declarator": "imports",
"modifier": "private",
"original_string": "private List<String> imports;",
"type": "List<String>",
"var_name": "imports"
},
{
"declarator": "isLoaded",
"modifier": "private volatile",
"original_string": "private volatile boolean isLoaded;",
"type": "boolean",
"var_name": "isLoaded"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionInitializer.java",
"identifier": "FunctionInitializer",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionInitializer.FunctionInitializer(String className, ClassLoader classLoader)",
"constructor": true,
"full_signature": "public FunctionInitializer(String className, ClassLoader classLoader)",
"identifier": "FunctionInitializer",
"modifiers": "public",
"parameters": "(String className, ClassLoader classLoader)",
"return": "",
"signature": " FunctionInitializer(String className, ClassLoader classLoader)",
"testcase": false
},
{
"class_method_signature": "FunctionInitializer.getClassLoader()",
"constructor": false,
"full_signature": "public ClassLoader getClassLoader()",
"identifier": "getClassLoader",
"modifiers": "public",
"parameters": "()",
"return": "ClassLoader",
"signature": "ClassLoader getClassLoader()",
"testcase": false
},
{
"class_method_signature": "FunctionInitializer.getClassName()",
"constructor": false,
"full_signature": "public String getClassName()",
"identifier": "getClassName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getClassName()",
"testcase": false
},
{
"class_method_signature": "FunctionInitializer.getImports()",
"constructor": false,
"full_signature": "public List<String> getImports()",
"identifier": "getImports",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getImports()",
"testcase": false
},
{
"class_method_signature": "FunctionInitializer.getMethod(String methodName)",
"constructor": false,
"full_signature": "public String getMethod(String methodName)",
"identifier": "getMethod",
"modifiers": "public",
"parameters": "(String methodName)",
"return": "String",
"signature": "String getMethod(String methodName)",
"testcase": false
},
{
"class_method_signature": "FunctionInitializer.loadFunctionBody()",
"constructor": false,
"full_signature": "private void loadFunctionBody()",
"identifier": "loadFunctionBody",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void loadFunctionBody()",
"testcase": false
},
{
"class_method_signature": "FunctionInitializer.convertToCompilationUnit(Class<?> clazz)",
"constructor": false,
"full_signature": "private CompilationUnit convertToCompilationUnit(Class<?> clazz)",
"identifier": "convertToCompilationUnit",
"modifiers": "private",
"parameters": "(Class<?> clazz)",
"return": "CompilationUnit",
"signature": "CompilationUnit convertToCompilationUnit(Class<?> clazz)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public String getMethod(String methodName) {\n loadFunctionBody();\n return methods.get(methodName);\n }",
"class_method_signature": "FunctionInitializer.getMethod(String methodName)",
"constructor": false,
"full_signature": "public String getMethod(String methodName)",
"identifier": "getMethod",
"invocations": [
"loadFunctionBody",
"get"
],
"modifiers": "public",
"parameters": "(String methodName)",
"return": "String",
"signature": "String getMethod(String methodName)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_86 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/easy/text/compliant/TestHeaderBuilder.java",
"identifier": "TestHeaderBuilder",
"interfaces": "",
"superclass": "extends DrillTest"
} | {
"body": "@Test\n public void testWhiteSpace() {\n HeaderBuilder hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"a\");\n validateHeader(hb, new String[] {\"a\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\" a \");\n validateHeader(hb, new String[] {\"a\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\" a \");\n validateHeader(hb, new String[] {\"a\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"a,b,c\");\n validateHeader(hb, new String[] {\"a\",\"b\",\"c\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\" a , b , c \");\n validateHeader(hb, new String[] {\"a\",\"b\",\"c\"});\n }",
"class_method_signature": "TestHeaderBuilder.testWhiteSpace()",
"constructor": false,
"full_signature": "@Test public void testWhiteSpace()",
"identifier": "testWhiteSpace",
"invocations": [
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testWhiteSpace()",
"testcase": true
} | {
"fields": [
{
"declarator": "MAX_HEADER_LEN = 1024",
"modifier": "public static final",
"original_string": "public static final int MAX_HEADER_LEN = 1024;",
"type": "int",
"var_name": "MAX_HEADER_LEN"
},
{
"declarator": "COLUMN_PREFIX = \"col_\"",
"modifier": "public static final",
"original_string": "public static final String COLUMN_PREFIX = \"col_\";",
"type": "String",
"var_name": "COLUMN_PREFIX"
},
{
"declarator": "ANONYMOUS_COLUMN_PREFIX = \"column_\"",
"modifier": "public static final",
"original_string": "public static final String ANONYMOUS_COLUMN_PREFIX = \"column_\";",
"type": "String",
"var_name": "ANONYMOUS_COLUMN_PREFIX"
},
{
"declarator": "headers = new ArrayList<>()",
"modifier": "public final",
"original_string": "public final List<String> headers = new ArrayList<>();",
"type": "List<String>",
"var_name": "headers"
},
{
"declarator": "currentField = ByteBuffer.allocate(MAX_HEADER_LEN)",
"modifier": "public final",
"original_string": "public final ByteBuffer currentField = ByteBuffer.allocate(MAX_HEADER_LEN);",
"type": "ByteBuffer",
"var_name": "currentField"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/text/compliant/HeaderBuilder.java",
"identifier": "HeaderBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "HeaderBuilder.startField(int index)",
"constructor": false,
"full_signature": "@Override public void startField(int index)",
"identifier": "startField",
"modifiers": "@Override public",
"parameters": "(int index)",
"return": "void",
"signature": "void startField(int index)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.endField()",
"constructor": false,
"full_signature": "@Override public boolean endField()",
"identifier": "endField",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean endField()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.endEmptyField()",
"constructor": false,
"full_signature": "@Override public boolean endEmptyField()",
"identifier": "endEmptyField",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean endEmptyField()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.validateSymbol(String header)",
"constructor": false,
"full_signature": "private String validateSymbol(String header)",
"identifier": "validateSymbol",
"modifiers": "private",
"parameters": "(String header)",
"return": "String",
"signature": "String validateSymbol(String header)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.rewriteHeader(String header)",
"constructor": false,
"full_signature": "private String rewriteHeader(String header)",
"identifier": "rewriteHeader",
"modifiers": "private",
"parameters": "(String header)",
"return": "String",
"signature": "String rewriteHeader(String header)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.append(byte data)",
"constructor": false,
"full_signature": "@Override public void append(byte data)",
"identifier": "append",
"modifiers": "@Override public",
"parameters": "(byte data)",
"return": "void",
"signature": "void append(byte data)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.finishRecord()",
"constructor": false,
"full_signature": "@Override public void finishRecord()",
"identifier": "finishRecord",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void finishRecord()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.getRecordCount()",
"constructor": false,
"full_signature": "@Override public long getRecordCount()",
"identifier": "getRecordCount",
"modifiers": "@Override public",
"parameters": "()",
"return": "long",
"signature": "long getRecordCount()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.startBatch()",
"constructor": false,
"full_signature": "@Override public void startBatch()",
"identifier": "startBatch",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void startBatch()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.finishBatch()",
"constructor": false,
"full_signature": "@Override public void finishBatch()",
"identifier": "finishBatch",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void finishBatch()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.rowHasData()",
"constructor": false,
"full_signature": "@Override public boolean rowHasData()",
"identifier": "rowHasData",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean rowHasData()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.getHeaders()",
"constructor": false,
"full_signature": "public String[] getHeaders()",
"identifier": "getHeaders",
"modifiers": "public",
"parameters": "()",
"return": "String[]",
"signature": "String[] getHeaders()",
"testcase": false
}
],
"superclass": "extends TextOutput"
} | {
"body": "@Override\n public void startBatch() { }",
"class_method_signature": "HeaderBuilder.startBatch()",
"constructor": false,
"full_signature": "@Override public void startBatch()",
"identifier": "startBatch",
"invocations": [],
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void startBatch()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_28 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListAllRecursiveWithoutFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listAll(fs, new Path(base, \"a\"), true);\n assertEquals(\"Directory and file count should match\", 7, statuses.size());\n }",
"class_method_signature": "FileSystemUtilTest.testListAllRecursiveWithoutFilter()",
"constructor": false,
"full_signature": "@Test public void testListAllRecursiveWithoutFilter()",
"identifier": "testListAllRecursiveWithoutFilter",
"invocations": [
"listAll",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListAllRecursiveWithoutFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listAll(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }",
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"invocations": [
"listAll",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_90 | {
"fields": [
{
"declarator": "FULL_PERMISSION = FsPermission.getDirDefault()",
"modifier": "private static final",
"original_string": "private static final FsPermission FULL_PERMISSION = FsPermission.getDirDefault();",
"type": "FsPermission",
"var_name": "FULL_PERMISSION"
},
{
"declarator": "PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false)",
"modifier": "private static final",
"original_string": "private static final StorageStrategy PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false);",
"type": "StorageStrategy",
"var_name": "PERSISTENT_STRATEGY"
},
{
"declarator": "TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true)",
"modifier": "private static final",
"original_string": "private static final StorageStrategy TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true);",
"type": "StorageStrategy",
"var_name": "TEMPORARY_STRATEGY"
},
{
"declarator": "fs",
"modifier": "private static",
"original_string": "private static FileSystem fs;",
"type": "FileSystem",
"var_name": "fs"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/StorageStrategyTest.java",
"identifier": "StorageStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPermissionAndDeleteOnExitTrueForFileWithParent() throws Exception {\n Path initialPath = prepareStorageDirectory();\n Path file = addNLevelsAndFile(initialPath, 2, true);\n Path firstCreatedParentPath = addNLevelsAndFile(initialPath, 1, false);\n\n Path createdParentPath = TEMPORARY_STRATEGY.createFileAndApply(fs, file);\n\n assertEquals(\"Path should match\", firstCreatedParentPath, createdParentPath);\n checkPathAndPermission(initialPath, file, true, 2, TEMPORARY_STRATEGY);\n checkDeleteOnExit(firstCreatedParentPath, true);\n }",
"class_method_signature": "StorageStrategyTest.testPermissionAndDeleteOnExitTrueForFileWithParent()",
"constructor": false,
"full_signature": "@Test public void testPermissionAndDeleteOnExitTrueForFileWithParent()",
"identifier": "testPermissionAndDeleteOnExitTrueForFileWithParent",
"invocations": [
"prepareStorageDirectory",
"addNLevelsAndFile",
"addNLevelsAndFile",
"createFileAndApply",
"assertEquals",
"checkPathAndPermission",
"checkDeleteOnExit"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testPermissionAndDeleteOnExitTrueForFileWithParent()",
"testcase": true
} | {
"fields": [
{
"declarator": "DEFAULT = new StorageStrategy(\"002\", false)",
"modifier": "public static final",
"original_string": "public static final StorageStrategy DEFAULT = new StorageStrategy(\"002\", false);",
"type": "StorageStrategy",
"var_name": "DEFAULT"
},
{
"declarator": "TEMPORARY = new StorageStrategy(\"077\", true)",
"modifier": "public static final",
"original_string": "public static final StorageStrategy TEMPORARY = new StorageStrategy(\"077\", true);",
"type": "StorageStrategy",
"var_name": "TEMPORARY"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "umask",
"modifier": "private final",
"original_string": "private final String umask;",
"type": "String",
"var_name": "umask"
},
{
"declarator": "deleteOnExit",
"modifier": "private final",
"original_string": "private final boolean deleteOnExit;",
"type": "boolean",
"var_name": "deleteOnExit"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/StorageStrategy.java",
"identifier": "StorageStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "StorageStrategy.StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"constructor": true,
"full_signature": "@JsonCreator public StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"identifier": "StorageStrategy",
"modifiers": "@JsonCreator public",
"parameters": "(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"return": "",
"signature": " StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getUmask()",
"constructor": false,
"full_signature": "public String getUmask()",
"identifier": "getUmask",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getUmask()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.isDeleteOnExit()",
"constructor": false,
"full_signature": "public boolean isDeleteOnExit()",
"identifier": "isDeleteOnExit",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isDeleteOnExit()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getFolderPermission()",
"constructor": false,
"full_signature": "@JsonIgnore public FsPermission getFolderPermission()",
"identifier": "getFolderPermission",
"modifiers": "@JsonIgnore public",
"parameters": "()",
"return": "FsPermission",
"signature": "FsPermission getFolderPermission()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getFilePermission()",
"constructor": false,
"full_signature": "@JsonIgnore public FsPermission getFilePermission()",
"identifier": "getFilePermission",
"modifiers": "@JsonIgnore public",
"parameters": "()",
"return": "FsPermission",
"signature": "FsPermission getFilePermission()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.createPathAndApply(FileSystem fs, Path path)",
"constructor": false,
"full_signature": "public Path createPathAndApply(FileSystem fs, Path path)",
"identifier": "createPathAndApply",
"modifiers": "public",
"parameters": "(FileSystem fs, Path path)",
"return": "Path",
"signature": "Path createPathAndApply(FileSystem fs, Path path)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public Path createFileAndApply(FileSystem fs, Path file)",
"identifier": "createFileAndApply",
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "Path",
"signature": "Path createFileAndApply(FileSystem fs, Path file)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.applyToFile(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public void applyToFile(FileSystem fs, Path file)",
"identifier": "applyToFile",
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "void",
"signature": "void applyToFile(FileSystem fs, Path file)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.validateUmask(String umask)",
"constructor": false,
"full_signature": "private String validateUmask(String umask)",
"identifier": "validateUmask",
"modifiers": "private",
"parameters": "(String umask)",
"return": "String",
"signature": "String validateUmask(String umask)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getNonExistentLocations(FileSystem fs, Path path)",
"constructor": false,
"full_signature": "private List<Path> getNonExistentLocations(FileSystem fs, Path path)",
"identifier": "getNonExistentLocations",
"modifiers": "private",
"parameters": "(FileSystem fs, Path path)",
"return": "List<Path>",
"signature": "List<Path> getNonExistentLocations(FileSystem fs, Path path)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"constructor": false,
"full_signature": "private void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"identifier": "applyStrategy",
"modifiers": "private",
"parameters": "(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"return": "void",
"signature": "void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Path createFileAndApply(FileSystem fs, Path file) throws IOException {\n List<Path> locations = getNonExistentLocations(fs, file.getParent());\n if (!fs.createNewFile(file)) {\n throw new IOException(String.format(\"File [%s] already exists on file system [%s].\",\n file.toUri().getPath(), fs.getUri()));\n }\n applyToFile(fs, file);\n\n if (locations.isEmpty()) {\n return file;\n }\n\n for (Path location : locations) {\n applyStrategy(fs, location, getFolderPermission(), deleteOnExit);\n }\n return locations.get(locations.size() - 1);\n }",
"class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public Path createFileAndApply(FileSystem fs, Path file)",
"identifier": "createFileAndApply",
"invocations": [
"getNonExistentLocations",
"getParent",
"createNewFile",
"format",
"getPath",
"toUri",
"getUri",
"applyToFile",
"isEmpty",
"applyStrategy",
"getFolderPermission",
"get",
"size"
],
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "Path",
"signature": "Path createFileAndApply(FileSystem fs, Path file)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_7 | {
"fields": [
{
"declarator": "MAX_ALLOCATION = 8 * 1024",
"modifier": "private final static",
"original_string": "private final static int MAX_ALLOCATION = 8 * 1024;",
"type": "int",
"var_name": "MAX_ALLOCATION"
}
],
"file": "exec/memory/base/src/test/java/org/apache/drill/exec/memory/TestBaseAllocator.java",
"identifier": "TestBaseAllocator",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAllocator_sliceRanges() throws Exception {\n// final AllocatorOwner allocatorOwner = new NamedOwner(\"sliceRanges\");\n try(final RootAllocator rootAllocator =\n new RootAllocator(MAX_ALLOCATION)) {\n // Populate a buffer with byte values corresponding to their indices.\n final DrillBuf drillBuf = rootAllocator.buffer(256);\n assertEquals(256, drillBuf.capacity());\n assertEquals(0, drillBuf.readerIndex());\n assertEquals(0, drillBuf.readableBytes());\n assertEquals(0, drillBuf.writerIndex());\n assertEquals(256, drillBuf.writableBytes());\n\n final DrillBuf slice3 = (DrillBuf) drillBuf.slice();\n assertEquals(0, slice3.readerIndex());\n assertEquals(0, slice3.readableBytes());\n assertEquals(0, slice3.writerIndex());\n// assertEquals(256, slice3.capacity());\n// assertEquals(256, slice3.writableBytes());\n\n for(int i = 0; i < 256; ++i) {\n drillBuf.writeByte(i);\n }\n assertEquals(0, drillBuf.readerIndex());\n assertEquals(256, drillBuf.readableBytes());\n assertEquals(256, drillBuf.writerIndex());\n assertEquals(0, drillBuf.writableBytes());\n\n final DrillBuf slice1 = (DrillBuf) drillBuf.slice();\n assertEquals(0, slice1.readerIndex());\n assertEquals(256, slice1.readableBytes());\n for(int i = 0; i < 10; ++i) {\n assertEquals(i, slice1.readByte());\n }\n assertEquals(256 - 10, slice1.readableBytes());\n for(int i = 0; i < 256; ++i) {\n assertEquals((byte) i, slice1.getByte(i));\n }\n\n final DrillBuf slice2 = (DrillBuf) drillBuf.slice(25, 25);\n assertEquals(0, slice2.readerIndex());\n assertEquals(25, slice2.readableBytes());\n for(int i = 25; i < 50; ++i) {\n assertEquals(i, slice2.readByte());\n }\n\n/*\n for(int i = 256; i > 0; --i) {\n slice3.writeByte(i - 1);\n }\n for(int i = 0; i < 256; ++i) {\n assertEquals(255 - i, slice1.getByte(i));\n }\n*/\n\n drillBuf.release(); // all the derived buffers share this fate\n }\n }",
"class_method_signature": "TestBaseAllocator.testAllocator_sliceRanges()",
"constructor": false,
"full_signature": "@Test public void testAllocator_sliceRanges()",
"identifier": "testAllocator_sliceRanges",
"invocations": [
"buffer",
"assertEquals",
"capacity",
"assertEquals",
"readerIndex",
"assertEquals",
"readableBytes",
"assertEquals",
"writerIndex",
"assertEquals",
"writableBytes",
"slice",
"assertEquals",
"readerIndex",
"assertEquals",
"readableBytes",
"assertEquals",
"writerIndex",
"writeByte",
"assertEquals",
"readerIndex",
"assertEquals",
"readableBytes",
"assertEquals",
"writerIndex",
"assertEquals",
"writableBytes",
"slice",
"assertEquals",
"readerIndex",
"assertEquals",
"readableBytes",
"assertEquals",
"readByte",
"assertEquals",
"readableBytes",
"assertEquals",
"getByte",
"slice",
"assertEquals",
"readerIndex",
"assertEquals",
"readableBytes",
"assertEquals",
"readByte",
"release"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testAllocator_sliceRanges()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\"",
"modifier": "public static final",
"original_string": "public static final String DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\";",
"type": "String",
"var_name": "DEBUG_ALLOCATOR"
},
{
"declarator": "ID_GENERATOR = new AtomicLong(0)",
"modifier": "@SuppressWarnings(\"unused\")\n private static final",
"original_string": "@SuppressWarnings(\"unused\")\n private static final AtomicLong ID_GENERATOR = new AtomicLong(0);",
"type": "AtomicLong",
"var_name": "ID_GENERATOR"
},
{
"declarator": "CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize()",
"modifier": "private static final",
"original_string": "private static final int CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize();",
"type": "int",
"var_name": "CHUNK_SIZE"
},
{
"declarator": "DEBUG_LOG_LENGTH = 6",
"modifier": "public static final",
"original_string": "public static final int DEBUG_LOG_LENGTH = 6;",
"type": "int",
"var_name": "DEBUG_LOG_LENGTH"
},
{
"declarator": "DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"))",
"modifier": "public static final",
"original_string": "public static final boolean DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"));",
"type": "boolean",
"var_name": "DEBUG"
},
{
"declarator": "IO_BUFFER_SIZE = 32*1024",
"modifier": "private static final",
"original_string": "private static final int IO_BUFFER_SIZE = 32*1024;",
"type": "int",
"var_name": "IO_BUFFER_SIZE"
},
{
"declarator": "DEBUG_LOCK = DEBUG ? new Object() : null",
"modifier": "private final",
"original_string": "private final Object DEBUG_LOCK = DEBUG ? new Object() : null;",
"type": "Object",
"var_name": "DEBUG_LOCK"
},
{
"declarator": "parentAllocator",
"modifier": "private final",
"original_string": "private final BaseAllocator parentAllocator;",
"type": "BaseAllocator",
"var_name": "parentAllocator"
},
{
"declarator": "thisAsByteBufAllocator",
"modifier": "private final",
"original_string": "private final ByteBufAllocator thisAsByteBufAllocator;",
"type": "ByteBufAllocator",
"var_name": "thisAsByteBufAllocator"
},
{
"declarator": "childAllocators",
"modifier": "private final",
"original_string": "private final IdentityHashMap<BaseAllocator, Object> childAllocators;",
"type": "IdentityHashMap<BaseAllocator, Object>",
"var_name": "childAllocators"
},
{
"declarator": "empty",
"modifier": "private final",
"original_string": "private final DrillBuf empty;",
"type": "DrillBuf",
"var_name": "empty"
},
{
"declarator": "isClosed = false",
"modifier": "private volatile",
"original_string": "private volatile boolean isClosed = false;",
"type": "boolean",
"var_name": "isClosed"
},
{
"declarator": "name",
"modifier": "final",
"original_string": "final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "root",
"modifier": "final",
"original_string": "final RootAllocator root;",
"type": "RootAllocator",
"var_name": "root"
},
{
"declarator": "childLedgers",
"modifier": "private final",
"original_string": "private final IdentityHashMap<BufferLedger, Object> childLedgers;",
"type": "IdentityHashMap<BufferLedger, Object>",
"var_name": "childLedgers"
},
{
"declarator": "reservations",
"modifier": "private final",
"original_string": "private final IdentityHashMap<Reservation, Object> reservations;",
"type": "IdentityHashMap<Reservation, Object>",
"var_name": "reservations"
},
{
"declarator": "historicalLog",
"modifier": "private final",
"original_string": "private final HistoricalLog historicalLog;",
"type": "HistoricalLog",
"var_name": "historicalLog"
},
{
"declarator": "ioBuffer[]",
"modifier": "private",
"original_string": "private byte ioBuffer[];",
"type": "byte",
"var_name": "ioBuffer"
}
],
"file": "exec/memory/base/src/main/java/org/apache/drill/exec/memory/BaseAllocator.java",
"identifier": "BaseAllocator",
"interfaces": "implements BufferAllocator",
"methods": [
{
"class_method_signature": "BaseAllocator.BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"constructor": true,
"full_signature": "protected BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"identifier": "BaseAllocator",
"modifiers": "protected",
"parameters": "(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"return": "",
"signature": " BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.assertOpen()",
"constructor": false,
"full_signature": "@Override public void assertOpen()",
"identifier": "assertOpen",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void assertOpen()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getName()",
"constructor": false,
"full_signature": "@Override public String getName()",
"identifier": "getName",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String getName()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getEmpty()",
"constructor": false,
"full_signature": "@Override public DrillBuf getEmpty()",
"identifier": "getEmpty",
"modifiers": "@Override public",
"parameters": "()",
"return": "DrillBuf",
"signature": "DrillBuf getEmpty()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.associateLedger(BufferLedger ledger)",
"constructor": false,
"full_signature": " void associateLedger(BufferLedger ledger)",
"identifier": "associateLedger",
"modifiers": "",
"parameters": "(BufferLedger ledger)",
"return": "void",
"signature": "void associateLedger(BufferLedger ledger)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.dissociateLedger(BufferLedger ledger)",
"constructor": false,
"full_signature": " void dissociateLedger(BufferLedger ledger)",
"identifier": "dissociateLedger",
"modifiers": "",
"parameters": "(BufferLedger ledger)",
"return": "void",
"signature": "void dissociateLedger(BufferLedger ledger)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.childClosed(final BaseAllocator childAllocator)",
"constructor": false,
"full_signature": "private void childClosed(final BaseAllocator childAllocator)",
"identifier": "childClosed",
"modifiers": "private",
"parameters": "(final BaseAllocator childAllocator)",
"return": "void",
"signature": "void childClosed(final BaseAllocator childAllocator)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"constructor": false,
"full_signature": "private static String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"identifier": "createErrorMsg",
"modifiers": "private static",
"parameters": "(final BufferAllocator allocator, final int rounded, final int requested)",
"return": "String",
"signature": "String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize)",
"identifier": "buffer",
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.createEmpty()",
"constructor": false,
"full_signature": "private DrillBuf createEmpty()",
"identifier": "createEmpty",
"modifiers": "private",
"parameters": "()",
"return": "DrillBuf",
"signature": "DrillBuf createEmpty()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize, BufferManager manager)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize, BufferManager manager)",
"identifier": "buffer",
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize, BufferManager manager)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize, BufferManager manager)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.bufferWithoutReservation(final int size, BufferManager bufferManager)",
"constructor": false,
"full_signature": "private DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)",
"identifier": "bufferWithoutReservation",
"modifiers": "private",
"parameters": "(final int size, BufferManager bufferManager)",
"return": "DrillBuf",
"signature": "DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getAsByteBufAllocator()",
"constructor": false,
"full_signature": "@Override public ByteBufAllocator getAsByteBufAllocator()",
"identifier": "getAsByteBufAllocator",
"modifiers": "@Override public",
"parameters": "()",
"return": "ByteBufAllocator",
"signature": "ByteBufAllocator getAsByteBufAllocator()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"constructor": false,
"full_signature": "@Override public BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"identifier": "newChildAllocator",
"modifiers": "@Override public",
"parameters": "(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"return": "BufferAllocator",
"signature": "BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.newReservation()",
"constructor": false,
"full_signature": "@Override public AllocationReservation newReservation()",
"identifier": "newReservation",
"modifiers": "@Override public",
"parameters": "()",
"return": "AllocationReservation",
"signature": "AllocationReservation newReservation()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.close()",
"constructor": false,
"full_signature": "@Override public synchronized void close()",
"identifier": "close",
"modifiers": "@Override public synchronized",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.toVerboseString()",
"constructor": false,
"full_signature": "@Override public String toVerboseString()",
"identifier": "toVerboseString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toVerboseString()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.hist(String noteFormat, Object... args)",
"constructor": false,
"full_signature": "private void hist(String noteFormat, Object... args)",
"identifier": "hist",
"modifiers": "private",
"parameters": "(String noteFormat, Object... args)",
"return": "void",
"signature": "void hist(String noteFormat, Object... args)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.nextPowerOfTwo(int val)",
"constructor": false,
"full_signature": "public static int nextPowerOfTwo(int val)",
"identifier": "nextPowerOfTwo",
"modifiers": "public static",
"parameters": "(int val)",
"return": "int",
"signature": "int nextPowerOfTwo(int val)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.verifyAllocator()",
"constructor": false,
"full_signature": " void verifyAllocator()",
"identifier": "verifyAllocator",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void verifyAllocator()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"constructor": false,
"full_signature": "private void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"identifier": "verifyAllocator",
"modifiers": "private",
"parameters": "(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"return": "void",
"signature": "void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.print(StringBuilder sb, int level, Verbosity verbosity)",
"constructor": false,
"full_signature": " void print(StringBuilder sb, int level, Verbosity verbosity)",
"identifier": "print",
"modifiers": "",
"parameters": "(StringBuilder sb, int level, Verbosity verbosity)",
"return": "void",
"signature": "void print(StringBuilder sb, int level, Verbosity verbosity)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"constructor": false,
"full_signature": "private void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"identifier": "dumpBuffers",
"modifiers": "private",
"parameters": "(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"return": "void",
"signature": "void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.indent(StringBuilder sb, int indent)",
"constructor": false,
"full_signature": "public static StringBuilder indent(StringBuilder sb, int indent)",
"identifier": "indent",
"modifiers": "public static",
"parameters": "(StringBuilder sb, int indent)",
"return": "StringBuilder",
"signature": "StringBuilder indent(StringBuilder sb, int indent)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.isDebug()",
"constructor": false,
"full_signature": "public static boolean isDebug()",
"identifier": "isDebug",
"modifiers": "public static",
"parameters": "()",
"return": "boolean",
"signature": "boolean isDebug()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getIOBuffer()",
"constructor": false,
"full_signature": "public byte[] getIOBuffer()",
"identifier": "getIOBuffer",
"modifiers": "public",
"parameters": "()",
"return": "byte[]",
"signature": "byte[] getIOBuffer()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.read(DrillBuf buf, int length, InputStream in)",
"constructor": false,
"full_signature": "@Override public void read(DrillBuf buf, int length, InputStream in)",
"identifier": "read",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, int length, InputStream in)",
"return": "void",
"signature": "void read(DrillBuf buf, int length, InputStream in)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.read(int length, InputStream in)",
"constructor": false,
"full_signature": "public DrillBuf read(int length, InputStream in)",
"identifier": "read",
"modifiers": "public",
"parameters": "(int length, InputStream in)",
"return": "DrillBuf",
"signature": "DrillBuf read(int length, InputStream in)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.write(DrillBuf buf, OutputStream out)",
"constructor": false,
"full_signature": "@Override public void write(DrillBuf buf, OutputStream out)",
"identifier": "write",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, OutputStream out)",
"return": "void",
"signature": "void write(DrillBuf buf, OutputStream out)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.write(DrillBuf buf, int length, OutputStream out)",
"constructor": false,
"full_signature": "@Override public void write(DrillBuf buf, int length, OutputStream out)",
"identifier": "write",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, int length, OutputStream out)",
"return": "void",
"signature": "void write(DrillBuf buf, int length, OutputStream out)",
"testcase": false
}
],
"superclass": "extends Accountant"
} | {
"body": "@Override\n public DrillBuf buffer(final int initialRequestSize) {\n assertOpen();\n\n return buffer(initialRequestSize, null);\n }",
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize)",
"identifier": "buffer",
"invocations": [
"assertOpen",
"buffer"
],
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_49 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/work/metadata/TestMetadataProvider.java",
"identifier": "TestMetadataProvider",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void catalogs() throws Exception {\n // test(\"SELECT * FROM INFORMATION_SCHEMA.CATALOGS\"); // SQL equivalent\n\n GetCatalogsResp resp = client.getCatalogs(null).get();\n\n assertEquals(RequestStatus.OK, resp.getStatus());\n List<CatalogMetadata> catalogs = resp.getCatalogsList();\n assertEquals(1, catalogs.size());\n\n CatalogMetadata c = catalogs.get(0);\n assertEquals(IS_CATALOG_NAME, c.getCatalogName());\n assertEquals(IS_CATALOG_DESCR, c.getDescription());\n assertEquals(IS_CATALOG_CONNECT, c.getConnect());\n }",
"class_method_signature": "TestMetadataProvider.catalogs()",
"constructor": false,
"full_signature": "@Test public void catalogs()",
"identifier": "catalogs",
"invocations": [
"get",
"getCatalogs",
"assertEquals",
"getStatus",
"getCatalogsList",
"assertEquals",
"size",
"get",
"assertEquals",
"getCatalogName",
"assertEquals",
"getDescription",
"assertEquals",
"getConnect"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void catalogs()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(MetadataProvider.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(MetadataProvider.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "IN_FUNCTION = \"in\"",
"modifier": "private static final",
"original_string": "private static final String IN_FUNCTION = \"in\";",
"type": "String",
"var_name": "IN_FUNCTION"
},
{
"declarator": "LIKE_FUNCTION = \"like\"",
"modifier": "private static final",
"original_string": "private static final String LIKE_FUNCTION = \"like\";",
"type": "String",
"var_name": "LIKE_FUNCTION"
},
{
"declarator": "AND_FUNCTION = \"booleanand\"",
"modifier": "private static final",
"original_string": "private static final String AND_FUNCTION = \"booleanand\";",
"type": "String",
"var_name": "AND_FUNCTION"
},
{
"declarator": "OR_FUNCTION = \"booleanor\"",
"modifier": "private static final",
"original_string": "private static final String OR_FUNCTION = \"booleanor\";",
"type": "String",
"var_name": "OR_FUNCTION"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/work/metadata/MetadataProvider.java",
"identifier": "MetadataProvider",
"interfaces": "",
"methods": [
{
"class_method_signature": "MetadataProvider.catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"identifier": "catalogs",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"identifier": "schemas",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"identifier": "tables",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"identifier": "columns",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"constructor": false,
"full_signature": "private static InfoSchemaFilter createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"identifier": "createInfoSchemaFilter",
"modifiers": "private static",
"parameters": "(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"return": "InfoSchemaFilter",
"signature": "InfoSchemaFilter createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"constructor": false,
"full_signature": "private static FunctionExprNode createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"identifier": "createLikeFunctionExprNode",
"modifiers": "private static",
"parameters": "(String fieldName, LikeFilter likeFilter)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"constructor": false,
"full_signature": "private static FunctionExprNode createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"identifier": "createInFunctionExprNode",
"modifiers": "private static",
"parameters": "(String fieldName, List<String> valuesFilter)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"constructor": false,
"full_signature": "private static FunctionExprNode combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"identifier": "combineFunctions",
"modifiers": "private static",
"parameters": "(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"constructor": false,
"full_signature": "private static PojoRecordReader<S> getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"identifier": "getPojoRecordReader",
"modifiers": "private static",
"parameters": "(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"return": "PojoRecordReader<S>",
"signature": "PojoRecordReader<S> getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"constructor": false,
"full_signature": "private static SchemaConfigInfoProvider newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"identifier": "newSchemaConfigInfoProvider",
"modifiers": "private static",
"parameters": "(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"return": "SchemaConfigInfoProvider",
"signature": "SchemaConfigInfoProvider newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createPBError(final String failedFunction, final Throwable ex)",
"constructor": false,
"full_signature": "static DrillPBError createPBError(final String failedFunction, final Throwable ex)",
"identifier": "createPBError",
"modifiers": "static",
"parameters": "(final String failedFunction, final Throwable ex)",
"return": "DrillPBError",
"signature": "DrillPBError createPBError(final String failedFunction, final Throwable ex)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Runnable catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender) {\n return new CatalogsProvider(session, dContext, req, responseSender);\n }",
"class_method_signature": "MetadataProvider.catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"identifier": "catalogs",
"invocations": [],
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_65 | {
"fields": [
{
"declarator": "built_in = \"built-in\"",
"modifier": "private static final",
"original_string": "private static final String built_in = \"built-in\";",
"type": "String",
"var_name": "built_in"
},
{
"declarator": "udf_jar = \"DrillUDF-1.0.jar\"",
"modifier": "private static final",
"original_string": "private static final String udf_jar = \"DrillUDF-1.0.jar\";",
"type": "String",
"var_name": "udf_jar"
},
{
"declarator": "newJars",
"modifier": "private static",
"original_string": "private static Map<String, List<FunctionHolder>> newJars;",
"type": "Map<String, List<FunctionHolder>>",
"var_name": "newJars"
},
{
"declarator": "registryHolder",
"modifier": "private",
"original_string": "private FunctionRegistryHolder registryHolder;",
"type": "FunctionRegistryHolder",
"var_name": "registryHolder"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolderTest.java",
"identifier": "FunctionRegistryHolderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testFunctionsSize() {\n int count = 0;\n for (List<FunctionHolder> functionHolders : newJars.values()) {\n count += functionHolders.size();\n }\n assertEquals(\"Functions size should match\", count, registryHolder.functionsSize());\n }",
"class_method_signature": "FunctionRegistryHolderTest.testFunctionsSize()",
"constructor": false,
"full_signature": "@Test public void testFunctionsSize()",
"identifier": "testFunctionsSize",
"invocations": [
"values",
"size",
"assertEquals",
"functionsSize"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testFunctionsSize()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "readWriteLock = new ReentrantReadWriteLock()",
"modifier": "private final",
"original_string": "private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();",
"type": "ReadWriteLock",
"var_name": "readWriteLock"
},
{
"declarator": "readLock = new AutoCloseableLock(readWriteLock.readLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock());",
"type": "AutoCloseableLock",
"var_name": "readLock"
},
{
"declarator": "writeLock = new AutoCloseableLock(readWriteLock.writeLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock());",
"type": "AutoCloseableLock",
"var_name": "writeLock"
},
{
"declarator": "version",
"modifier": "private",
"original_string": "private long version;",
"type": "long",
"var_name": "version"
},
{
"declarator": "jars",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, Queue<String>>> jars;",
"type": "Map<String, Map<String, Queue<String>>>",
"var_name": "jars"
},
{
"declarator": "functions",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, DrillFuncHolder>> functions;",
"type": "Map<String, Map<String, DrillFuncHolder>>",
"var_name": "functions"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolder.java",
"identifier": "FunctionRegistryHolder",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionRegistryHolder.FunctionRegistryHolder()",
"constructor": true,
"full_signature": "public FunctionRegistryHolder()",
"identifier": "FunctionRegistryHolder",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " FunctionRegistryHolder()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getVersion()",
"constructor": false,
"full_signature": "public long getVersion()",
"identifier": "getVersion",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getVersion()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"constructor": false,
"full_signature": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"identifier": "addJars",
"modifiers": "public",
"parameters": "(Map<String, List<FunctionHolder>> newJars, long version)",
"return": "void",
"signature": "void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeJar(String jarName)",
"constructor": false,
"full_signature": "public void removeJar(String jarName)",
"identifier": "removeJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllJarNames()",
"constructor": false,
"full_signature": "public List<String> getAllJarNames()",
"identifier": "getAllJarNames",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getAllJarNames()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getFunctionNamesByJar(String jarName)",
"constructor": false,
"full_signature": "public List<String> getFunctionNamesByJar(String jarName)",
"identifier": "getFunctionNamesByJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "List<String>",
"signature": "List<String> getFunctionNamesByJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders(AtomicLong version)",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "(AtomicLong version)",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders()",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithSignatures()",
"constructor": false,
"full_signature": "public ListMultimap<String, String> getAllFunctionsWithSignatures()",
"identifier": "getAllFunctionsWithSignatures",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, String>",
"signature": "ListMultimap<String, String> getAllFunctionsWithSignatures()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName, AtomicLong version)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName, AtomicLong version)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.containsJar(String jarName)",
"constructor": false,
"full_signature": "public boolean containsJar(String jarName)",
"identifier": "containsJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "boolean",
"signature": "boolean containsJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.functionsSize()",
"constructor": false,
"full_signature": "public int functionsSize()",
"identifier": "functionsSize",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int functionsSize()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getJarNameByFunctionSignature(String functionName, String functionSignature)",
"constructor": false,
"full_signature": "public String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"identifier": "getJarNameByFunctionSignature",
"modifiers": "public",
"parameters": "(String functionName, String functionSignature)",
"return": "String",
"signature": "String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"constructor": false,
"full_signature": "private void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"identifier": "addFunctions",
"modifiers": "private",
"parameters": "(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"return": "void",
"signature": "void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeAllByJar(String jarName)",
"constructor": false,
"full_signature": "private void removeAllByJar(String jarName)",
"identifier": "removeAllByJar",
"modifiers": "private",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeAllByJar(String jarName)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public int functionsSize() {\n try (AutoCloseableLock lock = readLock.open()) {\n return functions.size();\n }\n }",
"class_method_signature": "FunctionRegistryHolder.functionsSize()",
"constructor": false,
"full_signature": "public int functionsSize()",
"identifier": "functionsSize",
"invocations": [
"open",
"size"
],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int functionsSize()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_32 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void mergeFiltersTrue() {\n Path file = new Path(\"abc.txt\");\n\n PathFilter firstFilter = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().startsWith(\"a\");\n }\n };\n\n PathFilter secondFilter = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\".txt\");\n }\n };\n\n assertTrue(\"Path should have been included in the path list\", FileSystemUtil.mergeFilters(firstFilter, secondFilter).accept(file));\n assertTrue(\"Path should have been included in the path list\", FileSystemUtil.mergeFilters(firstFilter, new PathFilter[] {secondFilter}).accept(file));\n }",
"class_method_signature": "FileSystemUtilTest.mergeFiltersTrue()",
"constructor": false,
"full_signature": "@Test public void mergeFiltersTrue()",
"identifier": "mergeFiltersTrue",
"invocations": [
"startsWith",
"getName",
"endsWith",
"getName",
"assertTrue",
"accept",
"mergeFilters",
"assertTrue",
"accept",
"mergeFilters"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void mergeFiltersTrue()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters) {\n if (filters == null || filters.length == 0) {\n return filter;\n }\n\n int length = filters.length;\n PathFilter[] newFilters = Arrays.copyOf(filters, length + 1);\n newFilters[length] = filter;\n return mergeFilters(newFilters);\n }",
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"invocations": [
"copyOf",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_24 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListFilesRecursiveWithFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listFiles(fs, base, true, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\"a\") || path.getName().endsWith(\".txt\");\n }\n });\n\n assertEquals(\"File count should match\", 8, statuses.size());\n }",
"class_method_signature": "FileSystemUtilTest.testListFilesRecursiveWithFilter()",
"constructor": false,
"full_signature": "@Test public void testListFilesRecursiveWithFilter()",
"identifier": "testListFilesRecursiveWithFilter",
"invocations": [
"listFiles",
"endsWith",
"getName",
"endsWith",
"getName",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListFilesRecursiveWithFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listFiles(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }",
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"invocations": [
"listFiles",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_105 | {
"fields": [
{
"declarator": "config = DrillConfig.create()",
"modifier": "private final",
"original_string": "private final DrillConfig config = DrillConfig.create();",
"type": "DrillConfig",
"var_name": "config"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/client/DrillClientTest.java",
"identifier": "DrillClientTest",
"interfaces": "",
"superclass": "extends DrillSystemTestBase"
} | {
"body": "@Test\n public void testParseAndVerifyEndpointsWithMultiplePort() throws Exception{\n // Test to check when connection string has multiple port with one ip\n final String drillBitConnection = \"10.10.100.161:5000:6000\";\n\n try {\n final List<CoordinationProtos.DrillbitEndpoint> endpointsList = DrillClient.parseAndVerifyEndpoints\n (drillBitConnection, config.getString(ExecConstants.INITIAL_USER_PORT));\n fail();\n } catch (InvalidConnectionInfoException e) {\n System.out.println(e.getMessage());\n }\n }",
"class_method_signature": "DrillClientTest.testParseAndVerifyEndpointsWithMultiplePort()",
"constructor": false,
"full_signature": "@Test public void testParseAndVerifyEndpointsWithMultiplePort()",
"identifier": "testParseAndVerifyEndpointsWithMultiplePort",
"invocations": [
"parseAndVerifyEndpoints",
"getString",
"fail",
"println",
"getMessage"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testParseAndVerifyEndpointsWithMultiplePort()",
"testcase": true
} | {
"fields": [
{
"declarator": "DEFAULT_CLIENT_NAME = \"Apache Drill Java client\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_CLIENT_NAME = \"Apache Drill Java client\";",
"type": "String",
"var_name": "DEFAULT_CLIENT_NAME"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "objectMapper = new ObjectMapper()",
"modifier": "private static final",
"original_string": "private static final ObjectMapper objectMapper = new ObjectMapper();",
"type": "ObjectMapper",
"var_name": "objectMapper"
},
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final DrillConfig config;",
"type": "DrillConfig",
"var_name": "config"
},
{
"declarator": "client",
"modifier": "private",
"original_string": "private UserClient client;",
"type": "UserClient",
"var_name": "client"
},
{
"declarator": "properties",
"modifier": "private",
"original_string": "private DrillProperties properties;",
"type": "DrillProperties",
"var_name": "properties"
},
{
"declarator": "clusterCoordinator",
"modifier": "private volatile",
"original_string": "private volatile ClusterCoordinator clusterCoordinator;",
"type": "ClusterCoordinator",
"var_name": "clusterCoordinator"
},
{
"declarator": "connected = false",
"modifier": "private volatile",
"original_string": "private volatile boolean connected = false;",
"type": "boolean",
"var_name": "connected"
},
{
"declarator": "allocator",
"modifier": "private final",
"original_string": "private final BufferAllocator allocator;",
"type": "BufferAllocator",
"var_name": "allocator"
},
{
"declarator": "reconnectTimes",
"modifier": "private",
"original_string": "private int reconnectTimes;",
"type": "int",
"var_name": "reconnectTimes"
},
{
"declarator": "reconnectDelay",
"modifier": "private",
"original_string": "private int reconnectDelay;",
"type": "int",
"var_name": "reconnectDelay"
},
{
"declarator": "supportComplexTypes",
"modifier": "private",
"original_string": "private boolean supportComplexTypes;",
"type": "boolean",
"var_name": "supportComplexTypes"
},
{
"declarator": "ownsZkConnection",
"modifier": "private final",
"original_string": "private final boolean ownsZkConnection;",
"type": "boolean",
"var_name": "ownsZkConnection"
},
{
"declarator": "ownsAllocator",
"modifier": "private final",
"original_string": "private final boolean ownsAllocator;",
"type": "boolean",
"var_name": "ownsAllocator"
},
{
"declarator": "isDirectConnection",
"modifier": "private final",
"original_string": "private final boolean isDirectConnection;",
"type": "boolean",
"var_name": "isDirectConnection"
},
{
"declarator": "eventLoopGroup",
"modifier": "private",
"original_string": "private EventLoopGroup eventLoopGroup;",
"type": "EventLoopGroup",
"var_name": "eventLoopGroup"
},
{
"declarator": "executor",
"modifier": "private",
"original_string": "private ExecutorService executor;",
"type": "ExecutorService",
"var_name": "executor"
},
{
"declarator": "clientName = DEFAULT_CLIENT_NAME",
"modifier": "private",
"original_string": "private String clientName = DEFAULT_CLIENT_NAME;",
"type": "String",
"var_name": "clientName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java",
"identifier": "DrillClient",
"interfaces": "implements Closeable, ConnectionThrottle",
"methods": [
{
"class_method_signature": "DrillClient.DrillClient()",
"constructor": true,
"full_signature": "public DrillClient()",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DrillClient()",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(boolean isDirect)",
"return": "",
"signature": " DrillClient(boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(String fileName)",
"constructor": true,
"full_signature": "public DrillClient(String fileName)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(String fileName)",
"return": "",
"signature": " DrillClient(String fileName)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config)",
"return": "",
"signature": " DrillClient(DrillConfig config)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getConfig()",
"constructor": false,
"full_signature": "public DrillConfig getConfig()",
"identifier": "getConfig",
"modifiers": "public",
"parameters": "()",
"return": "DrillConfig",
"signature": "DrillConfig getConfig()",
"testcase": false
},
{
"class_method_signature": "DrillClient.setAutoRead(boolean enableAutoRead)",
"constructor": false,
"full_signature": "@Override public void setAutoRead(boolean enableAutoRead)",
"identifier": "setAutoRead",
"modifiers": "@Override public",
"parameters": "(boolean enableAutoRead)",
"return": "void",
"signature": "void setAutoRead(boolean enableAutoRead)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setClientName(String name)",
"constructor": false,
"full_signature": "public void setClientName(String name)",
"identifier": "setClientName",
"modifiers": "public",
"parameters": "(String name)",
"return": "void",
"signature": "void setClientName(String name)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setSupportComplexTypes(boolean supportComplexTypes)",
"constructor": false,
"full_signature": "public void setSupportComplexTypes(boolean supportComplexTypes)",
"identifier": "setSupportComplexTypes",
"modifiers": "public",
"parameters": "(boolean supportComplexTypes)",
"return": "void",
"signature": "void setSupportComplexTypes(boolean supportComplexTypes)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect()",
"constructor": false,
"full_signature": "public void connect()",
"identifier": "connect",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void connect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(Properties props)",
"constructor": false,
"full_signature": "public void connect(Properties props)",
"identifier": "connect",
"modifiers": "public",
"parameters": "(Properties props)",
"return": "void",
"signature": "void connect(Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(String connect, Properties props)",
"constructor": false,
"full_signature": "public synchronized void connect(String connect, Properties props)",
"identifier": "connect",
"modifiers": "public synchronized",
"parameters": "(String connect, Properties props)",
"return": "void",
"signature": "void connect(String connect, Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createEventLoop(int size, String prefix)",
"constructor": false,
"full_signature": "protected static EventLoopGroup createEventLoop(int size, String prefix)",
"identifier": "createEventLoop",
"modifiers": "protected static",
"parameters": "(int size, String prefix)",
"return": "EventLoopGroup",
"signature": "EventLoopGroup createEventLoop(int size, String prefix)",
"testcase": false
},
{
"class_method_signature": "DrillClient.reconnect()",
"constructor": false,
"full_signature": "public synchronized boolean reconnect()",
"identifier": "reconnect",
"modifiers": "public synchronized",
"parameters": "()",
"return": "boolean",
"signature": "boolean reconnect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(DrillbitEndpoint endpoint)",
"constructor": false,
"full_signature": "private void connect(DrillbitEndpoint endpoint)",
"identifier": "connect",
"modifiers": "private",
"parameters": "(DrillbitEndpoint endpoint)",
"return": "void",
"signature": "void connect(DrillbitEndpoint endpoint)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getAllocator()",
"constructor": false,
"full_signature": "public BufferAllocator getAllocator()",
"identifier": "getAllocator",
"modifiers": "public",
"parameters": "()",
"return": "BufferAllocator",
"signature": "BufferAllocator getAllocator()",
"testcase": false
},
{
"class_method_signature": "DrillClient.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerInfos()",
"constructor": false,
"full_signature": "@Deprecated public RpcEndpointInfos getServerInfos()",
"identifier": "getServerInfos",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "RpcEndpointInfos",
"signature": "RpcEndpointInfos getServerInfos()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerName()",
"constructor": false,
"full_signature": "public String getServerName()",
"identifier": "getServerName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getServerName()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerVersion()",
"constructor": false,
"full_signature": "public Version getServerVersion()",
"identifier": "getServerVersion",
"modifiers": "public",
"parameters": "()",
"return": "Version",
"signature": "Version getServerVersion()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerMeta()",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"identifier": "getServerMeta",
"modifiers": "public",
"parameters": "()",
"return": "DrillRpcFuture<GetServerMetaResp>",
"signature": "DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSupportedMethods()",
"constructor": false,
"full_signature": "public Set<ServerMethod> getSupportedMethods()",
"identifier": "getSupportedMethods",
"modifiers": "public",
"parameters": "()",
"return": "Set<ServerMethod>",
"signature": "Set<ServerMethod> getSupportedMethods()",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan)",
"constructor": false,
"full_signature": "public List<QueryDataBatch> runQuery(QueryType type, String plan)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> runQuery(QueryType type, String plan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.planQuery(QueryType type, String query, boolean isSplitPlan)",
"constructor": false,
"full_signature": "public DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"identifier": "planQuery",
"modifiers": "public",
"parameters": "(QueryType type, String query, boolean isSplitPlan)",
"return": "DrillRpcFuture<QueryPlanFragments>",
"signature": "DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getUserCredentials()",
"constructor": false,
"full_signature": "private UserBitShared.UserCredentials getUserCredentials()",
"identifier": "getUserCredentials",
"modifiers": "private",
"parameters": "()",
"return": "UserBitShared.UserCredentials",
"signature": "UserBitShared.UserCredentials getUserCredentials()",
"testcase": false
},
{
"class_method_signature": "DrillClient.cancelQuery(QueryId id)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"identifier": "cancelQuery",
"modifiers": "public",
"parameters": "(QueryId id)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"testcase": false
},
{
"class_method_signature": "DrillClient.resumeQuery(final QueryId queryId)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"identifier": "resumeQuery",
"modifiers": "public",
"parameters": "(final QueryId queryId)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getCatalogs(LikeFilter catalogNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"identifier": "getCatalogs",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter)",
"return": "DrillRpcFuture<GetCatalogsResp>",
"signature": "DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"identifier": "getSchemas",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"return": "DrillRpcFuture<GetSchemasResp>",
"signature": "DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"identifier": "getTables",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"return": "DrillRpcFuture<GetTablesResp>",
"signature": "DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"identifier": "getColumns",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"return": "DrillRpcFuture<GetColumnsResp>",
"signature": "DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createPreparedStatement(final String query)",
"constructor": false,
"full_signature": "public DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"identifier": "createPreparedStatement",
"modifiers": "public",
"parameters": "(final String query)",
"return": "DrillRpcFuture<CreatePreparedStatementResp>",
"signature": "DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"identifier": "executePreparedStatement",
"modifiers": "public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"return": "void",
"signature": "void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"constructor": false,
"full_signature": "@VisibleForTesting public List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"identifier": "executePreparedStatement",
"modifiers": "@VisibleForTesting public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)\n throws InvalidConnectionInfoException {\n // If no drillbits is provided then throw exception\n drillbits = drillbits.trim();\n if (drillbits.isEmpty()) {\n throw new InvalidConnectionInfoException(\"No drillbit information specified in the connection string\");\n }\n\n final List<DrillbitEndpoint> endpointList = new ArrayList<>();\n final String[] connectInfo = drillbits.split(\",\");\n\n // Fetch ip address and port information for each drillbit and populate the list\n for (String drillbit : connectInfo) {\n\n // Trim all the empty spaces and check if the entry is empty string.\n // Ignore the empty ones.\n drillbit = drillbit.trim();\n\n if (!drillbit.isEmpty()) {\n // Verify if we have only \":\" or only \":port\" pattern\n if (drillbit.charAt(0) == ':') {\n // Invalid drillbit information\n throw new InvalidConnectionInfoException(\"Malformed connection string with drillbit hostname or \" +\n \"hostaddress missing for an entry: \" + drillbit);\n }\n\n // We are now sure that each ip:port entry will have both the values atleast once.\n // Split each drillbit connection string to get ip address and port value\n final String[] drillbitInfo = drillbit.split(\":\");\n\n // Check if we have more than one port\n if (drillbitInfo.length > 2) {\n throw new InvalidConnectionInfoException(\"Malformed connection string with more than one port in a \" +\n \"drillbit entry: \" + drillbit);\n }\n\n // At this point we are sure that drillbitInfo has atleast hostname or host address\n // trim all the empty spaces which might be present in front of hostname or\n // host address information\n final String ipAddress = drillbitInfo[0].trim();\n String port = defaultUserPort;\n\n if (drillbitInfo.length == 2) {\n // We have a port value also given by user. trim all the empty spaces between : and port value before\n // validating the correctness of value.\n port = drillbitInfo[1].trim();\n }\n\n try {\n final DrillbitEndpoint endpoint = DrillbitEndpoint.newBuilder()\n .setAddress(ipAddress)\n .setUserPort(Integer.parseInt(port))\n .build();\n\n endpointList.add(endpoint);\n } catch (NumberFormatException e) {\n throw new InvalidConnectionInfoException(\"Malformed port value in entry: \" + ipAddress + \":\" + port + \" \" +\n \"passed in connection string\");\n }\n }\n }\n if (endpointList.size() == 0) {\n throw new InvalidConnectionInfoException(\"No valid drillbit information specified in the connection string\");\n }\n return endpointList;\n }",
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"invocations": [
"trim",
"isEmpty",
"split",
"trim",
"isEmpty",
"charAt",
"split",
"trim",
"trim",
"build",
"setUserPort",
"setAddress",
"newBuilder",
"parseInt",
"add",
"size"
],
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_104 | {
"fields": [
{
"declarator": "config = DrillConfig.create()",
"modifier": "private final",
"original_string": "private final DrillConfig config = DrillConfig.create();",
"type": "DrillConfig",
"var_name": "config"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/client/DrillClientTest.java",
"identifier": "DrillClientTest",
"interfaces": "",
"superclass": "extends DrillSystemTestBase"
} | {
"body": "@Test\n public void testParseAndVerifyEndpointsWithOnlyPort() throws Exception{\n // Test to check when connection string has port with no ip\n final String drillBitConnection = \":5000\";\n\n try {\n final List<CoordinationProtos.DrillbitEndpoint> endpointsList = DrillClient.parseAndVerifyEndpoints\n (drillBitConnection, config.getString(ExecConstants.INITIAL_USER_PORT));\n fail();\n } catch (InvalidConnectionInfoException e) {\n System.out.println(e.getMessage());\n }\n }",
"class_method_signature": "DrillClientTest.testParseAndVerifyEndpointsWithOnlyPort()",
"constructor": false,
"full_signature": "@Test public void testParseAndVerifyEndpointsWithOnlyPort()",
"identifier": "testParseAndVerifyEndpointsWithOnlyPort",
"invocations": [
"parseAndVerifyEndpoints",
"getString",
"fail",
"println",
"getMessage"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testParseAndVerifyEndpointsWithOnlyPort()",
"testcase": true
} | {
"fields": [
{
"declarator": "DEFAULT_CLIENT_NAME = \"Apache Drill Java client\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_CLIENT_NAME = \"Apache Drill Java client\";",
"type": "String",
"var_name": "DEFAULT_CLIENT_NAME"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "objectMapper = new ObjectMapper()",
"modifier": "private static final",
"original_string": "private static final ObjectMapper objectMapper = new ObjectMapper();",
"type": "ObjectMapper",
"var_name": "objectMapper"
},
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final DrillConfig config;",
"type": "DrillConfig",
"var_name": "config"
},
{
"declarator": "client",
"modifier": "private",
"original_string": "private UserClient client;",
"type": "UserClient",
"var_name": "client"
},
{
"declarator": "properties",
"modifier": "private",
"original_string": "private DrillProperties properties;",
"type": "DrillProperties",
"var_name": "properties"
},
{
"declarator": "clusterCoordinator",
"modifier": "private volatile",
"original_string": "private volatile ClusterCoordinator clusterCoordinator;",
"type": "ClusterCoordinator",
"var_name": "clusterCoordinator"
},
{
"declarator": "connected = false",
"modifier": "private volatile",
"original_string": "private volatile boolean connected = false;",
"type": "boolean",
"var_name": "connected"
},
{
"declarator": "allocator",
"modifier": "private final",
"original_string": "private final BufferAllocator allocator;",
"type": "BufferAllocator",
"var_name": "allocator"
},
{
"declarator": "reconnectTimes",
"modifier": "private",
"original_string": "private int reconnectTimes;",
"type": "int",
"var_name": "reconnectTimes"
},
{
"declarator": "reconnectDelay",
"modifier": "private",
"original_string": "private int reconnectDelay;",
"type": "int",
"var_name": "reconnectDelay"
},
{
"declarator": "supportComplexTypes",
"modifier": "private",
"original_string": "private boolean supportComplexTypes;",
"type": "boolean",
"var_name": "supportComplexTypes"
},
{
"declarator": "ownsZkConnection",
"modifier": "private final",
"original_string": "private final boolean ownsZkConnection;",
"type": "boolean",
"var_name": "ownsZkConnection"
},
{
"declarator": "ownsAllocator",
"modifier": "private final",
"original_string": "private final boolean ownsAllocator;",
"type": "boolean",
"var_name": "ownsAllocator"
},
{
"declarator": "isDirectConnection",
"modifier": "private final",
"original_string": "private final boolean isDirectConnection;",
"type": "boolean",
"var_name": "isDirectConnection"
},
{
"declarator": "eventLoopGroup",
"modifier": "private",
"original_string": "private EventLoopGroup eventLoopGroup;",
"type": "EventLoopGroup",
"var_name": "eventLoopGroup"
},
{
"declarator": "executor",
"modifier": "private",
"original_string": "private ExecutorService executor;",
"type": "ExecutorService",
"var_name": "executor"
},
{
"declarator": "clientName = DEFAULT_CLIENT_NAME",
"modifier": "private",
"original_string": "private String clientName = DEFAULT_CLIENT_NAME;",
"type": "String",
"var_name": "clientName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java",
"identifier": "DrillClient",
"interfaces": "implements Closeable, ConnectionThrottle",
"methods": [
{
"class_method_signature": "DrillClient.DrillClient()",
"constructor": true,
"full_signature": "public DrillClient()",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DrillClient()",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(boolean isDirect)",
"return": "",
"signature": " DrillClient(boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(String fileName)",
"constructor": true,
"full_signature": "public DrillClient(String fileName)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(String fileName)",
"return": "",
"signature": " DrillClient(String fileName)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config)",
"return": "",
"signature": " DrillClient(DrillConfig config)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getConfig()",
"constructor": false,
"full_signature": "public DrillConfig getConfig()",
"identifier": "getConfig",
"modifiers": "public",
"parameters": "()",
"return": "DrillConfig",
"signature": "DrillConfig getConfig()",
"testcase": false
},
{
"class_method_signature": "DrillClient.setAutoRead(boolean enableAutoRead)",
"constructor": false,
"full_signature": "@Override public void setAutoRead(boolean enableAutoRead)",
"identifier": "setAutoRead",
"modifiers": "@Override public",
"parameters": "(boolean enableAutoRead)",
"return": "void",
"signature": "void setAutoRead(boolean enableAutoRead)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setClientName(String name)",
"constructor": false,
"full_signature": "public void setClientName(String name)",
"identifier": "setClientName",
"modifiers": "public",
"parameters": "(String name)",
"return": "void",
"signature": "void setClientName(String name)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setSupportComplexTypes(boolean supportComplexTypes)",
"constructor": false,
"full_signature": "public void setSupportComplexTypes(boolean supportComplexTypes)",
"identifier": "setSupportComplexTypes",
"modifiers": "public",
"parameters": "(boolean supportComplexTypes)",
"return": "void",
"signature": "void setSupportComplexTypes(boolean supportComplexTypes)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect()",
"constructor": false,
"full_signature": "public void connect()",
"identifier": "connect",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void connect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(Properties props)",
"constructor": false,
"full_signature": "public void connect(Properties props)",
"identifier": "connect",
"modifiers": "public",
"parameters": "(Properties props)",
"return": "void",
"signature": "void connect(Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(String connect, Properties props)",
"constructor": false,
"full_signature": "public synchronized void connect(String connect, Properties props)",
"identifier": "connect",
"modifiers": "public synchronized",
"parameters": "(String connect, Properties props)",
"return": "void",
"signature": "void connect(String connect, Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createEventLoop(int size, String prefix)",
"constructor": false,
"full_signature": "protected static EventLoopGroup createEventLoop(int size, String prefix)",
"identifier": "createEventLoop",
"modifiers": "protected static",
"parameters": "(int size, String prefix)",
"return": "EventLoopGroup",
"signature": "EventLoopGroup createEventLoop(int size, String prefix)",
"testcase": false
},
{
"class_method_signature": "DrillClient.reconnect()",
"constructor": false,
"full_signature": "public synchronized boolean reconnect()",
"identifier": "reconnect",
"modifiers": "public synchronized",
"parameters": "()",
"return": "boolean",
"signature": "boolean reconnect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(DrillbitEndpoint endpoint)",
"constructor": false,
"full_signature": "private void connect(DrillbitEndpoint endpoint)",
"identifier": "connect",
"modifiers": "private",
"parameters": "(DrillbitEndpoint endpoint)",
"return": "void",
"signature": "void connect(DrillbitEndpoint endpoint)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getAllocator()",
"constructor": false,
"full_signature": "public BufferAllocator getAllocator()",
"identifier": "getAllocator",
"modifiers": "public",
"parameters": "()",
"return": "BufferAllocator",
"signature": "BufferAllocator getAllocator()",
"testcase": false
},
{
"class_method_signature": "DrillClient.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerInfos()",
"constructor": false,
"full_signature": "@Deprecated public RpcEndpointInfos getServerInfos()",
"identifier": "getServerInfos",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "RpcEndpointInfos",
"signature": "RpcEndpointInfos getServerInfos()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerName()",
"constructor": false,
"full_signature": "public String getServerName()",
"identifier": "getServerName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getServerName()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerVersion()",
"constructor": false,
"full_signature": "public Version getServerVersion()",
"identifier": "getServerVersion",
"modifiers": "public",
"parameters": "()",
"return": "Version",
"signature": "Version getServerVersion()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerMeta()",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"identifier": "getServerMeta",
"modifiers": "public",
"parameters": "()",
"return": "DrillRpcFuture<GetServerMetaResp>",
"signature": "DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSupportedMethods()",
"constructor": false,
"full_signature": "public Set<ServerMethod> getSupportedMethods()",
"identifier": "getSupportedMethods",
"modifiers": "public",
"parameters": "()",
"return": "Set<ServerMethod>",
"signature": "Set<ServerMethod> getSupportedMethods()",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan)",
"constructor": false,
"full_signature": "public List<QueryDataBatch> runQuery(QueryType type, String plan)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> runQuery(QueryType type, String plan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.planQuery(QueryType type, String query, boolean isSplitPlan)",
"constructor": false,
"full_signature": "public DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"identifier": "planQuery",
"modifiers": "public",
"parameters": "(QueryType type, String query, boolean isSplitPlan)",
"return": "DrillRpcFuture<QueryPlanFragments>",
"signature": "DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getUserCredentials()",
"constructor": false,
"full_signature": "private UserBitShared.UserCredentials getUserCredentials()",
"identifier": "getUserCredentials",
"modifiers": "private",
"parameters": "()",
"return": "UserBitShared.UserCredentials",
"signature": "UserBitShared.UserCredentials getUserCredentials()",
"testcase": false
},
{
"class_method_signature": "DrillClient.cancelQuery(QueryId id)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"identifier": "cancelQuery",
"modifiers": "public",
"parameters": "(QueryId id)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"testcase": false
},
{
"class_method_signature": "DrillClient.resumeQuery(final QueryId queryId)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"identifier": "resumeQuery",
"modifiers": "public",
"parameters": "(final QueryId queryId)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getCatalogs(LikeFilter catalogNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"identifier": "getCatalogs",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter)",
"return": "DrillRpcFuture<GetCatalogsResp>",
"signature": "DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"identifier": "getSchemas",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"return": "DrillRpcFuture<GetSchemasResp>",
"signature": "DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"identifier": "getTables",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"return": "DrillRpcFuture<GetTablesResp>",
"signature": "DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"identifier": "getColumns",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"return": "DrillRpcFuture<GetColumnsResp>",
"signature": "DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createPreparedStatement(final String query)",
"constructor": false,
"full_signature": "public DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"identifier": "createPreparedStatement",
"modifiers": "public",
"parameters": "(final String query)",
"return": "DrillRpcFuture<CreatePreparedStatementResp>",
"signature": "DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"identifier": "executePreparedStatement",
"modifiers": "public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"return": "void",
"signature": "void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"constructor": false,
"full_signature": "@VisibleForTesting public List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"identifier": "executePreparedStatement",
"modifiers": "@VisibleForTesting public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)\n throws InvalidConnectionInfoException {\n // If no drillbits is provided then throw exception\n drillbits = drillbits.trim();\n if (drillbits.isEmpty()) {\n throw new InvalidConnectionInfoException(\"No drillbit information specified in the connection string\");\n }\n\n final List<DrillbitEndpoint> endpointList = new ArrayList<>();\n final String[] connectInfo = drillbits.split(\",\");\n\n // Fetch ip address and port information for each drillbit and populate the list\n for (String drillbit : connectInfo) {\n\n // Trim all the empty spaces and check if the entry is empty string.\n // Ignore the empty ones.\n drillbit = drillbit.trim();\n\n if (!drillbit.isEmpty()) {\n // Verify if we have only \":\" or only \":port\" pattern\n if (drillbit.charAt(0) == ':') {\n // Invalid drillbit information\n throw new InvalidConnectionInfoException(\"Malformed connection string with drillbit hostname or \" +\n \"hostaddress missing for an entry: \" + drillbit);\n }\n\n // We are now sure that each ip:port entry will have both the values atleast once.\n // Split each drillbit connection string to get ip address and port value\n final String[] drillbitInfo = drillbit.split(\":\");\n\n // Check if we have more than one port\n if (drillbitInfo.length > 2) {\n throw new InvalidConnectionInfoException(\"Malformed connection string with more than one port in a \" +\n \"drillbit entry: \" + drillbit);\n }\n\n // At this point we are sure that drillbitInfo has atleast hostname or host address\n // trim all the empty spaces which might be present in front of hostname or\n // host address information\n final String ipAddress = drillbitInfo[0].trim();\n String port = defaultUserPort;\n\n if (drillbitInfo.length == 2) {\n // We have a port value also given by user. trim all the empty spaces between : and port value before\n // validating the correctness of value.\n port = drillbitInfo[1].trim();\n }\n\n try {\n final DrillbitEndpoint endpoint = DrillbitEndpoint.newBuilder()\n .setAddress(ipAddress)\n .setUserPort(Integer.parseInt(port))\n .build();\n\n endpointList.add(endpoint);\n } catch (NumberFormatException e) {\n throw new InvalidConnectionInfoException(\"Malformed port value in entry: \" + ipAddress + \":\" + port + \" \" +\n \"passed in connection string\");\n }\n }\n }\n if (endpointList.size() == 0) {\n throw new InvalidConnectionInfoException(\"No valid drillbit information specified in the connection string\");\n }\n return endpointList;\n }",
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"invocations": [
"trim",
"isEmpty",
"split",
"trim",
"isEmpty",
"charAt",
"split",
"trim",
"trim",
"build",
"setUserPort",
"setAddress",
"newBuilder",
"parseInt",
"add",
"size"
],
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_25 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListFilesEmptyResult() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listFiles(fs, base, false);\n assertEquals(\"File count should match\", 0, statuses.size());\n }",
"class_method_signature": "FileSystemUtilTest.testListFilesEmptyResult()",
"constructor": false,
"full_signature": "@Test public void testListFilesEmptyResult()",
"identifier": "testListFilesEmptyResult",
"invocations": [
"listFiles",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListFilesEmptyResult()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listFiles(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }",
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"invocations": [
"listFiles",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_33 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void mergeFiltersFalse() {\n Path file = new Path(\"abc.txt\");\n\n PathFilter firstFilter = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().startsWith(\"a\");\n }\n };\n\n PathFilter secondFilter = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\".csv\");\n }\n };\n\n assertFalse(\"Path should have been excluded from the path list\", FileSystemUtil.mergeFilters(firstFilter, secondFilter).accept(file));\n assertFalse(\"Path should have been excluded from the path list\", FileSystemUtil.mergeFilters(firstFilter, new PathFilter[] {secondFilter}).accept(file));\n }",
"class_method_signature": "FileSystemUtilTest.mergeFiltersFalse()",
"constructor": false,
"full_signature": "@Test public void mergeFiltersFalse()",
"identifier": "mergeFiltersFalse",
"invocations": [
"startsWith",
"getName",
"endsWith",
"getName",
"assertFalse",
"accept",
"mergeFilters",
"assertFalse",
"accept",
"mergeFilters"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void mergeFiltersFalse()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters) {\n if (filters == null || filters.length == 0) {\n return filter;\n }\n\n int length = filters.length;\n PathFilter[] newFilters = Arrays.copyOf(filters, length + 1);\n newFilters[length] = filter;\n return mergeFilters(newFilters);\n }",
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"invocations": [
"copyOf",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_64 | {
"fields": [
{
"declarator": "built_in = \"built-in\"",
"modifier": "private static final",
"original_string": "private static final String built_in = \"built-in\";",
"type": "String",
"var_name": "built_in"
},
{
"declarator": "udf_jar = \"DrillUDF-1.0.jar\"",
"modifier": "private static final",
"original_string": "private static final String udf_jar = \"DrillUDF-1.0.jar\";",
"type": "String",
"var_name": "udf_jar"
},
{
"declarator": "newJars",
"modifier": "private static",
"original_string": "private static Map<String, List<FunctionHolder>> newJars;",
"type": "Map<String, List<FunctionHolder>>",
"var_name": "newJars"
},
{
"declarator": "registryHolder",
"modifier": "private",
"original_string": "private FunctionRegistryHolder registryHolder;",
"type": "FunctionRegistryHolder",
"var_name": "registryHolder"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolderTest.java",
"identifier": "FunctionRegistryHolderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testContainsJar() {\n assertTrue(\"Jar should be present in registry holder\", registryHolder.containsJar(built_in));\n assertFalse(\"Jar should be absent in registry holder\", registryHolder.containsJar(\"unknown.jar\"));\n }",
"class_method_signature": "FunctionRegistryHolderTest.testContainsJar()",
"constructor": false,
"full_signature": "@Test public void testContainsJar()",
"identifier": "testContainsJar",
"invocations": [
"assertTrue",
"containsJar",
"assertFalse",
"containsJar"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testContainsJar()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "readWriteLock = new ReentrantReadWriteLock()",
"modifier": "private final",
"original_string": "private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();",
"type": "ReadWriteLock",
"var_name": "readWriteLock"
},
{
"declarator": "readLock = new AutoCloseableLock(readWriteLock.readLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock());",
"type": "AutoCloseableLock",
"var_name": "readLock"
},
{
"declarator": "writeLock = new AutoCloseableLock(readWriteLock.writeLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock());",
"type": "AutoCloseableLock",
"var_name": "writeLock"
},
{
"declarator": "version",
"modifier": "private",
"original_string": "private long version;",
"type": "long",
"var_name": "version"
},
{
"declarator": "jars",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, Queue<String>>> jars;",
"type": "Map<String, Map<String, Queue<String>>>",
"var_name": "jars"
},
{
"declarator": "functions",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, DrillFuncHolder>> functions;",
"type": "Map<String, Map<String, DrillFuncHolder>>",
"var_name": "functions"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolder.java",
"identifier": "FunctionRegistryHolder",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionRegistryHolder.FunctionRegistryHolder()",
"constructor": true,
"full_signature": "public FunctionRegistryHolder()",
"identifier": "FunctionRegistryHolder",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " FunctionRegistryHolder()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getVersion()",
"constructor": false,
"full_signature": "public long getVersion()",
"identifier": "getVersion",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getVersion()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"constructor": false,
"full_signature": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"identifier": "addJars",
"modifiers": "public",
"parameters": "(Map<String, List<FunctionHolder>> newJars, long version)",
"return": "void",
"signature": "void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeJar(String jarName)",
"constructor": false,
"full_signature": "public void removeJar(String jarName)",
"identifier": "removeJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllJarNames()",
"constructor": false,
"full_signature": "public List<String> getAllJarNames()",
"identifier": "getAllJarNames",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getAllJarNames()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getFunctionNamesByJar(String jarName)",
"constructor": false,
"full_signature": "public List<String> getFunctionNamesByJar(String jarName)",
"identifier": "getFunctionNamesByJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "List<String>",
"signature": "List<String> getFunctionNamesByJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders(AtomicLong version)",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "(AtomicLong version)",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders()",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithSignatures()",
"constructor": false,
"full_signature": "public ListMultimap<String, String> getAllFunctionsWithSignatures()",
"identifier": "getAllFunctionsWithSignatures",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, String>",
"signature": "ListMultimap<String, String> getAllFunctionsWithSignatures()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName, AtomicLong version)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName, AtomicLong version)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.containsJar(String jarName)",
"constructor": false,
"full_signature": "public boolean containsJar(String jarName)",
"identifier": "containsJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "boolean",
"signature": "boolean containsJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.functionsSize()",
"constructor": false,
"full_signature": "public int functionsSize()",
"identifier": "functionsSize",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int functionsSize()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getJarNameByFunctionSignature(String functionName, String functionSignature)",
"constructor": false,
"full_signature": "public String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"identifier": "getJarNameByFunctionSignature",
"modifiers": "public",
"parameters": "(String functionName, String functionSignature)",
"return": "String",
"signature": "String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"constructor": false,
"full_signature": "private void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"identifier": "addFunctions",
"modifiers": "private",
"parameters": "(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"return": "void",
"signature": "void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeAllByJar(String jarName)",
"constructor": false,
"full_signature": "private void removeAllByJar(String jarName)",
"identifier": "removeAllByJar",
"modifiers": "private",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeAllByJar(String jarName)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public boolean containsJar(String jarName) {\n try (AutoCloseableLock lock = readLock.open()) {\n return jars.containsKey(jarName);\n }\n }",
"class_method_signature": "FunctionRegistryHolder.containsJar(String jarName)",
"constructor": false,
"full_signature": "public boolean containsJar(String jarName)",
"identifier": "containsJar",
"invocations": [
"open",
"containsKey"
],
"modifiers": "public",
"parameters": "(String jarName)",
"return": "boolean",
"signature": "boolean containsJar(String jarName)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_112 | {
"fields": [
{
"declarator": "timer = Stopwatch.createUnstarted()",
"modifier": "",
"original_string": "Stopwatch timer = Stopwatch.createUnstarted();",
"type": "Stopwatch",
"var_name": "timer"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/xsort/managed/TestSortImpl.java",
"identifier": "TestSortImpl",
"interfaces": "",
"superclass": "extends DrillTest"
} | {
"body": "@Test\n public void testSpill() throws Exception {\n OperatorFixtureBuilder builder = OperatorFixture.builder();\n builder.configBuilder()\n .put(ExecConstants.EXTERNAL_SORT_BATCH_LIMIT, 2);\n try (OperatorFixture fixture = builder.build()) {\n BatchSchema schema = SortTestUtilities.nonNullSchema();\n SortTestFixture sortTest = new SortTestFixture(fixture) {\n @Override\n protected void validateSort(SortImpl sort) {\n assertEquals(1, sort.getMetrics().getSpillCount());\n assertEquals(0, sort.getMetrics().getMergeCount());\n assertEquals(2, sort.getMetrics().getPeakBatchCount());\n }\n @Override\n protected void validateFinalStats(SortImpl sort) {\n assertTrue(sort.getMetrics().getWriteBytes() > 0);\n }\n };\n sortTest.addInput(fixture.rowSetBuilder(schema)\n .add(2, \"second\")\n .build());\n sortTest.addInput(fixture.rowSetBuilder(schema)\n .add(3, \"third\")\n .build());\n sortTest.addInput(fixture.rowSetBuilder(schema)\n .add(1, \"first\")\n .build());\n sortTest.addOutput(fixture.rowSetBuilder(schema)\n .add(1, \"first\")\n .add(2, \"second\")\n .add(3, \"third\")\n .build());\n sortTest.run();\n }\n }",
"class_method_signature": "TestSortImpl.testSpill()",
"constructor": false,
"full_signature": "@Test public void testSpill()",
"identifier": "testSpill",
"invocations": [
"builder",
"put",
"configBuilder",
"build",
"nonNullSchema",
"assertEquals",
"getSpillCount",
"getMetrics",
"assertEquals",
"getMergeCount",
"getMetrics",
"assertEquals",
"getPeakBatchCount",
"getMetrics",
"assertTrue",
"getWriteBytes",
"getMetrics",
"addInput",
"build",
"add",
"rowSetBuilder",
"addInput",
"build",
"add",
"rowSetBuilder",
"addInput",
"build",
"add",
"rowSetBuilder",
"addOutput",
"build",
"add",
"add",
"add",
"rowSetBuilder",
"run"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSpill()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(ExternalSortBatch.class)",
"modifier": "static final",
"original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ExternalSortBatch.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final SortConfig config;",
"type": "SortConfig",
"var_name": "config"
},
{
"declarator": "metrics",
"modifier": "private final",
"original_string": "private final SortMetrics metrics;",
"type": "SortMetrics",
"var_name": "metrics"
},
{
"declarator": "memManager",
"modifier": "private final",
"original_string": "private final SortMemoryManager memManager;",
"type": "SortMemoryManager",
"var_name": "memManager"
},
{
"declarator": "outputBatch",
"modifier": "private",
"original_string": "private VectorContainer outputBatch;",
"type": "VectorContainer",
"var_name": "outputBatch"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private OperExecContext context;",
"type": "OperExecContext",
"var_name": "context"
},
{
"declarator": "allocator",
"modifier": "private final",
"original_string": "private final BufferAllocator allocator;",
"type": "BufferAllocator",
"var_name": "allocator"
},
{
"declarator": "spilledRuns",
"modifier": "private final",
"original_string": "private final SpilledRuns spilledRuns;",
"type": "SpilledRuns",
"var_name": "spilledRuns"
},
{
"declarator": "bufferedBatches",
"modifier": "private final",
"original_string": "private final BufferedBatches bufferedBatches;",
"type": "BufferedBatches",
"var_name": "bufferedBatches"
},
{
"declarator": "sizer",
"modifier": "private",
"original_string": "private RecordBatchSizer sizer;",
"type": "RecordBatchSizer",
"var_name": "sizer"
},
{
"declarator": "allocHelper",
"modifier": "private",
"original_string": "private VectorInitializer allocHelper;",
"type": "VectorInitializer",
"var_name": "allocHelper"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/managed/SortImpl.java",
"identifier": "SortImpl",
"interfaces": "",
"methods": [
{
"class_method_signature": "SortImpl.SortImpl(OperExecContext opContext, SortConfig sortConfig,\n SpilledRuns spilledRuns, VectorContainer batch)",
"constructor": true,
"full_signature": "public SortImpl(OperExecContext opContext, SortConfig sortConfig,\n SpilledRuns spilledRuns, VectorContainer batch)",
"identifier": "SortImpl",
"modifiers": "public",
"parameters": "(OperExecContext opContext, SortConfig sortConfig,\n SpilledRuns spilledRuns, VectorContainer batch)",
"return": "",
"signature": " SortImpl(OperExecContext opContext, SortConfig sortConfig,\n SpilledRuns spilledRuns, VectorContainer batch)",
"testcase": false
},
{
"class_method_signature": "SortImpl.setSchema(BatchSchema schema)",
"constructor": false,
"full_signature": "public void setSchema(BatchSchema schema)",
"identifier": "setSchema",
"modifiers": "public",
"parameters": "(BatchSchema schema)",
"return": "void",
"signature": "void setSchema(BatchSchema schema)",
"testcase": false
},
{
"class_method_signature": "SortImpl.forceSpill()",
"constructor": false,
"full_signature": "public boolean forceSpill()",
"identifier": "forceSpill",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean forceSpill()",
"testcase": false
},
{
"class_method_signature": "SortImpl.addBatch(VectorAccessible incoming)",
"constructor": false,
"full_signature": "public void addBatch(VectorAccessible incoming)",
"identifier": "addBatch",
"modifiers": "public",
"parameters": "(VectorAccessible incoming)",
"return": "void",
"signature": "void addBatch(VectorAccessible incoming)",
"testcase": false
},
{
"class_method_signature": "SortImpl.analyzeIncomingBatch(VectorAccessible incoming)",
"constructor": false,
"full_signature": "private void analyzeIncomingBatch(VectorAccessible incoming)",
"identifier": "analyzeIncomingBatch",
"modifiers": "private",
"parameters": "(VectorAccessible incoming)",
"return": "void",
"signature": "void analyzeIncomingBatch(VectorAccessible incoming)",
"testcase": false
},
{
"class_method_signature": "SortImpl.isSpillNeeded(int incomingSize)",
"constructor": false,
"full_signature": "private boolean isSpillNeeded(int incomingSize)",
"identifier": "isSpillNeeded",
"modifiers": "private",
"parameters": "(int incomingSize)",
"return": "boolean",
"signature": "boolean isSpillNeeded(int incomingSize)",
"testcase": false
},
{
"class_method_signature": "SortImpl.validateBatchSize(long actualBatchSize, long memoryDelta)",
"constructor": false,
"full_signature": "private void validateBatchSize(long actualBatchSize, long memoryDelta)",
"identifier": "validateBatchSize",
"modifiers": "private",
"parameters": "(long actualBatchSize, long memoryDelta)",
"return": "void",
"signature": "void validateBatchSize(long actualBatchSize, long memoryDelta)",
"testcase": false
},
{
"class_method_signature": "SortImpl.spillFromMemory()",
"constructor": false,
"full_signature": "private void spillFromMemory()",
"identifier": "spillFromMemory",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void spillFromMemory()",
"testcase": false
},
{
"class_method_signature": "SortImpl.allocHelper()",
"constructor": false,
"full_signature": "private VectorInitializer allocHelper()",
"identifier": "allocHelper",
"modifiers": "private",
"parameters": "()",
"return": "VectorInitializer",
"signature": "VectorInitializer allocHelper()",
"testcase": false
},
{
"class_method_signature": "SortImpl.getMetrics()",
"constructor": false,
"full_signature": "public SortMetrics getMetrics()",
"identifier": "getMetrics",
"modifiers": "public",
"parameters": "()",
"return": "SortMetrics",
"signature": "SortMetrics getMetrics()",
"testcase": false
},
{
"class_method_signature": "SortImpl.startMerge()",
"constructor": false,
"full_signature": "public SortResults startMerge()",
"identifier": "startMerge",
"modifiers": "public",
"parameters": "()",
"return": "SortResults",
"signature": "SortResults startMerge()",
"testcase": false
},
{
"class_method_signature": "SortImpl.singleBatchResult()",
"constructor": false,
"full_signature": "private SortResults singleBatchResult()",
"identifier": "singleBatchResult",
"modifiers": "private",
"parameters": "()",
"return": "SortResults",
"signature": "SortResults singleBatchResult()",
"testcase": false
},
{
"class_method_signature": "SortImpl.canUseMemoryMerge()",
"constructor": false,
"full_signature": "private boolean canUseMemoryMerge()",
"identifier": "canUseMemoryMerge",
"modifiers": "private",
"parameters": "()",
"return": "boolean",
"signature": "boolean canUseMemoryMerge()",
"testcase": false
},
{
"class_method_signature": "SortImpl.mergeInMemory()",
"constructor": false,
"full_signature": "private SortResults mergeInMemory()",
"identifier": "mergeInMemory",
"modifiers": "private",
"parameters": "()",
"return": "SortResults",
"signature": "SortResults mergeInMemory()",
"testcase": false
},
{
"class_method_signature": "SortImpl.mergeSpilledRuns()",
"constructor": false,
"full_signature": "private SortResults mergeSpilledRuns()",
"identifier": "mergeSpilledRuns",
"modifiers": "private",
"parameters": "()",
"return": "SortResults",
"signature": "SortResults mergeSpilledRuns()",
"testcase": false
},
{
"class_method_signature": "SortImpl.mergeRuns(int targetCount)",
"constructor": false,
"full_signature": "private void mergeRuns(int targetCount)",
"identifier": "mergeRuns",
"modifiers": "private",
"parameters": "(int targetCount)",
"return": "void",
"signature": "void mergeRuns(int targetCount)",
"testcase": false
},
{
"class_method_signature": "SortImpl.close()",
"constructor": false,
"full_signature": "public void close()",
"identifier": "close",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public SortMetrics getMetrics() { return metrics; }",
"class_method_signature": "SortImpl.getMetrics()",
"constructor": false,
"full_signature": "public SortMetrics getMetrics()",
"identifier": "getMetrics",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "SortMetrics",
"signature": "SortMetrics getMetrics()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_6 | {
"fields": [
{
"declarator": "MAX_ALLOCATION = 8 * 1024",
"modifier": "private final static",
"original_string": "private final static int MAX_ALLOCATION = 8 * 1024;",
"type": "int",
"var_name": "MAX_ALLOCATION"
}
],
"file": "exec/memory/base/src/test/java/org/apache/drill/exec/memory/TestBaseAllocator.java",
"identifier": "TestBaseAllocator",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAllocator_manyAllocations() throws Exception {\n try(final RootAllocator rootAllocator =\n new RootAllocator(MAX_ALLOCATION)) {\n try(final BufferAllocator childAllocator =\n rootAllocator.newChildAllocator(\"manyAllocations\", 0, MAX_ALLOCATION)) {\n allocateAndFree(childAllocator);\n }\n }\n }",
"class_method_signature": "TestBaseAllocator.testAllocator_manyAllocations()",
"constructor": false,
"full_signature": "@Test public void testAllocator_manyAllocations()",
"identifier": "testAllocator_manyAllocations",
"invocations": [
"newChildAllocator",
"allocateAndFree"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testAllocator_manyAllocations()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\"",
"modifier": "public static final",
"original_string": "public static final String DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\";",
"type": "String",
"var_name": "DEBUG_ALLOCATOR"
},
{
"declarator": "ID_GENERATOR = new AtomicLong(0)",
"modifier": "@SuppressWarnings(\"unused\")\n private static final",
"original_string": "@SuppressWarnings(\"unused\")\n private static final AtomicLong ID_GENERATOR = new AtomicLong(0);",
"type": "AtomicLong",
"var_name": "ID_GENERATOR"
},
{
"declarator": "CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize()",
"modifier": "private static final",
"original_string": "private static final int CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize();",
"type": "int",
"var_name": "CHUNK_SIZE"
},
{
"declarator": "DEBUG_LOG_LENGTH = 6",
"modifier": "public static final",
"original_string": "public static final int DEBUG_LOG_LENGTH = 6;",
"type": "int",
"var_name": "DEBUG_LOG_LENGTH"
},
{
"declarator": "DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"))",
"modifier": "public static final",
"original_string": "public static final boolean DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"));",
"type": "boolean",
"var_name": "DEBUG"
},
{
"declarator": "IO_BUFFER_SIZE = 32*1024",
"modifier": "private static final",
"original_string": "private static final int IO_BUFFER_SIZE = 32*1024;",
"type": "int",
"var_name": "IO_BUFFER_SIZE"
},
{
"declarator": "DEBUG_LOCK = DEBUG ? new Object() : null",
"modifier": "private final",
"original_string": "private final Object DEBUG_LOCK = DEBUG ? new Object() : null;",
"type": "Object",
"var_name": "DEBUG_LOCK"
},
{
"declarator": "parentAllocator",
"modifier": "private final",
"original_string": "private final BaseAllocator parentAllocator;",
"type": "BaseAllocator",
"var_name": "parentAllocator"
},
{
"declarator": "thisAsByteBufAllocator",
"modifier": "private final",
"original_string": "private final ByteBufAllocator thisAsByteBufAllocator;",
"type": "ByteBufAllocator",
"var_name": "thisAsByteBufAllocator"
},
{
"declarator": "childAllocators",
"modifier": "private final",
"original_string": "private final IdentityHashMap<BaseAllocator, Object> childAllocators;",
"type": "IdentityHashMap<BaseAllocator, Object>",
"var_name": "childAllocators"
},
{
"declarator": "empty",
"modifier": "private final",
"original_string": "private final DrillBuf empty;",
"type": "DrillBuf",
"var_name": "empty"
},
{
"declarator": "isClosed = false",
"modifier": "private volatile",
"original_string": "private volatile boolean isClosed = false;",
"type": "boolean",
"var_name": "isClosed"
},
{
"declarator": "name",
"modifier": "final",
"original_string": "final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "root",
"modifier": "final",
"original_string": "final RootAllocator root;",
"type": "RootAllocator",
"var_name": "root"
},
{
"declarator": "childLedgers",
"modifier": "private final",
"original_string": "private final IdentityHashMap<BufferLedger, Object> childLedgers;",
"type": "IdentityHashMap<BufferLedger, Object>",
"var_name": "childLedgers"
},
{
"declarator": "reservations",
"modifier": "private final",
"original_string": "private final IdentityHashMap<Reservation, Object> reservations;",
"type": "IdentityHashMap<Reservation, Object>",
"var_name": "reservations"
},
{
"declarator": "historicalLog",
"modifier": "private final",
"original_string": "private final HistoricalLog historicalLog;",
"type": "HistoricalLog",
"var_name": "historicalLog"
},
{
"declarator": "ioBuffer[]",
"modifier": "private",
"original_string": "private byte ioBuffer[];",
"type": "byte",
"var_name": "ioBuffer"
}
],
"file": "exec/memory/base/src/main/java/org/apache/drill/exec/memory/BaseAllocator.java",
"identifier": "BaseAllocator",
"interfaces": "implements BufferAllocator",
"methods": [
{
"class_method_signature": "BaseAllocator.BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"constructor": true,
"full_signature": "protected BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"identifier": "BaseAllocator",
"modifiers": "protected",
"parameters": "(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"return": "",
"signature": " BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.assertOpen()",
"constructor": false,
"full_signature": "@Override public void assertOpen()",
"identifier": "assertOpen",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void assertOpen()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getName()",
"constructor": false,
"full_signature": "@Override public String getName()",
"identifier": "getName",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String getName()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getEmpty()",
"constructor": false,
"full_signature": "@Override public DrillBuf getEmpty()",
"identifier": "getEmpty",
"modifiers": "@Override public",
"parameters": "()",
"return": "DrillBuf",
"signature": "DrillBuf getEmpty()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.associateLedger(BufferLedger ledger)",
"constructor": false,
"full_signature": " void associateLedger(BufferLedger ledger)",
"identifier": "associateLedger",
"modifiers": "",
"parameters": "(BufferLedger ledger)",
"return": "void",
"signature": "void associateLedger(BufferLedger ledger)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.dissociateLedger(BufferLedger ledger)",
"constructor": false,
"full_signature": " void dissociateLedger(BufferLedger ledger)",
"identifier": "dissociateLedger",
"modifiers": "",
"parameters": "(BufferLedger ledger)",
"return": "void",
"signature": "void dissociateLedger(BufferLedger ledger)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.childClosed(final BaseAllocator childAllocator)",
"constructor": false,
"full_signature": "private void childClosed(final BaseAllocator childAllocator)",
"identifier": "childClosed",
"modifiers": "private",
"parameters": "(final BaseAllocator childAllocator)",
"return": "void",
"signature": "void childClosed(final BaseAllocator childAllocator)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"constructor": false,
"full_signature": "private static String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"identifier": "createErrorMsg",
"modifiers": "private static",
"parameters": "(final BufferAllocator allocator, final int rounded, final int requested)",
"return": "String",
"signature": "String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize)",
"identifier": "buffer",
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.createEmpty()",
"constructor": false,
"full_signature": "private DrillBuf createEmpty()",
"identifier": "createEmpty",
"modifiers": "private",
"parameters": "()",
"return": "DrillBuf",
"signature": "DrillBuf createEmpty()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.buffer(final int initialRequestSize, BufferManager manager)",
"constructor": false,
"full_signature": "@Override public DrillBuf buffer(final int initialRequestSize, BufferManager manager)",
"identifier": "buffer",
"modifiers": "@Override public",
"parameters": "(final int initialRequestSize, BufferManager manager)",
"return": "DrillBuf",
"signature": "DrillBuf buffer(final int initialRequestSize, BufferManager manager)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.bufferWithoutReservation(final int size, BufferManager bufferManager)",
"constructor": false,
"full_signature": "private DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)",
"identifier": "bufferWithoutReservation",
"modifiers": "private",
"parameters": "(final int size, BufferManager bufferManager)",
"return": "DrillBuf",
"signature": "DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getAsByteBufAllocator()",
"constructor": false,
"full_signature": "@Override public ByteBufAllocator getAsByteBufAllocator()",
"identifier": "getAsByteBufAllocator",
"modifiers": "@Override public",
"parameters": "()",
"return": "ByteBufAllocator",
"signature": "ByteBufAllocator getAsByteBufAllocator()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"constructor": false,
"full_signature": "@Override public BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"identifier": "newChildAllocator",
"modifiers": "@Override public",
"parameters": "(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"return": "BufferAllocator",
"signature": "BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.newReservation()",
"constructor": false,
"full_signature": "@Override public AllocationReservation newReservation()",
"identifier": "newReservation",
"modifiers": "@Override public",
"parameters": "()",
"return": "AllocationReservation",
"signature": "AllocationReservation newReservation()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.close()",
"constructor": false,
"full_signature": "@Override public synchronized void close()",
"identifier": "close",
"modifiers": "@Override public synchronized",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.toVerboseString()",
"constructor": false,
"full_signature": "@Override public String toVerboseString()",
"identifier": "toVerboseString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toVerboseString()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.hist(String noteFormat, Object... args)",
"constructor": false,
"full_signature": "private void hist(String noteFormat, Object... args)",
"identifier": "hist",
"modifiers": "private",
"parameters": "(String noteFormat, Object... args)",
"return": "void",
"signature": "void hist(String noteFormat, Object... args)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.nextPowerOfTwo(int val)",
"constructor": false,
"full_signature": "public static int nextPowerOfTwo(int val)",
"identifier": "nextPowerOfTwo",
"modifiers": "public static",
"parameters": "(int val)",
"return": "int",
"signature": "int nextPowerOfTwo(int val)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.verifyAllocator()",
"constructor": false,
"full_signature": " void verifyAllocator()",
"identifier": "verifyAllocator",
"modifiers": "",
"parameters": "()",
"return": "void",
"signature": "void verifyAllocator()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"constructor": false,
"full_signature": "private void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"identifier": "verifyAllocator",
"modifiers": "private",
"parameters": "(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"return": "void",
"signature": "void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.print(StringBuilder sb, int level, Verbosity verbosity)",
"constructor": false,
"full_signature": " void print(StringBuilder sb, int level, Verbosity verbosity)",
"identifier": "print",
"modifiers": "",
"parameters": "(StringBuilder sb, int level, Verbosity verbosity)",
"return": "void",
"signature": "void print(StringBuilder sb, int level, Verbosity verbosity)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"constructor": false,
"full_signature": "private void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"identifier": "dumpBuffers",
"modifiers": "private",
"parameters": "(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"return": "void",
"signature": "void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.indent(StringBuilder sb, int indent)",
"constructor": false,
"full_signature": "public static StringBuilder indent(StringBuilder sb, int indent)",
"identifier": "indent",
"modifiers": "public static",
"parameters": "(StringBuilder sb, int indent)",
"return": "StringBuilder",
"signature": "StringBuilder indent(StringBuilder sb, int indent)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.isDebug()",
"constructor": false,
"full_signature": "public static boolean isDebug()",
"identifier": "isDebug",
"modifiers": "public static",
"parameters": "()",
"return": "boolean",
"signature": "boolean isDebug()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.getIOBuffer()",
"constructor": false,
"full_signature": "public byte[] getIOBuffer()",
"identifier": "getIOBuffer",
"modifiers": "public",
"parameters": "()",
"return": "byte[]",
"signature": "byte[] getIOBuffer()",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.read(DrillBuf buf, int length, InputStream in)",
"constructor": false,
"full_signature": "@Override public void read(DrillBuf buf, int length, InputStream in)",
"identifier": "read",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, int length, InputStream in)",
"return": "void",
"signature": "void read(DrillBuf buf, int length, InputStream in)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.read(int length, InputStream in)",
"constructor": false,
"full_signature": "public DrillBuf read(int length, InputStream in)",
"identifier": "read",
"modifiers": "public",
"parameters": "(int length, InputStream in)",
"return": "DrillBuf",
"signature": "DrillBuf read(int length, InputStream in)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.write(DrillBuf buf, OutputStream out)",
"constructor": false,
"full_signature": "@Override public void write(DrillBuf buf, OutputStream out)",
"identifier": "write",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, OutputStream out)",
"return": "void",
"signature": "void write(DrillBuf buf, OutputStream out)",
"testcase": false
},
{
"class_method_signature": "BaseAllocator.write(DrillBuf buf, int length, OutputStream out)",
"constructor": false,
"full_signature": "@Override public void write(DrillBuf buf, int length, OutputStream out)",
"identifier": "write",
"modifiers": "@Override public",
"parameters": "(DrillBuf buf, int length, OutputStream out)",
"return": "void",
"signature": "void write(DrillBuf buf, int length, OutputStream out)",
"testcase": false
}
],
"superclass": "extends Accountant"
} | {
"body": "@Override\n public BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation) {\n assertOpen();\n\n final ChildAllocator childAllocator = new ChildAllocator(this, name, initReservation, maxAllocation);\n\n if (DEBUG) {\n synchronized (DEBUG_LOCK) {\n childAllocators.put(childAllocator, childAllocator);\n historicalLog.recordEvent(\"allocator[%s] created new child allocator[%s]\", name, childAllocator.name);\n }\n }\n\n return childAllocator;\n }",
"class_method_signature": "BaseAllocator.newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"constructor": false,
"full_signature": "@Override public BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"identifier": "newChildAllocator",
"invocations": [
"assertOpen",
"put",
"recordEvent"
],
"modifiers": "@Override public",
"parameters": "(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"return": "BufferAllocator",
"signature": "BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_91 | {
"fields": [
{
"declarator": "FULL_PERMISSION = FsPermission.getDirDefault()",
"modifier": "private static final",
"original_string": "private static final FsPermission FULL_PERMISSION = FsPermission.getDirDefault();",
"type": "FsPermission",
"var_name": "FULL_PERMISSION"
},
{
"declarator": "PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false)",
"modifier": "private static final",
"original_string": "private static final StorageStrategy PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false);",
"type": "StorageStrategy",
"var_name": "PERSISTENT_STRATEGY"
},
{
"declarator": "TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true)",
"modifier": "private static final",
"original_string": "private static final StorageStrategy TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true);",
"type": "StorageStrategy",
"var_name": "TEMPORARY_STRATEGY"
},
{
"declarator": "fs",
"modifier": "private static",
"original_string": "private static FileSystem fs;",
"type": "FileSystem",
"var_name": "fs"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/StorageStrategyTest.java",
"identifier": "StorageStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPermissionAndDeleteOnExitFalseForFileOnly() throws Exception {\n Path initialPath = prepareStorageDirectory();\n Path file = addNLevelsAndFile(initialPath, 0, true);\n\n Path createdFile = PERSISTENT_STRATEGY.createFileAndApply(fs, file);\n\n assertEquals(\"Path should match\", file, createdFile);\n checkPathAndPermission(initialPath, file, true, 0, PERSISTENT_STRATEGY);\n checkDeleteOnExit(file, false);\n }",
"class_method_signature": "StorageStrategyTest.testPermissionAndDeleteOnExitFalseForFileOnly()",
"constructor": false,
"full_signature": "@Test public void testPermissionAndDeleteOnExitFalseForFileOnly()",
"identifier": "testPermissionAndDeleteOnExitFalseForFileOnly",
"invocations": [
"prepareStorageDirectory",
"addNLevelsAndFile",
"createFileAndApply",
"assertEquals",
"checkPathAndPermission",
"checkDeleteOnExit"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testPermissionAndDeleteOnExitFalseForFileOnly()",
"testcase": true
} | {
"fields": [
{
"declarator": "DEFAULT = new StorageStrategy(\"002\", false)",
"modifier": "public static final",
"original_string": "public static final StorageStrategy DEFAULT = new StorageStrategy(\"002\", false);",
"type": "StorageStrategy",
"var_name": "DEFAULT"
},
{
"declarator": "TEMPORARY = new StorageStrategy(\"077\", true)",
"modifier": "public static final",
"original_string": "public static final StorageStrategy TEMPORARY = new StorageStrategy(\"077\", true);",
"type": "StorageStrategy",
"var_name": "TEMPORARY"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "umask",
"modifier": "private final",
"original_string": "private final String umask;",
"type": "String",
"var_name": "umask"
},
{
"declarator": "deleteOnExit",
"modifier": "private final",
"original_string": "private final boolean deleteOnExit;",
"type": "boolean",
"var_name": "deleteOnExit"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/StorageStrategy.java",
"identifier": "StorageStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "StorageStrategy.StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"constructor": true,
"full_signature": "@JsonCreator public StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"identifier": "StorageStrategy",
"modifiers": "@JsonCreator public",
"parameters": "(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"return": "",
"signature": " StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getUmask()",
"constructor": false,
"full_signature": "public String getUmask()",
"identifier": "getUmask",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getUmask()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.isDeleteOnExit()",
"constructor": false,
"full_signature": "public boolean isDeleteOnExit()",
"identifier": "isDeleteOnExit",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isDeleteOnExit()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getFolderPermission()",
"constructor": false,
"full_signature": "@JsonIgnore public FsPermission getFolderPermission()",
"identifier": "getFolderPermission",
"modifiers": "@JsonIgnore public",
"parameters": "()",
"return": "FsPermission",
"signature": "FsPermission getFolderPermission()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getFilePermission()",
"constructor": false,
"full_signature": "@JsonIgnore public FsPermission getFilePermission()",
"identifier": "getFilePermission",
"modifiers": "@JsonIgnore public",
"parameters": "()",
"return": "FsPermission",
"signature": "FsPermission getFilePermission()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.createPathAndApply(FileSystem fs, Path path)",
"constructor": false,
"full_signature": "public Path createPathAndApply(FileSystem fs, Path path)",
"identifier": "createPathAndApply",
"modifiers": "public",
"parameters": "(FileSystem fs, Path path)",
"return": "Path",
"signature": "Path createPathAndApply(FileSystem fs, Path path)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public Path createFileAndApply(FileSystem fs, Path file)",
"identifier": "createFileAndApply",
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "Path",
"signature": "Path createFileAndApply(FileSystem fs, Path file)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.applyToFile(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public void applyToFile(FileSystem fs, Path file)",
"identifier": "applyToFile",
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "void",
"signature": "void applyToFile(FileSystem fs, Path file)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.validateUmask(String umask)",
"constructor": false,
"full_signature": "private String validateUmask(String umask)",
"identifier": "validateUmask",
"modifiers": "private",
"parameters": "(String umask)",
"return": "String",
"signature": "String validateUmask(String umask)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getNonExistentLocations(FileSystem fs, Path path)",
"constructor": false,
"full_signature": "private List<Path> getNonExistentLocations(FileSystem fs, Path path)",
"identifier": "getNonExistentLocations",
"modifiers": "private",
"parameters": "(FileSystem fs, Path path)",
"return": "List<Path>",
"signature": "List<Path> getNonExistentLocations(FileSystem fs, Path path)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"constructor": false,
"full_signature": "private void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"identifier": "applyStrategy",
"modifiers": "private",
"parameters": "(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"return": "void",
"signature": "void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Path createFileAndApply(FileSystem fs, Path file) throws IOException {\n List<Path> locations = getNonExistentLocations(fs, file.getParent());\n if (!fs.createNewFile(file)) {\n throw new IOException(String.format(\"File [%s] already exists on file system [%s].\",\n file.toUri().getPath(), fs.getUri()));\n }\n applyToFile(fs, file);\n\n if (locations.isEmpty()) {\n return file;\n }\n\n for (Path location : locations) {\n applyStrategy(fs, location, getFolderPermission(), deleteOnExit);\n }\n return locations.get(locations.size() - 1);\n }",
"class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public Path createFileAndApply(FileSystem fs, Path file)",
"identifier": "createFileAndApply",
"invocations": [
"getNonExistentLocations",
"getParent",
"createNewFile",
"format",
"getPath",
"toUri",
"getUri",
"applyToFile",
"isEmpty",
"applyStrategy",
"getFolderPermission",
"get",
"size"
],
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "Path",
"signature": "Path createFileAndApply(FileSystem fs, Path file)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_29 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListAllRecursiveWithFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listAll(fs, new Path(base, \"a\"), true, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\"a\") || path.getName().endsWith(\".txt\");\n }\n });\n assertEquals(\"Directory and file count should match\", 7, statuses.size());\n }",
"class_method_signature": "FileSystemUtilTest.testListAllRecursiveWithFilter()",
"constructor": false,
"full_signature": "@Test public void testListAllRecursiveWithFilter()",
"identifier": "testListAllRecursiveWithFilter",
"invocations": [
"listAll",
"endsWith",
"getName",
"endsWith",
"getName",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListAllRecursiveWithFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listAll(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }",
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"invocations": [
"listAll",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_87 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/easy/text/compliant/TestHeaderBuilder.java",
"identifier": "TestHeaderBuilder",
"interfaces": "",
"superclass": "extends DrillTest"
} | {
"body": "@Test\n public void testSyntax() {\n HeaderBuilder hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"a_123\");\n validateHeader(hb, new String[] {\"a_123\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"a_123_\");\n validateHeader(hb, new String[] {\"a_123_\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"az09_\");\n validateHeader(hb, new String[] {\"az09_\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"+\");\n validateHeader(hb, new String[] {\"column_1\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"+,-\");\n validateHeader(hb, new String[] {\"column_1\", \"column_2\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"+9a\");\n validateHeader(hb, new String[] {\"col_9a\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"9a\");\n validateHeader(hb, new String[] {\"col_9a\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"a+b\");\n validateHeader(hb, new String[] {\"a_b\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"a_b\");\n validateHeader(hb, new String[] {\"a_b\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"EXPR$0\");\n validateHeader(hb, new String[] {\"EXPR_0\"});\n\n hb = new HeaderBuilder();\n hb.startBatch();\n parse(hb,\"(_-^-_)\");\n validateHeader(hb, new String[] {\"col_______\"});\n }",
"class_method_signature": "TestHeaderBuilder.testSyntax()",
"constructor": false,
"full_signature": "@Test public void testSyntax()",
"identifier": "testSyntax",
"invocations": [
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader",
"startBatch",
"parse",
"validateHeader"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSyntax()",
"testcase": true
} | {
"fields": [
{
"declarator": "MAX_HEADER_LEN = 1024",
"modifier": "public static final",
"original_string": "public static final int MAX_HEADER_LEN = 1024;",
"type": "int",
"var_name": "MAX_HEADER_LEN"
},
{
"declarator": "COLUMN_PREFIX = \"col_\"",
"modifier": "public static final",
"original_string": "public static final String COLUMN_PREFIX = \"col_\";",
"type": "String",
"var_name": "COLUMN_PREFIX"
},
{
"declarator": "ANONYMOUS_COLUMN_PREFIX = \"column_\"",
"modifier": "public static final",
"original_string": "public static final String ANONYMOUS_COLUMN_PREFIX = \"column_\";",
"type": "String",
"var_name": "ANONYMOUS_COLUMN_PREFIX"
},
{
"declarator": "headers = new ArrayList<>()",
"modifier": "public final",
"original_string": "public final List<String> headers = new ArrayList<>();",
"type": "List<String>",
"var_name": "headers"
},
{
"declarator": "currentField = ByteBuffer.allocate(MAX_HEADER_LEN)",
"modifier": "public final",
"original_string": "public final ByteBuffer currentField = ByteBuffer.allocate(MAX_HEADER_LEN);",
"type": "ByteBuffer",
"var_name": "currentField"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/text/compliant/HeaderBuilder.java",
"identifier": "HeaderBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "HeaderBuilder.startField(int index)",
"constructor": false,
"full_signature": "@Override public void startField(int index)",
"identifier": "startField",
"modifiers": "@Override public",
"parameters": "(int index)",
"return": "void",
"signature": "void startField(int index)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.endField()",
"constructor": false,
"full_signature": "@Override public boolean endField()",
"identifier": "endField",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean endField()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.endEmptyField()",
"constructor": false,
"full_signature": "@Override public boolean endEmptyField()",
"identifier": "endEmptyField",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean endEmptyField()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.validateSymbol(String header)",
"constructor": false,
"full_signature": "private String validateSymbol(String header)",
"identifier": "validateSymbol",
"modifiers": "private",
"parameters": "(String header)",
"return": "String",
"signature": "String validateSymbol(String header)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.rewriteHeader(String header)",
"constructor": false,
"full_signature": "private String rewriteHeader(String header)",
"identifier": "rewriteHeader",
"modifiers": "private",
"parameters": "(String header)",
"return": "String",
"signature": "String rewriteHeader(String header)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.append(byte data)",
"constructor": false,
"full_signature": "@Override public void append(byte data)",
"identifier": "append",
"modifiers": "@Override public",
"parameters": "(byte data)",
"return": "void",
"signature": "void append(byte data)",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.finishRecord()",
"constructor": false,
"full_signature": "@Override public void finishRecord()",
"identifier": "finishRecord",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void finishRecord()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.getRecordCount()",
"constructor": false,
"full_signature": "@Override public long getRecordCount()",
"identifier": "getRecordCount",
"modifiers": "@Override public",
"parameters": "()",
"return": "long",
"signature": "long getRecordCount()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.startBatch()",
"constructor": false,
"full_signature": "@Override public void startBatch()",
"identifier": "startBatch",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void startBatch()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.finishBatch()",
"constructor": false,
"full_signature": "@Override public void finishBatch()",
"identifier": "finishBatch",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void finishBatch()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.rowHasData()",
"constructor": false,
"full_signature": "@Override public boolean rowHasData()",
"identifier": "rowHasData",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean rowHasData()",
"testcase": false
},
{
"class_method_signature": "HeaderBuilder.getHeaders()",
"constructor": false,
"full_signature": "public String[] getHeaders()",
"identifier": "getHeaders",
"modifiers": "public",
"parameters": "()",
"return": "String[]",
"signature": "String[] getHeaders()",
"testcase": false
}
],
"superclass": "extends TextOutput"
} | {
"body": "@Override\n public void startBatch() { }",
"class_method_signature": "HeaderBuilder.startBatch()",
"constructor": false,
"full_signature": "@Override public void startBatch()",
"identifier": "startBatch",
"invocations": [],
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void startBatch()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_13 | {
"fields": [
{
"declarator": "N1_EP1 = newDrillbitEndpoint(\"node1\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP1 = newDrillbitEndpoint(\"node1\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP1"
},
{
"declarator": "N1_EP2 = newDrillbitEndpoint(\"node1\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP2 = newDrillbitEndpoint(\"node1\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP2"
},
{
"declarator": "N2_EP1 = newDrillbitEndpoint(\"node2\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP1 = newDrillbitEndpoint(\"node2\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP1"
},
{
"declarator": "N2_EP2 = newDrillbitEndpoint(\"node2\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP2 = newDrillbitEndpoint(\"node2\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP2"
},
{
"declarator": "N3_EP1 = newDrillbitEndpoint(\"node3\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP1 = newDrillbitEndpoint(\"node3\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP1"
},
{
"declarator": "N3_EP2 = newDrillbitEndpoint(\"node3\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP2 = newDrillbitEndpoint(\"node3\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP2"
},
{
"declarator": "N4_EP2 = newDrillbitEndpoint(\"node4\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N4_EP2 = newDrillbitEndpoint(\"node4\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N4_EP2"
},
{
"declarator": "fragment",
"modifier": "@Mocked private",
"original_string": "@Mocked private Fragment fragment;",
"type": "Fragment",
"var_name": "fragment"
},
{
"declarator": "root",
"modifier": "@Mocked private",
"original_string": "@Mocked private PhysicalOperator root;",
"type": "PhysicalOperator",
"var_name": "root"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/planner/fragment/TestHardAffinityFragmentParallelizer.java",
"identifier": "TestHardAffinityFragmentParallelizer",
"interfaces": "",
"superclass": ""
} | {
"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, MAX_VALUE),\n new EndpointAffinity(N2_EP2, 0.15, true, MAX_VALUE),\n new EndpointAffinity(N3_EP1, 0.10, true, MAX_VALUE),\n new EndpointAffinity(N4_EP2, 0.20, true, MAX_VALUE),\n new EndpointAffinity(N1_EP1, 0.20, true, MAX_VALUE)\n ));\n INSTANCE.parallelizeFragment(wrapper, newParameters(1, 5, 20), null);\n\n // Expect the fragment parallelization to be 20 because:\n // 1. the cost (200) is above the threshold (SLICE_TARGET_DEFAULT) (which gives 200/1=200 width) and\n // 2. Number of mandatory node assignments are 5 (current width 200 satisfies the requirement)\n // 3. max fragment width is 20 which limits the width\n assertEquals(20, wrapper.getWidth());\n\n final List<DrillbitEndpoint> assignedEps = wrapper.getAssignedEndpoints();\n assertEquals(20, assignedEps.size());\n final HashMultiset<DrillbitEndpoint> counts = HashMultiset.create();\n for(final DrillbitEndpoint ep : assignedEps) {\n counts.add(ep);\n }\n // Each node gets at max 5.\n assertTrue(counts.count(N1_EP2) <= 5);\n assertTrue(counts.count(N2_EP2) <= 5);\n assertTrue(counts.count(N3_EP1) <= 5);\n assertTrue(counts.count(N4_EP2) <= 5);\n assertTrue(counts.count(N1_EP1) <= 5);\n }",
"class_method_signature": "TestHardAffinityFragmentParallelizer.multiNodeCluster2()",
"constructor": false,
"full_signature": "@Test public void multiNodeCluster2()",
"identifier": "multiNodeCluster2",
"invocations": [
"newWrapper",
"of",
"parallelizeFragment",
"newParameters",
"assertEquals",
"getWidth",
"getAssignedEndpoints",
"assertEquals",
"size",
"create",
"add",
"assertTrue",
"count",
"assertTrue",
"count",
"assertTrue",
"count",
"assertTrue",
"count",
"assertTrue",
"count"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void multiNodeCluster2()",
"testcase": true
} | {
"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);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "INSTANCE = new HardAffinityFragmentParallelizer()",
"modifier": "public static final",
"original_string": "public static final HardAffinityFragmentParallelizer INSTANCE = new HardAffinityFragmentParallelizer();",
"type": "HardAffinityFragmentParallelizer",
"var_name": "INSTANCE"
},
{
"declarator": "EOL = System.getProperty(\"line.separator\")",
"modifier": "private static",
"original_string": "private static String EOL = System.getProperty(\"line.separator\");",
"type": "String",
"var_name": "EOL"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/HardAffinityFragmentParallelizer.java",
"identifier": "HardAffinityFragmentParallelizer",
"interfaces": "implements FragmentParallelizer",
"methods": [
{
"class_method_signature": "HardAffinityFragmentParallelizer.HardAffinityFragmentParallelizer()",
"constructor": true,
"full_signature": "private HardAffinityFragmentParallelizer()",
"identifier": "HardAffinityFragmentParallelizer",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HardAffinityFragmentParallelizer()",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"constructor": false,
"full_signature": "private static void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"identifier": "checkOrThrow",
"modifiers": "private static",
"parameters": "(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"return": "void",
"signature": "void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints) throws PhysicalOperatorSetupException {\n\n final Stats stats = fragmentWrapper.getStats();\n final ParallelizationInfo pInfo = stats.getParallelizationInfo();\n\n int totalMaxWidth = 0;\n\n // Go through the affinity map and extract the endpoints that have mandatory assignment requirement\n final Map<DrillbitEndpoint, EndpointAffinity> endpointPool = Maps.newHashMap();\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : pInfo.getEndpointAffinityMap().entrySet()) {\n if (entry.getValue().isAssignmentRequired()) {\n endpointPool.put(entry.getKey(), entry.getValue());\n\n // Limit the max width of the endpoint to allowed max width.\n totalMaxWidth += Math.min(parameters.getMaxWidthPerNode(), entry.getValue().getMaxWidth());\n if (totalMaxWidth < 0) {\n // If the totalWidth overflows, just keep it at the max value.\n totalMaxWidth = Integer.MAX_VALUE;\n }\n }\n }\n\n // Step 1: Find the width taking into various parameters\n // 1.1. Find the parallelization based on cost. Use max cost of all operators in this fragment; this is consistent\n // with the calculation that ExcessiveExchangeRemover uses.\n int width = (int) Math.ceil(stats.getMaxCost() / parameters.getSliceTarget());\n\n // 1.2. Make sure the width is at least the number of endpoints that require an assignment\n width = Math.max(endpointPool.size(), width);\n\n // 1.3. Cap the parallelization width by fragment level width limit and system level per query width limit\n width = Math.max(1, Math.min(width, pInfo.getMaxWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed fragment max \" +\n \"width ({}).\", endpointPool.size(), pInfo.getMaxWidth());\n\n // 1.4 Cap the parallelization width by global max query width\n width = Math.max(1, Math.min(width, parameters.getMaxGlobalWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed global query \" +\n \"width ({}).\", endpointPool.size(), parameters.getMaxGlobalWidth());\n\n // 1.5 Cap the parallelization width by max allowed parallelization per node\n width = Math.max(1, Math.min(width, endpointPool.size()*parameters.getMaxWidthPerNode()));\n\n // 1.6 Cap the parallelization width by total of max allowed width per node. The reason is if we the width is more,\n // we end up allocating more work units to one or more endpoints that don't have those many work units.\n width = Math.min(totalMaxWidth, width);\n\n // Step 2: Select the endpoints\n final Map<DrillbitEndpoint, Integer> endpoints = Maps.newHashMap();\n\n // 2.1 First add each endpoint from the pool once so that the mandatory assignment requirement is fulfilled.\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : endpointPool.entrySet()) {\n endpoints.put(entry.getKey(), 1);\n }\n int totalAssigned = endpoints.size();\n\n // 2.2 Assign the remaining slots to endpoints proportional to the affinity of each endpoint\n int remainingSlots = width - endpoints.size();\n while (remainingSlots > 0) {\n for(EndpointAffinity epAf : endpointPool.values()) {\n final int moreAllocation = (int) Math.ceil(epAf.getAffinity() * remainingSlots);\n int currentAssignments = endpoints.get(epAf.getEndpoint());\n for(int i=0;\n i < moreAllocation &&\n totalAssigned < width &&\n currentAssignments < parameters.getMaxWidthPerNode() &&\n currentAssignments < epAf.getMaxWidth();\n i++) {\n totalAssigned++;\n currentAssignments++;\n }\n endpoints.put(epAf.getEndpoint(), currentAssignments);\n }\n final int previousRemainingSlots = remainingSlots;\n remainingSlots = width - totalAssigned;\n if (previousRemainingSlots == remainingSlots) {\n logger.error(\"Can't parallelize fragment: \" +\n \"Every mandatory node has exhausted the maximum width per node limit.\" + EOL +\n \"Endpoint pool: {}\" + EOL + \"Assignment so far: {}\" + EOL + \"Width: {}\", endpointPool, endpoints, width);\n throw new PhysicalOperatorSetupException(\"Can not parallelize fragment.\");\n }\n }\n\n final List<DrillbitEndpoint> assignedEndpoints = Lists.newArrayList();\n for(Entry<DrillbitEndpoint, Integer> entry : endpoints.entrySet()) {\n for(int i=0; i < entry.getValue(); i++) {\n assignedEndpoints.add(entry.getKey());\n }\n }\n\n fragmentWrapper.setWidth(width);\n fragmentWrapper.assignEndpoints(assignedEndpoints);\n }",
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"invocations": [
"getStats",
"getParallelizationInfo",
"newHashMap",
"entrySet",
"getEndpointAffinityMap",
"isAssignmentRequired",
"getValue",
"put",
"getKey",
"getValue",
"min",
"getMaxWidthPerNode",
"getMaxWidth",
"getValue",
"ceil",
"getMaxCost",
"getSliceTarget",
"max",
"size",
"max",
"min",
"getMaxWidth",
"checkOrThrow",
"size",
"size",
"getMaxWidth",
"max",
"min",
"getMaxGlobalWidth",
"checkOrThrow",
"size",
"size",
"getMaxGlobalWidth",
"max",
"min",
"size",
"getMaxWidthPerNode",
"min",
"newHashMap",
"entrySet",
"put",
"getKey",
"size",
"size",
"values",
"ceil",
"getAffinity",
"get",
"getEndpoint",
"getMaxWidthPerNode",
"getMaxWidth",
"put",
"getEndpoint",
"error",
"newArrayList",
"entrySet",
"getValue",
"add",
"getKey",
"setWidth",
"assignEndpoints"
],
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_44 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java",
"identifier": "DrillFileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListAllRecursiveWithoutFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listAll(fs, base, true);\n assertEquals(\"Directory and file count should match\", 6, statuses.size());\n }",
"class_method_signature": "DrillFileSystemUtilTest.testListAllRecursiveWithoutFilter()",
"constructor": false,
"full_signature": "@Test public void testListAllRecursiveWithoutFilter()",
"identifier": "testListAllRecursiveWithoutFilter",
"invocations": [
"listAll",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListAllRecursiveWithoutFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };",
"type": "PathFilter",
"var_name": "DRILL_SYSTEM_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java",
"identifier": "DrillFileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listAll(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }",
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"invocations": [
"listAll",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_52 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/work/metadata/TestMetadataProvider.java",
"identifier": "TestMetadataProvider",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void columns() throws Exception {\n // test(\"SELECT * FROM INFORMATION_SCHEMA.COLUMNS\"); // SQL equivalent\n\n GetColumnsResp resp = client.getColumns(null, null, null, null).get();\n\n assertEquals(RequestStatus.OK, resp.getStatus());\n List<ColumnMetadata> columns = resp.getColumnsList();\n assertEquals(76, columns.size());\n // too many records to verify the output.\n }",
"class_method_signature": "TestMetadataProvider.columns()",
"constructor": false,
"full_signature": "@Test public void columns()",
"identifier": "columns",
"invocations": [
"get",
"getColumns",
"assertEquals",
"getStatus",
"getColumnsList",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void columns()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(MetadataProvider.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(MetadataProvider.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "IN_FUNCTION = \"in\"",
"modifier": "private static final",
"original_string": "private static final String IN_FUNCTION = \"in\";",
"type": "String",
"var_name": "IN_FUNCTION"
},
{
"declarator": "LIKE_FUNCTION = \"like\"",
"modifier": "private static final",
"original_string": "private static final String LIKE_FUNCTION = \"like\";",
"type": "String",
"var_name": "LIKE_FUNCTION"
},
{
"declarator": "AND_FUNCTION = \"booleanand\"",
"modifier": "private static final",
"original_string": "private static final String AND_FUNCTION = \"booleanand\";",
"type": "String",
"var_name": "AND_FUNCTION"
},
{
"declarator": "OR_FUNCTION = \"booleanor\"",
"modifier": "private static final",
"original_string": "private static final String OR_FUNCTION = \"booleanor\";",
"type": "String",
"var_name": "OR_FUNCTION"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/work/metadata/MetadataProvider.java",
"identifier": "MetadataProvider",
"interfaces": "",
"methods": [
{
"class_method_signature": "MetadataProvider.catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"identifier": "catalogs",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable catalogs(final UserSession session, final DrillbitContext dContext,\n final GetCatalogsReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"identifier": "schemas",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable schemas(final UserSession session, final DrillbitContext dContext,\n final GetSchemasReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"identifier": "tables",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable tables(final UserSession session, final DrillbitContext dContext,\n final GetTablesReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"identifier": "columns",
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"constructor": false,
"full_signature": "private static InfoSchemaFilter createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"identifier": "createInfoSchemaFilter",
"modifiers": "private static",
"parameters": "(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"return": "InfoSchemaFilter",
"signature": "InfoSchemaFilter createInfoSchemaFilter(final LikeFilter catalogNameFilter,\n final LikeFilter schemaNameFilter, final LikeFilter tableNameFilter, List<String> tableTypeFilter, final LikeFilter columnNameFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"constructor": false,
"full_signature": "private static FunctionExprNode createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"identifier": "createLikeFunctionExprNode",
"modifiers": "private static",
"parameters": "(String fieldName, LikeFilter likeFilter)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode createLikeFunctionExprNode(String fieldName, LikeFilter likeFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"constructor": false,
"full_signature": "private static FunctionExprNode createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"identifier": "createInFunctionExprNode",
"modifiers": "private static",
"parameters": "(String fieldName, List<String> valuesFilter)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode createInFunctionExprNode(String fieldName, List<String> valuesFilter)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"constructor": false,
"full_signature": "private static FunctionExprNode combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"identifier": "combineFunctions",
"modifiers": "private static",
"parameters": "(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"return": "FunctionExprNode",
"signature": "FunctionExprNode combineFunctions(final String functionName,\n final FunctionExprNode func1, final FunctionExprNode func2)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"constructor": false,
"full_signature": "private static PojoRecordReader<S> getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"identifier": "getPojoRecordReader",
"modifiers": "private static",
"parameters": "(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"return": "PojoRecordReader<S>",
"signature": "PojoRecordReader<S> getPojoRecordReader(final InfoSchemaTableType tableType, final InfoSchemaFilter filter, final DrillConfig config,\n final SchemaTreeProvider provider, final UserSession userSession)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"constructor": false,
"full_signature": "private static SchemaConfigInfoProvider newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"identifier": "newSchemaConfigInfoProvider",
"modifiers": "private static",
"parameters": "(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"return": "SchemaConfigInfoProvider",
"signature": "SchemaConfigInfoProvider newSchemaConfigInfoProvider(final DrillConfig config, final UserSession session, final SchemaTreeProvider schemaTreeProvider)",
"testcase": false
},
{
"class_method_signature": "MetadataProvider.createPBError(final String failedFunction, final Throwable ex)",
"constructor": false,
"full_signature": "static DrillPBError createPBError(final String failedFunction, final Throwable ex)",
"identifier": "createPBError",
"modifiers": "static",
"parameters": "(final String failedFunction, final Throwable ex)",
"return": "DrillPBError",
"signature": "DrillPBError createPBError(final String failedFunction, final Throwable ex)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Runnable columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender) {\n return new ColumnsProvider(session, dContext, req, responseSender);\n }",
"class_method_signature": "MetadataProvider.columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"constructor": false,
"full_signature": "public static Runnable columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"identifier": "columns",
"invocations": [],
"modifiers": "public static",
"parameters": "(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"return": "Runnable",
"signature": "Runnable columns(final UserSession session, final DrillbitContext dContext,\n final GetColumnsReq req, final ResponseSender responseSender)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_1 | {
"fields": [],
"file": "exec/memory/base/src/test/java/org/apache/drill/exec/memory/TestAccountant.java",
"identifier": "TestAccountant",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void nested() {\n final Accountant parent = new Accountant(null, 0, Long.MAX_VALUE);\n ensureAccurateReservations(parent);\n assertEquals(0, parent.getAllocatedMemory());\n }",
"class_method_signature": "TestAccountant.nested()",
"constructor": false,
"full_signature": "@Test public void nested()",
"identifier": "nested",
"invocations": [
"ensureAccurateReservations",
"assertEquals",
"getAllocatedMemory"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void nested()",
"testcase": true
} | {
"fields": [
{
"declarator": "parent",
"modifier": "protected final",
"original_string": "protected final Accountant parent;",
"type": "Accountant",
"var_name": "parent"
},
{
"declarator": "reservation",
"modifier": "protected final",
"original_string": "protected final long reservation;",
"type": "long",
"var_name": "reservation"
},
{
"declarator": "peakAllocation = new AtomicLong()",
"modifier": "private final",
"original_string": "private final AtomicLong peakAllocation = new AtomicLong();",
"type": "AtomicLong",
"var_name": "peakAllocation"
},
{
"declarator": "allocationLimit = new AtomicLong()",
"modifier": "private final",
"original_string": "private final AtomicLong allocationLimit = new AtomicLong();",
"type": "AtomicLong",
"var_name": "allocationLimit"
},
{
"declarator": "locallyHeldMemory = new AtomicLong()",
"modifier": "private final",
"original_string": "private final AtomicLong locallyHeldMemory = new AtomicLong();",
"type": "AtomicLong",
"var_name": "locallyHeldMemory"
}
],
"file": "exec/memory/base/src/main/java/org/apache/drill/exec/memory/Accountant.java",
"identifier": "Accountant",
"interfaces": "implements AutoCloseable",
"methods": [
{
"class_method_signature": "Accountant.Accountant(Accountant parent, long reservation, long maxAllocation)",
"constructor": true,
"full_signature": "public Accountant(Accountant parent, long reservation, long maxAllocation)",
"identifier": "Accountant",
"modifiers": "public",
"parameters": "(Accountant parent, long reservation, long maxAllocation)",
"return": "",
"signature": " Accountant(Accountant parent, long reservation, long maxAllocation)",
"testcase": false
},
{
"class_method_signature": "Accountant.allocateBytes(long size)",
"constructor": false,
"full_signature": " AllocationOutcome allocateBytes(long size)",
"identifier": "allocateBytes",
"modifiers": "",
"parameters": "(long size)",
"return": "AllocationOutcome",
"signature": "AllocationOutcome allocateBytes(long size)",
"testcase": false
},
{
"class_method_signature": "Accountant.updatePeak()",
"constructor": false,
"full_signature": "private void updatePeak()",
"identifier": "updatePeak",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void updatePeak()",
"testcase": false
},
{
"class_method_signature": "Accountant.forceAllocate(long size)",
"constructor": false,
"full_signature": " boolean forceAllocate(long size)",
"identifier": "forceAllocate",
"modifiers": "",
"parameters": "(long size)",
"return": "boolean",
"signature": "boolean forceAllocate(long size)",
"testcase": false
},
{
"class_method_signature": "Accountant.allocate(final long size, final boolean incomingUpdatePeak, final boolean forceAllocation)",
"constructor": false,
"full_signature": "private AllocationOutcome allocate(final long size, final boolean incomingUpdatePeak, final boolean forceAllocation)",
"identifier": "allocate",
"modifiers": "private",
"parameters": "(final long size, final boolean incomingUpdatePeak, final boolean forceAllocation)",
"return": "AllocationOutcome",
"signature": "AllocationOutcome allocate(final long size, final boolean incomingUpdatePeak, final boolean forceAllocation)",
"testcase": false
},
{
"class_method_signature": "Accountant.releaseBytes(long size)",
"constructor": false,
"full_signature": "public void releaseBytes(long size)",
"identifier": "releaseBytes",
"modifiers": "public",
"parameters": "(long size)",
"return": "void",
"signature": "void releaseBytes(long size)",
"testcase": false
},
{
"class_method_signature": "Accountant.setLimit(long newLimit)",
"constructor": false,
"full_signature": "public void setLimit(long newLimit)",
"identifier": "setLimit",
"modifiers": "public",
"parameters": "(long newLimit)",
"return": "void",
"signature": "void setLimit(long newLimit)",
"testcase": false
},
{
"class_method_signature": "Accountant.isOverLimit()",
"constructor": false,
"full_signature": "public boolean isOverLimit()",
"identifier": "isOverLimit",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isOverLimit()",
"testcase": false
},
{
"class_method_signature": "Accountant.close()",
"constructor": false,
"full_signature": "public void close()",
"identifier": "close",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "Accountant.getLimit()",
"constructor": false,
"full_signature": "public long getLimit()",
"identifier": "getLimit",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getLimit()",
"testcase": false
},
{
"class_method_signature": "Accountant.getAllocatedMemory()",
"constructor": false,
"full_signature": "public long getAllocatedMemory()",
"identifier": "getAllocatedMemory",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getAllocatedMemory()",
"testcase": false
},
{
"class_method_signature": "Accountant.getPeakMemoryAllocation()",
"constructor": false,
"full_signature": "public long getPeakMemoryAllocation()",
"identifier": "getPeakMemoryAllocation",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getPeakMemoryAllocation()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public long getAllocatedMemory() {\n return locallyHeldMemory.get();\n }",
"class_method_signature": "Accountant.getAllocatedMemory()",
"constructor": false,
"full_signature": "public long getAllocatedMemory()",
"identifier": "getAllocatedMemory",
"invocations": [
"get"
],
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getAllocatedMemory()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_59 | {
"fields": [
{
"declarator": "built_in = \"built-in\"",
"modifier": "private static final",
"original_string": "private static final String built_in = \"built-in\";",
"type": "String",
"var_name": "built_in"
},
{
"declarator": "udf_jar = \"DrillUDF-1.0.jar\"",
"modifier": "private static final",
"original_string": "private static final String udf_jar = \"DrillUDF-1.0.jar\";",
"type": "String",
"var_name": "udf_jar"
},
{
"declarator": "newJars",
"modifier": "private static",
"original_string": "private static Map<String, List<FunctionHolder>> newJars;",
"type": "Map<String, List<FunctionHolder>>",
"var_name": "newJars"
},
{
"declarator": "registryHolder",
"modifier": "private",
"original_string": "private FunctionRegistryHolder registryHolder;",
"type": "FunctionRegistryHolder",
"var_name": "registryHolder"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolderTest.java",
"identifier": "FunctionRegistryHolderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetAllJarNames() {\n ArrayList<String> expectedResult = Lists.newArrayList(newJars.keySet());\n compareTwoLists(expectedResult, registryHolder.getAllJarNames());\n }",
"class_method_signature": "FunctionRegistryHolderTest.testGetAllJarNames()",
"constructor": false,
"full_signature": "@Test public void testGetAllJarNames()",
"identifier": "testGetAllJarNames",
"invocations": [
"newArrayList",
"keySet",
"compareTwoLists",
"getAllJarNames"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetAllJarNames()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "readWriteLock = new ReentrantReadWriteLock()",
"modifier": "private final",
"original_string": "private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();",
"type": "ReadWriteLock",
"var_name": "readWriteLock"
},
{
"declarator": "readLock = new AutoCloseableLock(readWriteLock.readLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock());",
"type": "AutoCloseableLock",
"var_name": "readLock"
},
{
"declarator": "writeLock = new AutoCloseableLock(readWriteLock.writeLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock());",
"type": "AutoCloseableLock",
"var_name": "writeLock"
},
{
"declarator": "version",
"modifier": "private",
"original_string": "private long version;",
"type": "long",
"var_name": "version"
},
{
"declarator": "jars",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, Queue<String>>> jars;",
"type": "Map<String, Map<String, Queue<String>>>",
"var_name": "jars"
},
{
"declarator": "functions",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, DrillFuncHolder>> functions;",
"type": "Map<String, Map<String, DrillFuncHolder>>",
"var_name": "functions"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolder.java",
"identifier": "FunctionRegistryHolder",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionRegistryHolder.FunctionRegistryHolder()",
"constructor": true,
"full_signature": "public FunctionRegistryHolder()",
"identifier": "FunctionRegistryHolder",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " FunctionRegistryHolder()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getVersion()",
"constructor": false,
"full_signature": "public long getVersion()",
"identifier": "getVersion",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getVersion()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"constructor": false,
"full_signature": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"identifier": "addJars",
"modifiers": "public",
"parameters": "(Map<String, List<FunctionHolder>> newJars, long version)",
"return": "void",
"signature": "void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeJar(String jarName)",
"constructor": false,
"full_signature": "public void removeJar(String jarName)",
"identifier": "removeJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllJarNames()",
"constructor": false,
"full_signature": "public List<String> getAllJarNames()",
"identifier": "getAllJarNames",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getAllJarNames()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getFunctionNamesByJar(String jarName)",
"constructor": false,
"full_signature": "public List<String> getFunctionNamesByJar(String jarName)",
"identifier": "getFunctionNamesByJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "List<String>",
"signature": "List<String> getFunctionNamesByJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders(AtomicLong version)",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "(AtomicLong version)",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders()",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithSignatures()",
"constructor": false,
"full_signature": "public ListMultimap<String, String> getAllFunctionsWithSignatures()",
"identifier": "getAllFunctionsWithSignatures",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, String>",
"signature": "ListMultimap<String, String> getAllFunctionsWithSignatures()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName, AtomicLong version)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName, AtomicLong version)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.containsJar(String jarName)",
"constructor": false,
"full_signature": "public boolean containsJar(String jarName)",
"identifier": "containsJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "boolean",
"signature": "boolean containsJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.functionsSize()",
"constructor": false,
"full_signature": "public int functionsSize()",
"identifier": "functionsSize",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int functionsSize()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getJarNameByFunctionSignature(String functionName, String functionSignature)",
"constructor": false,
"full_signature": "public String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"identifier": "getJarNameByFunctionSignature",
"modifiers": "public",
"parameters": "(String functionName, String functionSignature)",
"return": "String",
"signature": "String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"constructor": false,
"full_signature": "private void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"identifier": "addFunctions",
"modifiers": "private",
"parameters": "(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"return": "void",
"signature": "void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeAllByJar(String jarName)",
"constructor": false,
"full_signature": "private void removeAllByJar(String jarName)",
"identifier": "removeAllByJar",
"modifiers": "private",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeAllByJar(String jarName)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public List<String> getAllJarNames() {\n try (AutoCloseableLock lock = readLock.open()) {\n return Lists.newArrayList(jars.keySet());\n }\n }",
"class_method_signature": "FunctionRegistryHolder.getAllJarNames()",
"constructor": false,
"full_signature": "public List<String> getAllJarNames()",
"identifier": "getAllJarNames",
"invocations": [
"open",
"newArrayList",
"keySet"
],
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getAllJarNames()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_18 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListDirectoriesRecursiveWithoutFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listDirectories(fs, base, true);\n assertEquals(\"Directory count should match\", 5, statuses.size());\n }",
"class_method_signature": "FileSystemUtilTest.testListDirectoriesRecursiveWithoutFilter()",
"constructor": false,
"full_signature": "@Test public void testListDirectoriesRecursiveWithoutFilter()",
"identifier": "testListDirectoriesRecursiveWithoutFilter",
"invocations": [
"listDirectories",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListDirectoriesRecursiveWithoutFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listDirectories(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }",
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"invocations": [
"listDirectories",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_63 | {
"fields": [
{
"declarator": "built_in = \"built-in\"",
"modifier": "private static final",
"original_string": "private static final String built_in = \"built-in\";",
"type": "String",
"var_name": "built_in"
},
{
"declarator": "udf_jar = \"DrillUDF-1.0.jar\"",
"modifier": "private static final",
"original_string": "private static final String udf_jar = \"DrillUDF-1.0.jar\";",
"type": "String",
"var_name": "udf_jar"
},
{
"declarator": "newJars",
"modifier": "private static",
"original_string": "private static Map<String, List<FunctionHolder>> newJars;",
"type": "Map<String, List<FunctionHolder>>",
"var_name": "newJars"
},
{
"declarator": "registryHolder",
"modifier": "private",
"original_string": "private FunctionRegistryHolder registryHolder;",
"type": "FunctionRegistryHolder",
"var_name": "registryHolder"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolderTest.java",
"identifier": "FunctionRegistryHolderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetHoldersByFunctionName() {\n List<DrillFuncHolder> expectedResult = Lists.newArrayList();\n for (List<FunctionHolder> functionHolders : newJars.values()) {\n for (FunctionHolder functionHolder : functionHolders) {\n if (\"lower\".equals(functionHolder.getName())) {\n expectedResult.add(functionHolder.getHolder()) ;\n }\n }\n }\n assertFalse(expectedResult.isEmpty());\n compareTwoLists(expectedResult, registryHolder.getHoldersByFunctionName(\"lower\"));\n }",
"class_method_signature": "FunctionRegistryHolderTest.testGetHoldersByFunctionName()",
"constructor": false,
"full_signature": "@Test public void testGetHoldersByFunctionName()",
"identifier": "testGetHoldersByFunctionName",
"invocations": [
"newArrayList",
"values",
"equals",
"getName",
"add",
"getHolder",
"assertFalse",
"isEmpty",
"compareTwoLists",
"getHoldersByFunctionName"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetHoldersByFunctionName()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "readWriteLock = new ReentrantReadWriteLock()",
"modifier": "private final",
"original_string": "private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();",
"type": "ReadWriteLock",
"var_name": "readWriteLock"
},
{
"declarator": "readLock = new AutoCloseableLock(readWriteLock.readLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock());",
"type": "AutoCloseableLock",
"var_name": "readLock"
},
{
"declarator": "writeLock = new AutoCloseableLock(readWriteLock.writeLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock());",
"type": "AutoCloseableLock",
"var_name": "writeLock"
},
{
"declarator": "version",
"modifier": "private",
"original_string": "private long version;",
"type": "long",
"var_name": "version"
},
{
"declarator": "jars",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, Queue<String>>> jars;",
"type": "Map<String, Map<String, Queue<String>>>",
"var_name": "jars"
},
{
"declarator": "functions",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, DrillFuncHolder>> functions;",
"type": "Map<String, Map<String, DrillFuncHolder>>",
"var_name": "functions"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolder.java",
"identifier": "FunctionRegistryHolder",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionRegistryHolder.FunctionRegistryHolder()",
"constructor": true,
"full_signature": "public FunctionRegistryHolder()",
"identifier": "FunctionRegistryHolder",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " FunctionRegistryHolder()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getVersion()",
"constructor": false,
"full_signature": "public long getVersion()",
"identifier": "getVersion",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getVersion()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"constructor": false,
"full_signature": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"identifier": "addJars",
"modifiers": "public",
"parameters": "(Map<String, List<FunctionHolder>> newJars, long version)",
"return": "void",
"signature": "void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeJar(String jarName)",
"constructor": false,
"full_signature": "public void removeJar(String jarName)",
"identifier": "removeJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllJarNames()",
"constructor": false,
"full_signature": "public List<String> getAllJarNames()",
"identifier": "getAllJarNames",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getAllJarNames()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getFunctionNamesByJar(String jarName)",
"constructor": false,
"full_signature": "public List<String> getFunctionNamesByJar(String jarName)",
"identifier": "getFunctionNamesByJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "List<String>",
"signature": "List<String> getFunctionNamesByJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders(AtomicLong version)",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "(AtomicLong version)",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders()",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithSignatures()",
"constructor": false,
"full_signature": "public ListMultimap<String, String> getAllFunctionsWithSignatures()",
"identifier": "getAllFunctionsWithSignatures",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, String>",
"signature": "ListMultimap<String, String> getAllFunctionsWithSignatures()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName, AtomicLong version)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName, AtomicLong version)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.containsJar(String jarName)",
"constructor": false,
"full_signature": "public boolean containsJar(String jarName)",
"identifier": "containsJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "boolean",
"signature": "boolean containsJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.functionsSize()",
"constructor": false,
"full_signature": "public int functionsSize()",
"identifier": "functionsSize",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int functionsSize()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getJarNameByFunctionSignature(String functionName, String functionSignature)",
"constructor": false,
"full_signature": "public String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"identifier": "getJarNameByFunctionSignature",
"modifiers": "public",
"parameters": "(String functionName, String functionSignature)",
"return": "String",
"signature": "String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"constructor": false,
"full_signature": "private void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"identifier": "addFunctions",
"modifiers": "private",
"parameters": "(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"return": "void",
"signature": "void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeAllByJar(String jarName)",
"constructor": false,
"full_signature": "private void removeAllByJar(String jarName)",
"identifier": "removeAllByJar",
"modifiers": "private",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeAllByJar(String jarName)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version) {\n try (AutoCloseableLock lock = readLock.open()) {\n if (version != null) {\n version.set(this.version);\n }\n Map<String, DrillFuncHolder> holders = functions.get(functionName);\n return holders == null ? Lists.<DrillFuncHolder>newArrayList() : Lists.newArrayList(holders.values());\n }\n }",
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName, AtomicLong version)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"identifier": "getHoldersByFunctionName",
"invocations": [
"open",
"set",
"get",
"newArrayList",
"newArrayList",
"values"
],
"modifiers": "public",
"parameters": "(String functionName, AtomicLong version)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_34 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java",
"identifier": "DrillFileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListDirectoriesWithoutFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listDirectories(fs, base, false);\n assertEquals(\"Directory count should match\", 2, statuses.size());\n }",
"class_method_signature": "DrillFileSystemUtilTest.testListDirectoriesWithoutFilter()",
"constructor": false,
"full_signature": "@Test public void testListDirectoriesWithoutFilter()",
"identifier": "testListDirectoriesWithoutFilter",
"invocations": [
"listDirectories",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListDirectoriesWithoutFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };",
"type": "PathFilter",
"var_name": "DRILL_SYSTEM_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java",
"identifier": "DrillFileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listDirectories(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }",
"class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"invocations": [
"listDirectories",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_22 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListFilesWithFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listFiles(fs, new Path(base, \"a\"), false, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\".txt\");\n }\n });\n assertEquals(\"File count should match\", 3, statuses.size());\n\n Collections.sort(statuses);\n assertEquals(\"File name should match\", \".f.txt\", statuses.get(0).getPath().getName());\n assertEquals(\"File name should match\", \"_f.txt\", statuses.get(1).getPath().getName());\n assertEquals(\"File name should match\", \"f.txt\", statuses.get(2).getPath().getName());\n }",
"class_method_signature": "FileSystemUtilTest.testListFilesWithFilter()",
"constructor": false,
"full_signature": "@Test public void testListFilesWithFilter()",
"identifier": "testListFilesWithFilter",
"invocations": [
"listFiles",
"endsWith",
"getName",
"assertEquals",
"size",
"sort",
"assertEquals",
"getName",
"getPath",
"get",
"assertEquals",
"getName",
"getPath",
"get",
"assertEquals",
"getName",
"getPath",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListFilesWithFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listFiles(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }",
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"invocations": [
"listFiles",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_103 | {
"fields": [
{
"declarator": "config = DrillConfig.create()",
"modifier": "private final",
"original_string": "private final DrillConfig config = DrillConfig.create();",
"type": "DrillConfig",
"var_name": "config"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/client/DrillClientTest.java",
"identifier": "DrillClientTest",
"interfaces": "",
"superclass": "extends DrillSystemTestBase"
} | {
"body": "@Test\n public void testParseAndVerifyEndpointsOnlyPortDelim() throws Exception{\n // Test to check when connection string only has delimiter\n final String drillBitConnection = \":\";\n\n try {\n final List<CoordinationProtos.DrillbitEndpoint> endpointsList = DrillClient.parseAndVerifyEndpoints\n (drillBitConnection, config.getString(ExecConstants.INITIAL_USER_PORT));\n fail();\n } catch (InvalidConnectionInfoException e) {\n System.out.println(e.getMessage());\n }\n }",
"class_method_signature": "DrillClientTest.testParseAndVerifyEndpointsOnlyPortDelim()",
"constructor": false,
"full_signature": "@Test public void testParseAndVerifyEndpointsOnlyPortDelim()",
"identifier": "testParseAndVerifyEndpointsOnlyPortDelim",
"invocations": [
"parseAndVerifyEndpoints",
"getString",
"fail",
"println",
"getMessage"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testParseAndVerifyEndpointsOnlyPortDelim()",
"testcase": true
} | {
"fields": [
{
"declarator": "DEFAULT_CLIENT_NAME = \"Apache Drill Java client\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_CLIENT_NAME = \"Apache Drill Java client\";",
"type": "String",
"var_name": "DEFAULT_CLIENT_NAME"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "objectMapper = new ObjectMapper()",
"modifier": "private static final",
"original_string": "private static final ObjectMapper objectMapper = new ObjectMapper();",
"type": "ObjectMapper",
"var_name": "objectMapper"
},
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final DrillConfig config;",
"type": "DrillConfig",
"var_name": "config"
},
{
"declarator": "client",
"modifier": "private",
"original_string": "private UserClient client;",
"type": "UserClient",
"var_name": "client"
},
{
"declarator": "properties",
"modifier": "private",
"original_string": "private DrillProperties properties;",
"type": "DrillProperties",
"var_name": "properties"
},
{
"declarator": "clusterCoordinator",
"modifier": "private volatile",
"original_string": "private volatile ClusterCoordinator clusterCoordinator;",
"type": "ClusterCoordinator",
"var_name": "clusterCoordinator"
},
{
"declarator": "connected = false",
"modifier": "private volatile",
"original_string": "private volatile boolean connected = false;",
"type": "boolean",
"var_name": "connected"
},
{
"declarator": "allocator",
"modifier": "private final",
"original_string": "private final BufferAllocator allocator;",
"type": "BufferAllocator",
"var_name": "allocator"
},
{
"declarator": "reconnectTimes",
"modifier": "private",
"original_string": "private int reconnectTimes;",
"type": "int",
"var_name": "reconnectTimes"
},
{
"declarator": "reconnectDelay",
"modifier": "private",
"original_string": "private int reconnectDelay;",
"type": "int",
"var_name": "reconnectDelay"
},
{
"declarator": "supportComplexTypes",
"modifier": "private",
"original_string": "private boolean supportComplexTypes;",
"type": "boolean",
"var_name": "supportComplexTypes"
},
{
"declarator": "ownsZkConnection",
"modifier": "private final",
"original_string": "private final boolean ownsZkConnection;",
"type": "boolean",
"var_name": "ownsZkConnection"
},
{
"declarator": "ownsAllocator",
"modifier": "private final",
"original_string": "private final boolean ownsAllocator;",
"type": "boolean",
"var_name": "ownsAllocator"
},
{
"declarator": "isDirectConnection",
"modifier": "private final",
"original_string": "private final boolean isDirectConnection;",
"type": "boolean",
"var_name": "isDirectConnection"
},
{
"declarator": "eventLoopGroup",
"modifier": "private",
"original_string": "private EventLoopGroup eventLoopGroup;",
"type": "EventLoopGroup",
"var_name": "eventLoopGroup"
},
{
"declarator": "executor",
"modifier": "private",
"original_string": "private ExecutorService executor;",
"type": "ExecutorService",
"var_name": "executor"
},
{
"declarator": "clientName = DEFAULT_CLIENT_NAME",
"modifier": "private",
"original_string": "private String clientName = DEFAULT_CLIENT_NAME;",
"type": "String",
"var_name": "clientName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java",
"identifier": "DrillClient",
"interfaces": "implements Closeable, ConnectionThrottle",
"methods": [
{
"class_method_signature": "DrillClient.DrillClient()",
"constructor": true,
"full_signature": "public DrillClient()",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DrillClient()",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(boolean isDirect)",
"return": "",
"signature": " DrillClient(boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(String fileName)",
"constructor": true,
"full_signature": "public DrillClient(String fileName)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(String fileName)",
"return": "",
"signature": " DrillClient(String fileName)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config)",
"return": "",
"signature": " DrillClient(DrillConfig config)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getConfig()",
"constructor": false,
"full_signature": "public DrillConfig getConfig()",
"identifier": "getConfig",
"modifiers": "public",
"parameters": "()",
"return": "DrillConfig",
"signature": "DrillConfig getConfig()",
"testcase": false
},
{
"class_method_signature": "DrillClient.setAutoRead(boolean enableAutoRead)",
"constructor": false,
"full_signature": "@Override public void setAutoRead(boolean enableAutoRead)",
"identifier": "setAutoRead",
"modifiers": "@Override public",
"parameters": "(boolean enableAutoRead)",
"return": "void",
"signature": "void setAutoRead(boolean enableAutoRead)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setClientName(String name)",
"constructor": false,
"full_signature": "public void setClientName(String name)",
"identifier": "setClientName",
"modifiers": "public",
"parameters": "(String name)",
"return": "void",
"signature": "void setClientName(String name)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setSupportComplexTypes(boolean supportComplexTypes)",
"constructor": false,
"full_signature": "public void setSupportComplexTypes(boolean supportComplexTypes)",
"identifier": "setSupportComplexTypes",
"modifiers": "public",
"parameters": "(boolean supportComplexTypes)",
"return": "void",
"signature": "void setSupportComplexTypes(boolean supportComplexTypes)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect()",
"constructor": false,
"full_signature": "public void connect()",
"identifier": "connect",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void connect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(Properties props)",
"constructor": false,
"full_signature": "public void connect(Properties props)",
"identifier": "connect",
"modifiers": "public",
"parameters": "(Properties props)",
"return": "void",
"signature": "void connect(Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(String connect, Properties props)",
"constructor": false,
"full_signature": "public synchronized void connect(String connect, Properties props)",
"identifier": "connect",
"modifiers": "public synchronized",
"parameters": "(String connect, Properties props)",
"return": "void",
"signature": "void connect(String connect, Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createEventLoop(int size, String prefix)",
"constructor": false,
"full_signature": "protected static EventLoopGroup createEventLoop(int size, String prefix)",
"identifier": "createEventLoop",
"modifiers": "protected static",
"parameters": "(int size, String prefix)",
"return": "EventLoopGroup",
"signature": "EventLoopGroup createEventLoop(int size, String prefix)",
"testcase": false
},
{
"class_method_signature": "DrillClient.reconnect()",
"constructor": false,
"full_signature": "public synchronized boolean reconnect()",
"identifier": "reconnect",
"modifiers": "public synchronized",
"parameters": "()",
"return": "boolean",
"signature": "boolean reconnect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(DrillbitEndpoint endpoint)",
"constructor": false,
"full_signature": "private void connect(DrillbitEndpoint endpoint)",
"identifier": "connect",
"modifiers": "private",
"parameters": "(DrillbitEndpoint endpoint)",
"return": "void",
"signature": "void connect(DrillbitEndpoint endpoint)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getAllocator()",
"constructor": false,
"full_signature": "public BufferAllocator getAllocator()",
"identifier": "getAllocator",
"modifiers": "public",
"parameters": "()",
"return": "BufferAllocator",
"signature": "BufferAllocator getAllocator()",
"testcase": false
},
{
"class_method_signature": "DrillClient.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerInfos()",
"constructor": false,
"full_signature": "@Deprecated public RpcEndpointInfos getServerInfos()",
"identifier": "getServerInfos",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "RpcEndpointInfos",
"signature": "RpcEndpointInfos getServerInfos()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerName()",
"constructor": false,
"full_signature": "public String getServerName()",
"identifier": "getServerName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getServerName()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerVersion()",
"constructor": false,
"full_signature": "public Version getServerVersion()",
"identifier": "getServerVersion",
"modifiers": "public",
"parameters": "()",
"return": "Version",
"signature": "Version getServerVersion()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerMeta()",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"identifier": "getServerMeta",
"modifiers": "public",
"parameters": "()",
"return": "DrillRpcFuture<GetServerMetaResp>",
"signature": "DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSupportedMethods()",
"constructor": false,
"full_signature": "public Set<ServerMethod> getSupportedMethods()",
"identifier": "getSupportedMethods",
"modifiers": "public",
"parameters": "()",
"return": "Set<ServerMethod>",
"signature": "Set<ServerMethod> getSupportedMethods()",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan)",
"constructor": false,
"full_signature": "public List<QueryDataBatch> runQuery(QueryType type, String plan)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> runQuery(QueryType type, String plan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.planQuery(QueryType type, String query, boolean isSplitPlan)",
"constructor": false,
"full_signature": "public DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"identifier": "planQuery",
"modifiers": "public",
"parameters": "(QueryType type, String query, boolean isSplitPlan)",
"return": "DrillRpcFuture<QueryPlanFragments>",
"signature": "DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getUserCredentials()",
"constructor": false,
"full_signature": "private UserBitShared.UserCredentials getUserCredentials()",
"identifier": "getUserCredentials",
"modifiers": "private",
"parameters": "()",
"return": "UserBitShared.UserCredentials",
"signature": "UserBitShared.UserCredentials getUserCredentials()",
"testcase": false
},
{
"class_method_signature": "DrillClient.cancelQuery(QueryId id)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"identifier": "cancelQuery",
"modifiers": "public",
"parameters": "(QueryId id)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"testcase": false
},
{
"class_method_signature": "DrillClient.resumeQuery(final QueryId queryId)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"identifier": "resumeQuery",
"modifiers": "public",
"parameters": "(final QueryId queryId)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getCatalogs(LikeFilter catalogNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"identifier": "getCatalogs",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter)",
"return": "DrillRpcFuture<GetCatalogsResp>",
"signature": "DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"identifier": "getSchemas",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"return": "DrillRpcFuture<GetSchemasResp>",
"signature": "DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"identifier": "getTables",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"return": "DrillRpcFuture<GetTablesResp>",
"signature": "DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"identifier": "getColumns",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"return": "DrillRpcFuture<GetColumnsResp>",
"signature": "DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createPreparedStatement(final String query)",
"constructor": false,
"full_signature": "public DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"identifier": "createPreparedStatement",
"modifiers": "public",
"parameters": "(final String query)",
"return": "DrillRpcFuture<CreatePreparedStatementResp>",
"signature": "DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"identifier": "executePreparedStatement",
"modifiers": "public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"return": "void",
"signature": "void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"constructor": false,
"full_signature": "@VisibleForTesting public List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"identifier": "executePreparedStatement",
"modifiers": "@VisibleForTesting public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)\n throws InvalidConnectionInfoException {\n // If no drillbits is provided then throw exception\n drillbits = drillbits.trim();\n if (drillbits.isEmpty()) {\n throw new InvalidConnectionInfoException(\"No drillbit information specified in the connection string\");\n }\n\n final List<DrillbitEndpoint> endpointList = new ArrayList<>();\n final String[] connectInfo = drillbits.split(\",\");\n\n // Fetch ip address and port information for each drillbit and populate the list\n for (String drillbit : connectInfo) {\n\n // Trim all the empty spaces and check if the entry is empty string.\n // Ignore the empty ones.\n drillbit = drillbit.trim();\n\n if (!drillbit.isEmpty()) {\n // Verify if we have only \":\" or only \":port\" pattern\n if (drillbit.charAt(0) == ':') {\n // Invalid drillbit information\n throw new InvalidConnectionInfoException(\"Malformed connection string with drillbit hostname or \" +\n \"hostaddress missing for an entry: \" + drillbit);\n }\n\n // We are now sure that each ip:port entry will have both the values atleast once.\n // Split each drillbit connection string to get ip address and port value\n final String[] drillbitInfo = drillbit.split(\":\");\n\n // Check if we have more than one port\n if (drillbitInfo.length > 2) {\n throw new InvalidConnectionInfoException(\"Malformed connection string with more than one port in a \" +\n \"drillbit entry: \" + drillbit);\n }\n\n // At this point we are sure that drillbitInfo has atleast hostname or host address\n // trim all the empty spaces which might be present in front of hostname or\n // host address information\n final String ipAddress = drillbitInfo[0].trim();\n String port = defaultUserPort;\n\n if (drillbitInfo.length == 2) {\n // We have a port value also given by user. trim all the empty spaces between : and port value before\n // validating the correctness of value.\n port = drillbitInfo[1].trim();\n }\n\n try {\n final DrillbitEndpoint endpoint = DrillbitEndpoint.newBuilder()\n .setAddress(ipAddress)\n .setUserPort(Integer.parseInt(port))\n .build();\n\n endpointList.add(endpoint);\n } catch (NumberFormatException e) {\n throw new InvalidConnectionInfoException(\"Malformed port value in entry: \" + ipAddress + \":\" + port + \" \" +\n \"passed in connection string\");\n }\n }\n }\n if (endpointList.size() == 0) {\n throw new InvalidConnectionInfoException(\"No valid drillbit information specified in the connection string\");\n }\n return endpointList;\n }",
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"invocations": [
"trim",
"isEmpty",
"split",
"trim",
"isEmpty",
"charAt",
"split",
"trim",
"trim",
"build",
"setUserPort",
"setAddress",
"newBuilder",
"parseInt",
"add",
"size"
],
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_75 | {
"fields": [
{
"declarator": "writer",
"modifier": "private static",
"original_string": "private static VectorContainerWriter writer;",
"type": "VectorContainerWriter",
"var_name": "writer"
},
{
"declarator": "mutator",
"modifier": "private static",
"original_string": "private static TestOutputMutator mutator;",
"type": "TestOutputMutator",
"var_name": "mutator"
},
{
"declarator": "bsonReader",
"modifier": "private static",
"original_string": "private static BsonRecordReader bsonReader;",
"type": "BsonRecordReader",
"var_name": "bsonReader"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java",
"identifier": "TestBsonRecordReader",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void testIntType() throws IOException {\n BsonDocument bsonDoc = new BsonDocument();\n bsonDoc.append(\"seqNo\", new BsonInt64(10));\n writer.reset();\n bsonReader.write(writer, new BsonDocumentReader(bsonDoc));\n SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();\n assertEquals(10l, mapReader.reader(\"seqNo\").readLong().longValue());\n }",
"class_method_signature": "TestBsonRecordReader.testIntType()",
"constructor": false,
"full_signature": "@Test public void testIntType()",
"identifier": "testIntType",
"invocations": [
"append",
"reset",
"write",
"getReader",
"getMapVector",
"assertEquals",
"longValue",
"readLong",
"reader"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testIntType()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class)",
"modifier": "static final",
"original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "MAX_RECORD_SIZE = 128 * 1024",
"modifier": "public final static",
"original_string": "public final static int MAX_RECORD_SIZE = 128 * 1024;",
"type": "int",
"var_name": "MAX_RECORD_SIZE"
},
{
"declarator": "columns",
"modifier": "private final",
"original_string": "private final List<SchemaPath> columns;",
"type": "List<SchemaPath>",
"var_name": "columns"
},
{
"declarator": "atLeastOneWrite = false",
"modifier": "private",
"original_string": "private boolean atLeastOneWrite = false;",
"type": "boolean",
"var_name": "atLeastOneWrite"
},
{
"declarator": "readNumbersAsDouble",
"modifier": "private final",
"original_string": "private final boolean readNumbersAsDouble;",
"type": "boolean",
"var_name": "readNumbersAsDouble"
},
{
"declarator": "workBuf",
"modifier": "protected",
"original_string": "protected DrillBuf workBuf;",
"type": "DrillBuf",
"var_name": "workBuf"
},
{
"declarator": "currentFieldName",
"modifier": "private",
"original_string": "private String currentFieldName;",
"type": "String",
"var_name": "currentFieldName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java",
"identifier": "BsonRecordReader",
"interfaces": "",
"methods": [
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"constructor": false,
"full_signature": "private void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"identifier": "writeToListOrMap",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"return": "void",
"signature": "void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeTimeStamp",
"modifiers": "private",
"parameters": "(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeString",
"modifiers": "private",
"parameters": "(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeObjectId",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDouble",
"modifiers": "private",
"parameters": "(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDateTime",
"modifiers": "private",
"parameters": "(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBoolean",
"modifiers": "private",
"parameters": "(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"constructor": false,
"full_signature": "private void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"return": "void",
"signature": "void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt64",
"modifiers": "private",
"parameters": "(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt32",
"modifiers": "private",
"parameters": "(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensureAtLeastOneField(ComplexWriter writer)",
"constructor": false,
"full_signature": "public void ensureAtLeastOneField(ComplexWriter writer)",
"identifier": "ensureAtLeastOneField",
"modifiers": "public",
"parameters": "(ComplexWriter writer)",
"return": "void",
"signature": "void ensureAtLeastOneField(ComplexWriter writer)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(Throwable exception, String field, String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensure(final int length)",
"constructor": false,
"full_signature": "private void ensure(final int length)",
"identifier": "ensure",
"modifiers": "private",
"parameters": "(final int length)",
"return": "void",
"signature": "void ensure(final int length)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void write(ComplexWriter writer, BsonReader reader) throws IOException {\n reader.readStartDocument();\n BsonType readBsonType = reader.getCurrentBsonType();\n switch (readBsonType) {\n case DOCUMENT:\n writeToListOrMap(reader, new MapOrListWriterImpl(writer.rootAsMap()), false, null);\n break;\n default:\n throw new DrillRuntimeException(\"Root object must be DOCUMENT type. Found: \" + readBsonType);\n }\n }",
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"invocations": [
"readStartDocument",
"getCurrentBsonType",
"writeToListOrMap",
"rootAsMap"
],
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_43 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java",
"identifier": "DrillFileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListAllWithFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listAll(fs, new Path(base, \"a\"), false, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\"a\") || path.getName().endsWith(\".txt\");\n }\n });\n assertEquals(\"Directory and file count should match\", 2, statuses.size());\n\n Collections.sort(statuses);\n assertEquals(\"Directory name should match\", \"aa\", statuses.get(0).getPath().getName());\n assertEquals(\"File name should match\", \"f.txt\", statuses.get(1).getPath().getName());\n }",
"class_method_signature": "DrillFileSystemUtilTest.testListAllWithFilter()",
"constructor": false,
"full_signature": "@Test public void testListAllWithFilter()",
"identifier": "testListAllWithFilter",
"invocations": [
"listAll",
"endsWith",
"getName",
"endsWith",
"getName",
"assertEquals",
"size",
"sort",
"assertEquals",
"getName",
"getPath",
"get",
"assertEquals",
"getName",
"getPath",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListAllWithFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };",
"type": "PathFilter",
"var_name": "DRILL_SYSTEM_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java",
"identifier": "DrillFileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listAll(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }",
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"invocations": [
"listAll",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_14 | {
"fields": [
{
"declarator": "N1_EP1 = newDrillbitEndpoint(\"node1\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP1 = newDrillbitEndpoint(\"node1\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP1"
},
{
"declarator": "N1_EP2 = newDrillbitEndpoint(\"node1\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP2 = newDrillbitEndpoint(\"node1\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP2"
},
{
"declarator": "N2_EP1 = newDrillbitEndpoint(\"node2\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP1 = newDrillbitEndpoint(\"node2\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP1"
},
{
"declarator": "N2_EP2 = newDrillbitEndpoint(\"node2\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP2 = newDrillbitEndpoint(\"node2\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP2"
},
{
"declarator": "N3_EP1 = newDrillbitEndpoint(\"node3\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP1 = newDrillbitEndpoint(\"node3\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP1"
},
{
"declarator": "N3_EP2 = newDrillbitEndpoint(\"node3\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP2 = newDrillbitEndpoint(\"node3\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP2"
},
{
"declarator": "N4_EP2 = newDrillbitEndpoint(\"node4\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N4_EP2 = newDrillbitEndpoint(\"node4\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N4_EP2"
},
{
"declarator": "fragment",
"modifier": "@Mocked private",
"original_string": "@Mocked private Fragment fragment;",
"type": "Fragment",
"var_name": "fragment"
},
{
"declarator": "root",
"modifier": "@Mocked private",
"original_string": "@Mocked private PhysicalOperator root;",
"type": "PhysicalOperator",
"var_name": "root"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/planner/fragment/TestHardAffinityFragmentParallelizer.java",
"identifier": "TestHardAffinityFragmentParallelizer",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void multiNodeClusterNegative1() throws Exception {\n final Wrapper wrapper = newWrapper(200, 1, 20,\n ImmutableList.of(\n new EndpointAffinity(N1_EP2, 0.15, true, MAX_VALUE),\n new EndpointAffinity(N2_EP2, 0.15, true, MAX_VALUE),\n new EndpointAffinity(N3_EP1, 0.10, true, MAX_VALUE),\n new EndpointAffinity(N4_EP2, 0.20, true, MAX_VALUE),\n new EndpointAffinity(N1_EP1, 0.20, true, MAX_VALUE)\n ));\n\n try {\n INSTANCE.parallelizeFragment(wrapper, newParameters(1, 2, 2), null);\n fail(\"Expected an exception, because max global query width (2) is less than the number of mandatory nodes (5)\");\n } catch (Exception e) {\n // ok\n }\n }",
"class_method_signature": "TestHardAffinityFragmentParallelizer.multiNodeClusterNegative1()",
"constructor": false,
"full_signature": "@Test public void multiNodeClusterNegative1()",
"identifier": "multiNodeClusterNegative1",
"invocations": [
"newWrapper",
"of",
"parallelizeFragment",
"newParameters",
"fail"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void multiNodeClusterNegative1()",
"testcase": true
} | {
"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);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "INSTANCE = new HardAffinityFragmentParallelizer()",
"modifier": "public static final",
"original_string": "public static final HardAffinityFragmentParallelizer INSTANCE = new HardAffinityFragmentParallelizer();",
"type": "HardAffinityFragmentParallelizer",
"var_name": "INSTANCE"
},
{
"declarator": "EOL = System.getProperty(\"line.separator\")",
"modifier": "private static",
"original_string": "private static String EOL = System.getProperty(\"line.separator\");",
"type": "String",
"var_name": "EOL"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/HardAffinityFragmentParallelizer.java",
"identifier": "HardAffinityFragmentParallelizer",
"interfaces": "implements FragmentParallelizer",
"methods": [
{
"class_method_signature": "HardAffinityFragmentParallelizer.HardAffinityFragmentParallelizer()",
"constructor": true,
"full_signature": "private HardAffinityFragmentParallelizer()",
"identifier": "HardAffinityFragmentParallelizer",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HardAffinityFragmentParallelizer()",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"constructor": false,
"full_signature": "private static void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"identifier": "checkOrThrow",
"modifiers": "private static",
"parameters": "(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"return": "void",
"signature": "void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints) throws PhysicalOperatorSetupException {\n\n final Stats stats = fragmentWrapper.getStats();\n final ParallelizationInfo pInfo = stats.getParallelizationInfo();\n\n int totalMaxWidth = 0;\n\n // Go through the affinity map and extract the endpoints that have mandatory assignment requirement\n final Map<DrillbitEndpoint, EndpointAffinity> endpointPool = Maps.newHashMap();\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : pInfo.getEndpointAffinityMap().entrySet()) {\n if (entry.getValue().isAssignmentRequired()) {\n endpointPool.put(entry.getKey(), entry.getValue());\n\n // Limit the max width of the endpoint to allowed max width.\n totalMaxWidth += Math.min(parameters.getMaxWidthPerNode(), entry.getValue().getMaxWidth());\n if (totalMaxWidth < 0) {\n // If the totalWidth overflows, just keep it at the max value.\n totalMaxWidth = Integer.MAX_VALUE;\n }\n }\n }\n\n // Step 1: Find the width taking into various parameters\n // 1.1. Find the parallelization based on cost. Use max cost of all operators in this fragment; this is consistent\n // with the calculation that ExcessiveExchangeRemover uses.\n int width = (int) Math.ceil(stats.getMaxCost() / parameters.getSliceTarget());\n\n // 1.2. Make sure the width is at least the number of endpoints that require an assignment\n width = Math.max(endpointPool.size(), width);\n\n // 1.3. Cap the parallelization width by fragment level width limit and system level per query width limit\n width = Math.max(1, Math.min(width, pInfo.getMaxWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed fragment max \" +\n \"width ({}).\", endpointPool.size(), pInfo.getMaxWidth());\n\n // 1.4 Cap the parallelization width by global max query width\n width = Math.max(1, Math.min(width, parameters.getMaxGlobalWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed global query \" +\n \"width ({}).\", endpointPool.size(), parameters.getMaxGlobalWidth());\n\n // 1.5 Cap the parallelization width by max allowed parallelization per node\n width = Math.max(1, Math.min(width, endpointPool.size()*parameters.getMaxWidthPerNode()));\n\n // 1.6 Cap the parallelization width by total of max allowed width per node. The reason is if we the width is more,\n // we end up allocating more work units to one or more endpoints that don't have those many work units.\n width = Math.min(totalMaxWidth, width);\n\n // Step 2: Select the endpoints\n final Map<DrillbitEndpoint, Integer> endpoints = Maps.newHashMap();\n\n // 2.1 First add each endpoint from the pool once so that the mandatory assignment requirement is fulfilled.\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : endpointPool.entrySet()) {\n endpoints.put(entry.getKey(), 1);\n }\n int totalAssigned = endpoints.size();\n\n // 2.2 Assign the remaining slots to endpoints proportional to the affinity of each endpoint\n int remainingSlots = width - endpoints.size();\n while (remainingSlots > 0) {\n for(EndpointAffinity epAf : endpointPool.values()) {\n final int moreAllocation = (int) Math.ceil(epAf.getAffinity() * remainingSlots);\n int currentAssignments = endpoints.get(epAf.getEndpoint());\n for(int i=0;\n i < moreAllocation &&\n totalAssigned < width &&\n currentAssignments < parameters.getMaxWidthPerNode() &&\n currentAssignments < epAf.getMaxWidth();\n i++) {\n totalAssigned++;\n currentAssignments++;\n }\n endpoints.put(epAf.getEndpoint(), currentAssignments);\n }\n final int previousRemainingSlots = remainingSlots;\n remainingSlots = width - totalAssigned;\n if (previousRemainingSlots == remainingSlots) {\n logger.error(\"Can't parallelize fragment: \" +\n \"Every mandatory node has exhausted the maximum width per node limit.\" + EOL +\n \"Endpoint pool: {}\" + EOL + \"Assignment so far: {}\" + EOL + \"Width: {}\", endpointPool, endpoints, width);\n throw new PhysicalOperatorSetupException(\"Can not parallelize fragment.\");\n }\n }\n\n final List<DrillbitEndpoint> assignedEndpoints = Lists.newArrayList();\n for(Entry<DrillbitEndpoint, Integer> entry : endpoints.entrySet()) {\n for(int i=0; i < entry.getValue(); i++) {\n assignedEndpoints.add(entry.getKey());\n }\n }\n\n fragmentWrapper.setWidth(width);\n fragmentWrapper.assignEndpoints(assignedEndpoints);\n }",
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"invocations": [
"getStats",
"getParallelizationInfo",
"newHashMap",
"entrySet",
"getEndpointAffinityMap",
"isAssignmentRequired",
"getValue",
"put",
"getKey",
"getValue",
"min",
"getMaxWidthPerNode",
"getMaxWidth",
"getValue",
"ceil",
"getMaxCost",
"getSliceTarget",
"max",
"size",
"max",
"min",
"getMaxWidth",
"checkOrThrow",
"size",
"size",
"getMaxWidth",
"max",
"min",
"getMaxGlobalWidth",
"checkOrThrow",
"size",
"size",
"getMaxGlobalWidth",
"max",
"min",
"size",
"getMaxWidthPerNode",
"min",
"newHashMap",
"entrySet",
"put",
"getKey",
"size",
"size",
"values",
"ceil",
"getAffinity",
"get",
"getEndpoint",
"getMaxWidthPerNode",
"getMaxWidth",
"put",
"getEndpoint",
"error",
"newArrayList",
"entrySet",
"getValue",
"add",
"getKey",
"setWidth",
"assignEndpoints"
],
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_80 | {
"fields": [
{
"declarator": "writer",
"modifier": "private static",
"original_string": "private static VectorContainerWriter writer;",
"type": "VectorContainerWriter",
"var_name": "writer"
},
{
"declarator": "mutator",
"modifier": "private static",
"original_string": "private static TestOutputMutator mutator;",
"type": "TestOutputMutator",
"var_name": "mutator"
},
{
"declarator": "bsonReader",
"modifier": "private static",
"original_string": "private static BsonRecordReader bsonReader;",
"type": "BsonRecordReader",
"var_name": "bsonReader"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java",
"identifier": "TestBsonRecordReader",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void testObjectIdType() throws IOException {\n BsonDocument bsonDoc = new BsonDocument();\n BsonObjectId value = new BsonObjectId(new ObjectId());\n bsonDoc.append(\"_idKey\", value);\n writer.reset();\n bsonReader.write(writer, new BsonDocumentReader(bsonDoc));\n SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();\n byte[] readByteArray = mapReader.reader(\"_idKey\").readByteArray();\n assertTrue(Arrays.equals(value.getValue().toByteArray(), readByteArray));\n }",
"class_method_signature": "TestBsonRecordReader.testObjectIdType()",
"constructor": false,
"full_signature": "@Test public void testObjectIdType()",
"identifier": "testObjectIdType",
"invocations": [
"append",
"reset",
"write",
"getReader",
"getMapVector",
"readByteArray",
"reader",
"assertTrue",
"equals",
"toByteArray",
"getValue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testObjectIdType()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class)",
"modifier": "static final",
"original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "MAX_RECORD_SIZE = 128 * 1024",
"modifier": "public final static",
"original_string": "public final static int MAX_RECORD_SIZE = 128 * 1024;",
"type": "int",
"var_name": "MAX_RECORD_SIZE"
},
{
"declarator": "columns",
"modifier": "private final",
"original_string": "private final List<SchemaPath> columns;",
"type": "List<SchemaPath>",
"var_name": "columns"
},
{
"declarator": "atLeastOneWrite = false",
"modifier": "private",
"original_string": "private boolean atLeastOneWrite = false;",
"type": "boolean",
"var_name": "atLeastOneWrite"
},
{
"declarator": "readNumbersAsDouble",
"modifier": "private final",
"original_string": "private final boolean readNumbersAsDouble;",
"type": "boolean",
"var_name": "readNumbersAsDouble"
},
{
"declarator": "workBuf",
"modifier": "protected",
"original_string": "protected DrillBuf workBuf;",
"type": "DrillBuf",
"var_name": "workBuf"
},
{
"declarator": "currentFieldName",
"modifier": "private",
"original_string": "private String currentFieldName;",
"type": "String",
"var_name": "currentFieldName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java",
"identifier": "BsonRecordReader",
"interfaces": "",
"methods": [
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"constructor": false,
"full_signature": "private void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"identifier": "writeToListOrMap",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"return": "void",
"signature": "void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeTimeStamp",
"modifiers": "private",
"parameters": "(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeString",
"modifiers": "private",
"parameters": "(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeObjectId",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDouble",
"modifiers": "private",
"parameters": "(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDateTime",
"modifiers": "private",
"parameters": "(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBoolean",
"modifiers": "private",
"parameters": "(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"constructor": false,
"full_signature": "private void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"return": "void",
"signature": "void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt64",
"modifiers": "private",
"parameters": "(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt32",
"modifiers": "private",
"parameters": "(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensureAtLeastOneField(ComplexWriter writer)",
"constructor": false,
"full_signature": "public void ensureAtLeastOneField(ComplexWriter writer)",
"identifier": "ensureAtLeastOneField",
"modifiers": "public",
"parameters": "(ComplexWriter writer)",
"return": "void",
"signature": "void ensureAtLeastOneField(ComplexWriter writer)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(Throwable exception, String field, String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensure(final int length)",
"constructor": false,
"full_signature": "private void ensure(final int length)",
"identifier": "ensure",
"modifiers": "private",
"parameters": "(final int length)",
"return": "void",
"signature": "void ensure(final int length)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void write(ComplexWriter writer, BsonReader reader) throws IOException {\n reader.readStartDocument();\n BsonType readBsonType = reader.getCurrentBsonType();\n switch (readBsonType) {\n case DOCUMENT:\n writeToListOrMap(reader, new MapOrListWriterImpl(writer.rootAsMap()), false, null);\n break;\n default:\n throw new DrillRuntimeException(\"Root object must be DOCUMENT type. Found: \" + readBsonType);\n }\n }",
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"invocations": [
"readStartDocument",
"getCurrentBsonType",
"writeToListOrMap",
"rootAsMap"
],
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_38 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java",
"identifier": "DrillFileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListFilesWithoutFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listFiles(fs, new Path(base, \"a\"), false);\n assertEquals(\"File count should match\", 1, statuses.size());\n assertEquals(\"File name should match\", \"f.txt\", statuses.get(0).getPath().getName());\n }",
"class_method_signature": "DrillFileSystemUtilTest.testListFilesWithoutFilter()",
"constructor": false,
"full_signature": "@Test public void testListFilesWithoutFilter()",
"identifier": "testListFilesWithoutFilter",
"invocations": [
"listFiles",
"assertEquals",
"size",
"assertEquals",
"getName",
"getPath",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListFilesWithoutFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };",
"type": "PathFilter",
"var_name": "DRILL_SYSTEM_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java",
"identifier": "DrillFileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listFiles(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }",
"class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"invocations": [
"listFiles",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_79 | {
"fields": [
{
"declarator": "writer",
"modifier": "private static",
"original_string": "private static VectorContainerWriter writer;",
"type": "VectorContainerWriter",
"var_name": "writer"
},
{
"declarator": "mutator",
"modifier": "private static",
"original_string": "private static TestOutputMutator mutator;",
"type": "TestOutputMutator",
"var_name": "mutator"
},
{
"declarator": "bsonReader",
"modifier": "private static",
"original_string": "private static BsonRecordReader bsonReader;",
"type": "BsonRecordReader",
"var_name": "bsonReader"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java",
"identifier": "TestBsonRecordReader",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void testSpecialCharStringType() throws IOException {\n BsonDocument bsonDoc = new BsonDocument();\n bsonDoc.append(\"stringKey\", new BsonString(\"§§§§§§§§§1\"));\n writer.reset();\n bsonReader.write(writer, new BsonDocumentReader(bsonDoc));\n SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();\n assertEquals(\"§§§§§§§§§1\",\n mapReader.reader(\"stringKey\").readText().toString());\n }",
"class_method_signature": "TestBsonRecordReader.testSpecialCharStringType()",
"constructor": false,
"full_signature": "@Test public void testSpecialCharStringType()",
"identifier": "testSpecialCharStringType",
"invocations": [
"append",
"reset",
"write",
"getReader",
"getMapVector",
"assertEquals",
"toString",
"readText",
"reader"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSpecialCharStringType()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class)",
"modifier": "static final",
"original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "MAX_RECORD_SIZE = 128 * 1024",
"modifier": "public final static",
"original_string": "public final static int MAX_RECORD_SIZE = 128 * 1024;",
"type": "int",
"var_name": "MAX_RECORD_SIZE"
},
{
"declarator": "columns",
"modifier": "private final",
"original_string": "private final List<SchemaPath> columns;",
"type": "List<SchemaPath>",
"var_name": "columns"
},
{
"declarator": "atLeastOneWrite = false",
"modifier": "private",
"original_string": "private boolean atLeastOneWrite = false;",
"type": "boolean",
"var_name": "atLeastOneWrite"
},
{
"declarator": "readNumbersAsDouble",
"modifier": "private final",
"original_string": "private final boolean readNumbersAsDouble;",
"type": "boolean",
"var_name": "readNumbersAsDouble"
},
{
"declarator": "workBuf",
"modifier": "protected",
"original_string": "protected DrillBuf workBuf;",
"type": "DrillBuf",
"var_name": "workBuf"
},
{
"declarator": "currentFieldName",
"modifier": "private",
"original_string": "private String currentFieldName;",
"type": "String",
"var_name": "currentFieldName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java",
"identifier": "BsonRecordReader",
"interfaces": "",
"methods": [
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"constructor": false,
"full_signature": "private void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"identifier": "writeToListOrMap",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"return": "void",
"signature": "void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeTimeStamp",
"modifiers": "private",
"parameters": "(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeString",
"modifiers": "private",
"parameters": "(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeObjectId",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDouble",
"modifiers": "private",
"parameters": "(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDateTime",
"modifiers": "private",
"parameters": "(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBoolean",
"modifiers": "private",
"parameters": "(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"constructor": false,
"full_signature": "private void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"return": "void",
"signature": "void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt64",
"modifiers": "private",
"parameters": "(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt32",
"modifiers": "private",
"parameters": "(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensureAtLeastOneField(ComplexWriter writer)",
"constructor": false,
"full_signature": "public void ensureAtLeastOneField(ComplexWriter writer)",
"identifier": "ensureAtLeastOneField",
"modifiers": "public",
"parameters": "(ComplexWriter writer)",
"return": "void",
"signature": "void ensureAtLeastOneField(ComplexWriter writer)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(Throwable exception, String field, String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensure(final int length)",
"constructor": false,
"full_signature": "private void ensure(final int length)",
"identifier": "ensure",
"modifiers": "private",
"parameters": "(final int length)",
"return": "void",
"signature": "void ensure(final int length)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void write(ComplexWriter writer, BsonReader reader) throws IOException {\n reader.readStartDocument();\n BsonType readBsonType = reader.getCurrentBsonType();\n switch (readBsonType) {\n case DOCUMENT:\n writeToListOrMap(reader, new MapOrListWriterImpl(writer.rootAsMap()), false, null);\n break;\n default:\n throw new DrillRuntimeException(\"Root object must be DOCUMENT type. Found: \" + readBsonType);\n }\n }",
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"invocations": [
"readStartDocument",
"getCurrentBsonType",
"writeToListOrMap",
"rootAsMap"
],
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_96 | {
"fields": [
{
"declarator": "FULL_PERMISSION = FsPermission.getDirDefault()",
"modifier": "private static final",
"original_string": "private static final FsPermission FULL_PERMISSION = FsPermission.getDirDefault();",
"type": "FsPermission",
"var_name": "FULL_PERMISSION"
},
{
"declarator": "PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false)",
"modifier": "private static final",
"original_string": "private static final StorageStrategy PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false);",
"type": "StorageStrategy",
"var_name": "PERSISTENT_STRATEGY"
},
{
"declarator": "TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true)",
"modifier": "private static final",
"original_string": "private static final StorageStrategy TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true);",
"type": "StorageStrategy",
"var_name": "TEMPORARY_STRATEGY"
},
{
"declarator": "fs",
"modifier": "private static",
"original_string": "private static FileSystem fs;",
"type": "FileSystem",
"var_name": "fs"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/StorageStrategyTest.java",
"identifier": "StorageStrategyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateNoPath() throws Exception {\n Path path = prepareStorageDirectory();\n\n Path createdParentPath = TEMPORARY_STRATEGY.createPathAndApply(fs, path);\n\n assertNull(\"Path should be null\", createdParentPath);\n assertEquals(\"Permission should match\", FULL_PERMISSION, fs.getFileStatus(path).getPermission());\n }",
"class_method_signature": "StorageStrategyTest.testCreateNoPath()",
"constructor": false,
"full_signature": "@Test public void testCreateNoPath()",
"identifier": "testCreateNoPath",
"invocations": [
"prepareStorageDirectory",
"createPathAndApply",
"assertNull",
"assertEquals",
"getPermission",
"getFileStatus"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testCreateNoPath()",
"testcase": true
} | {
"fields": [
{
"declarator": "DEFAULT = new StorageStrategy(\"002\", false)",
"modifier": "public static final",
"original_string": "public static final StorageStrategy DEFAULT = new StorageStrategy(\"002\", false);",
"type": "StorageStrategy",
"var_name": "DEFAULT"
},
{
"declarator": "TEMPORARY = new StorageStrategy(\"077\", true)",
"modifier": "public static final",
"original_string": "public static final StorageStrategy TEMPORARY = new StorageStrategy(\"077\", true);",
"type": "StorageStrategy",
"var_name": "TEMPORARY"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "umask",
"modifier": "private final",
"original_string": "private final String umask;",
"type": "String",
"var_name": "umask"
},
{
"declarator": "deleteOnExit",
"modifier": "private final",
"original_string": "private final boolean deleteOnExit;",
"type": "boolean",
"var_name": "deleteOnExit"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/StorageStrategy.java",
"identifier": "StorageStrategy",
"interfaces": "",
"methods": [
{
"class_method_signature": "StorageStrategy.StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"constructor": true,
"full_signature": "@JsonCreator public StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"identifier": "StorageStrategy",
"modifiers": "@JsonCreator public",
"parameters": "(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"return": "",
"signature": " StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getUmask()",
"constructor": false,
"full_signature": "public String getUmask()",
"identifier": "getUmask",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getUmask()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.isDeleteOnExit()",
"constructor": false,
"full_signature": "public boolean isDeleteOnExit()",
"identifier": "isDeleteOnExit",
"modifiers": "public",
"parameters": "()",
"return": "boolean",
"signature": "boolean isDeleteOnExit()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getFolderPermission()",
"constructor": false,
"full_signature": "@JsonIgnore public FsPermission getFolderPermission()",
"identifier": "getFolderPermission",
"modifiers": "@JsonIgnore public",
"parameters": "()",
"return": "FsPermission",
"signature": "FsPermission getFolderPermission()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getFilePermission()",
"constructor": false,
"full_signature": "@JsonIgnore public FsPermission getFilePermission()",
"identifier": "getFilePermission",
"modifiers": "@JsonIgnore public",
"parameters": "()",
"return": "FsPermission",
"signature": "FsPermission getFilePermission()",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.createPathAndApply(FileSystem fs, Path path)",
"constructor": false,
"full_signature": "public Path createPathAndApply(FileSystem fs, Path path)",
"identifier": "createPathAndApply",
"modifiers": "public",
"parameters": "(FileSystem fs, Path path)",
"return": "Path",
"signature": "Path createPathAndApply(FileSystem fs, Path path)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public Path createFileAndApply(FileSystem fs, Path file)",
"identifier": "createFileAndApply",
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "Path",
"signature": "Path createFileAndApply(FileSystem fs, Path file)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.applyToFile(FileSystem fs, Path file)",
"constructor": false,
"full_signature": "public void applyToFile(FileSystem fs, Path file)",
"identifier": "applyToFile",
"modifiers": "public",
"parameters": "(FileSystem fs, Path file)",
"return": "void",
"signature": "void applyToFile(FileSystem fs, Path file)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.validateUmask(String umask)",
"constructor": false,
"full_signature": "private String validateUmask(String umask)",
"identifier": "validateUmask",
"modifiers": "private",
"parameters": "(String umask)",
"return": "String",
"signature": "String validateUmask(String umask)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.getNonExistentLocations(FileSystem fs, Path path)",
"constructor": false,
"full_signature": "private List<Path> getNonExistentLocations(FileSystem fs, Path path)",
"identifier": "getNonExistentLocations",
"modifiers": "private",
"parameters": "(FileSystem fs, Path path)",
"return": "List<Path>",
"signature": "List<Path> getNonExistentLocations(FileSystem fs, Path path)",
"testcase": false
},
{
"class_method_signature": "StorageStrategy.applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"constructor": false,
"full_signature": "private void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"identifier": "applyStrategy",
"modifiers": "private",
"parameters": "(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"return": "void",
"signature": "void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Path createPathAndApply(FileSystem fs, Path path) throws IOException {\n List<Path> locations = getNonExistentLocations(fs, path);\n if (locations.isEmpty()) {\n return null;\n }\n fs.mkdirs(path);\n for (Path location : locations) {\n applyStrategy(fs, location, getFolderPermission(), deleteOnExit);\n }\n return locations.get(locations.size() - 1);\n }",
"class_method_signature": "StorageStrategy.createPathAndApply(FileSystem fs, Path path)",
"constructor": false,
"full_signature": "public Path createPathAndApply(FileSystem fs, Path path)",
"identifier": "createPathAndApply",
"invocations": [
"getNonExistentLocations",
"isEmpty",
"mkdirs",
"applyStrategy",
"getFolderPermission",
"get",
"size"
],
"modifiers": "public",
"parameters": "(FileSystem fs, Path path)",
"return": "Path",
"signature": "Path createPathAndApply(FileSystem fs, Path path)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_78 | {
"fields": [
{
"declarator": "writer",
"modifier": "private static",
"original_string": "private static VectorContainerWriter writer;",
"type": "VectorContainerWriter",
"var_name": "writer"
},
{
"declarator": "mutator",
"modifier": "private static",
"original_string": "private static TestOutputMutator mutator;",
"type": "TestOutputMutator",
"var_name": "mutator"
},
{
"declarator": "bsonReader",
"modifier": "private static",
"original_string": "private static BsonRecordReader bsonReader;",
"type": "BsonRecordReader",
"var_name": "bsonReader"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java",
"identifier": "TestBsonRecordReader",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void testStringType() throws IOException {\n BsonDocument bsonDoc = new BsonDocument();\n bsonDoc.append(\"stringKey\", new BsonString(\"test_string\"));\n writer.reset();\n bsonReader.write(writer, new BsonDocumentReader(bsonDoc));\n SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();\n assertEquals(\"test_string\", mapReader.reader(\"stringKey\").readText().toString());\n }",
"class_method_signature": "TestBsonRecordReader.testStringType()",
"constructor": false,
"full_signature": "@Test public void testStringType()",
"identifier": "testStringType",
"invocations": [
"append",
"reset",
"write",
"getReader",
"getMapVector",
"assertEquals",
"toString",
"readText",
"reader"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testStringType()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class)",
"modifier": "static final",
"original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "MAX_RECORD_SIZE = 128 * 1024",
"modifier": "public final static",
"original_string": "public final static int MAX_RECORD_SIZE = 128 * 1024;",
"type": "int",
"var_name": "MAX_RECORD_SIZE"
},
{
"declarator": "columns",
"modifier": "private final",
"original_string": "private final List<SchemaPath> columns;",
"type": "List<SchemaPath>",
"var_name": "columns"
},
{
"declarator": "atLeastOneWrite = false",
"modifier": "private",
"original_string": "private boolean atLeastOneWrite = false;",
"type": "boolean",
"var_name": "atLeastOneWrite"
},
{
"declarator": "readNumbersAsDouble",
"modifier": "private final",
"original_string": "private final boolean readNumbersAsDouble;",
"type": "boolean",
"var_name": "readNumbersAsDouble"
},
{
"declarator": "workBuf",
"modifier": "protected",
"original_string": "protected DrillBuf workBuf;",
"type": "DrillBuf",
"var_name": "workBuf"
},
{
"declarator": "currentFieldName",
"modifier": "private",
"original_string": "private String currentFieldName;",
"type": "String",
"var_name": "currentFieldName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java",
"identifier": "BsonRecordReader",
"interfaces": "",
"methods": [
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"constructor": false,
"full_signature": "private void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"identifier": "writeToListOrMap",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"return": "void",
"signature": "void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeTimeStamp",
"modifiers": "private",
"parameters": "(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeString",
"modifiers": "private",
"parameters": "(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeObjectId",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDouble",
"modifiers": "private",
"parameters": "(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDateTime",
"modifiers": "private",
"parameters": "(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBoolean",
"modifiers": "private",
"parameters": "(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"constructor": false,
"full_signature": "private void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"return": "void",
"signature": "void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt64",
"modifiers": "private",
"parameters": "(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt32",
"modifiers": "private",
"parameters": "(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensureAtLeastOneField(ComplexWriter writer)",
"constructor": false,
"full_signature": "public void ensureAtLeastOneField(ComplexWriter writer)",
"identifier": "ensureAtLeastOneField",
"modifiers": "public",
"parameters": "(ComplexWriter writer)",
"return": "void",
"signature": "void ensureAtLeastOneField(ComplexWriter writer)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(Throwable exception, String field, String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensure(final int length)",
"constructor": false,
"full_signature": "private void ensure(final int length)",
"identifier": "ensure",
"modifiers": "private",
"parameters": "(final int length)",
"return": "void",
"signature": "void ensure(final int length)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void write(ComplexWriter writer, BsonReader reader) throws IOException {\n reader.readStartDocument();\n BsonType readBsonType = reader.getCurrentBsonType();\n switch (readBsonType) {\n case DOCUMENT:\n writeToListOrMap(reader, new MapOrListWriterImpl(writer.rootAsMap()), false, null);\n break;\n default:\n throw new DrillRuntimeException(\"Root object must be DOCUMENT type. Found: \" + readBsonType);\n }\n }",
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"invocations": [
"readStartDocument",
"getCurrentBsonType",
"writeToListOrMap",
"rootAsMap"
],
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_39 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java",
"identifier": "DrillFileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListFilesWithFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listFiles(fs, new Path(base, \"a\"), false, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\".txt\");\n }\n });\n assertEquals(\"File count should match\", 1, statuses.size());\n assertEquals(\"File name should match\", \"f.txt\", statuses.get(0).getPath().getName());\n }",
"class_method_signature": "DrillFileSystemUtilTest.testListFilesWithFilter()",
"constructor": false,
"full_signature": "@Test public void testListFilesWithFilter()",
"identifier": "testListFilesWithFilter",
"invocations": [
"listFiles",
"endsWith",
"getName",
"assertEquals",
"size",
"assertEquals",
"getName",
"getPath",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListFilesWithFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };",
"type": "PathFilter",
"var_name": "DRILL_SYSTEM_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java",
"identifier": "DrillFileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listFiles(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }",
"class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"invocations": [
"listFiles",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_81 | {
"fields": [
{
"declarator": "writer",
"modifier": "private static",
"original_string": "private static VectorContainerWriter writer;",
"type": "VectorContainerWriter",
"var_name": "writer"
},
{
"declarator": "mutator",
"modifier": "private static",
"original_string": "private static TestOutputMutator mutator;",
"type": "TestOutputMutator",
"var_name": "mutator"
},
{
"declarator": "bsonReader",
"modifier": "private static",
"original_string": "private static BsonRecordReader bsonReader;",
"type": "BsonRecordReader",
"var_name": "bsonReader"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java",
"identifier": "TestBsonRecordReader",
"interfaces": "",
"superclass": "extends BaseTestQuery"
} | {
"body": "@Test\n public void testNullType() throws IOException {\n BsonDocument bsonDoc = new BsonDocument();\n bsonDoc.append(\"nullKey\", new BsonNull());\n writer.reset();\n bsonReader.write(writer, new BsonDocumentReader(bsonDoc));\n SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();\n assertEquals(null, mapReader.reader(\"nullKey\").readObject());\n }",
"class_method_signature": "TestBsonRecordReader.testNullType()",
"constructor": false,
"full_signature": "@Test public void testNullType()",
"identifier": "testNullType",
"invocations": [
"append",
"reset",
"write",
"getReader",
"getMapVector",
"assertEquals",
"readObject",
"reader"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testNullType()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class)",
"modifier": "static final",
"original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "MAX_RECORD_SIZE = 128 * 1024",
"modifier": "public final static",
"original_string": "public final static int MAX_RECORD_SIZE = 128 * 1024;",
"type": "int",
"var_name": "MAX_RECORD_SIZE"
},
{
"declarator": "columns",
"modifier": "private final",
"original_string": "private final List<SchemaPath> columns;",
"type": "List<SchemaPath>",
"var_name": "columns"
},
{
"declarator": "atLeastOneWrite = false",
"modifier": "private",
"original_string": "private boolean atLeastOneWrite = false;",
"type": "boolean",
"var_name": "atLeastOneWrite"
},
{
"declarator": "readNumbersAsDouble",
"modifier": "private final",
"original_string": "private final boolean readNumbersAsDouble;",
"type": "boolean",
"var_name": "readNumbersAsDouble"
},
{
"declarator": "workBuf",
"modifier": "protected",
"original_string": "protected DrillBuf workBuf;",
"type": "DrillBuf",
"var_name": "workBuf"
},
{
"declarator": "currentFieldName",
"modifier": "private",
"original_string": "private String currentFieldName;",
"type": "String",
"var_name": "currentFieldName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java",
"identifier": "BsonRecordReader",
"interfaces": "",
"methods": [
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"constructor": true,
"full_signature": "public BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"identifier": "BsonRecordReader",
"modifiers": "public",
"parameters": "(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"return": "",
"signature": " BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"constructor": false,
"full_signature": "private void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"identifier": "writeToListOrMap",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"return": "void",
"signature": "void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeTimeStamp",
"modifiers": "private",
"parameters": "(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeString",
"modifiers": "private",
"parameters": "(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeObjectId",
"modifiers": "private",
"parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDouble",
"modifiers": "private",
"parameters": "(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeDateTime",
"modifiers": "private",
"parameters": "(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeBoolean",
"modifiers": "private",
"parameters": "(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"constructor": false,
"full_signature": "private void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"identifier": "writeBinary",
"modifiers": "private",
"parameters": "(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"return": "void",
"signature": "void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt64",
"modifiers": "private",
"parameters": "(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"constructor": false,
"full_signature": "private void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"identifier": "writeInt32",
"modifiers": "private",
"parameters": "(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"return": "void",
"signature": "void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensureAtLeastOneField(ComplexWriter writer)",
"constructor": false,
"full_signature": "public void ensureAtLeastOneField(ComplexWriter writer)",
"identifier": "ensureAtLeastOneField",
"modifiers": "public",
"parameters": "(ComplexWriter writer)",
"return": "void",
"signature": "void ensureAtLeastOneField(ComplexWriter writer)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"constructor": false,
"full_signature": "public UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"identifier": "getExceptionWithContext",
"modifiers": "public",
"parameters": "(Throwable exception, String field, String msg, Object... args)",
"return": "UserException.Builder",
"signature": "UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)",
"testcase": false
},
{
"class_method_signature": "BsonRecordReader.ensure(final int length)",
"constructor": false,
"full_signature": "private void ensure(final int length)",
"identifier": "ensure",
"modifiers": "private",
"parameters": "(final int length)",
"return": "void",
"signature": "void ensure(final int length)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void write(ComplexWriter writer, BsonReader reader) throws IOException {\n reader.readStartDocument();\n BsonType readBsonType = reader.getCurrentBsonType();\n switch (readBsonType) {\n case DOCUMENT:\n writeToListOrMap(reader, new MapOrListWriterImpl(writer.rootAsMap()), false, null);\n break;\n default:\n throw new DrillRuntimeException(\"Root object must be DOCUMENT type. Found: \" + readBsonType);\n }\n }",
"class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)",
"constructor": false,
"full_signature": "public void write(ComplexWriter writer, BsonReader reader)",
"identifier": "write",
"invocations": [
"readStartDocument",
"getCurrentBsonType",
"writeToListOrMap",
"rootAsMap"
],
"modifiers": "public",
"parameters": "(ComplexWriter writer, BsonReader reader)",
"return": "void",
"signature": "void write(ComplexWriter writer, BsonReader reader)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_15 | {
"fields": [
{
"declarator": "N1_EP1 = newDrillbitEndpoint(\"node1\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP1 = newDrillbitEndpoint(\"node1\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP1"
},
{
"declarator": "N1_EP2 = newDrillbitEndpoint(\"node1\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N1_EP2 = newDrillbitEndpoint(\"node1\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N1_EP2"
},
{
"declarator": "N2_EP1 = newDrillbitEndpoint(\"node2\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP1 = newDrillbitEndpoint(\"node2\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP1"
},
{
"declarator": "N2_EP2 = newDrillbitEndpoint(\"node2\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N2_EP2 = newDrillbitEndpoint(\"node2\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N2_EP2"
},
{
"declarator": "N3_EP1 = newDrillbitEndpoint(\"node3\", 30010)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP1 = newDrillbitEndpoint(\"node3\", 30010);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP1"
},
{
"declarator": "N3_EP2 = newDrillbitEndpoint(\"node3\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N3_EP2 = newDrillbitEndpoint(\"node3\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N3_EP2"
},
{
"declarator": "N4_EP2 = newDrillbitEndpoint(\"node4\", 30011)",
"modifier": "private static final",
"original_string": "private static final DrillbitEndpoint N4_EP2 = newDrillbitEndpoint(\"node4\", 30011);",
"type": "DrillbitEndpoint",
"var_name": "N4_EP2"
},
{
"declarator": "fragment",
"modifier": "@Mocked private",
"original_string": "@Mocked private Fragment fragment;",
"type": "Fragment",
"var_name": "fragment"
},
{
"declarator": "root",
"modifier": "@Mocked private",
"original_string": "@Mocked private PhysicalOperator root;",
"type": "PhysicalOperator",
"var_name": "root"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/planner/fragment/TestHardAffinityFragmentParallelizer.java",
"identifier": "TestHardAffinityFragmentParallelizer",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void multiNodeClusterNegative2() throws Exception {\n final Wrapper wrapper = newWrapper(200, 1, 3,\n ImmutableList.of(\n new EndpointAffinity(N1_EP2, 0.15, true, MAX_VALUE),\n new EndpointAffinity(N2_EP2, 0.15, true, MAX_VALUE),\n new EndpointAffinity(N3_EP1, 0.10, true, MAX_VALUE),\n new EndpointAffinity(N4_EP2, 0.20, true, MAX_VALUE),\n new EndpointAffinity(N1_EP1, 0.20, true, MAX_VALUE)\n ));\n\n try {\n INSTANCE.parallelizeFragment(wrapper, newParameters(1, 2, 2), null);\n fail(\"Expected an exception, because max fragment width (3) is less than the number of mandatory nodes (5)\");\n } catch (Exception e) {\n // ok\n }\n }",
"class_method_signature": "TestHardAffinityFragmentParallelizer.multiNodeClusterNegative2()",
"constructor": false,
"full_signature": "@Test public void multiNodeClusterNegative2()",
"identifier": "multiNodeClusterNegative2",
"invocations": [
"newWrapper",
"of",
"parallelizeFragment",
"newParameters",
"fail"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void multiNodeClusterNegative2()",
"testcase": true
} | {
"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);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "INSTANCE = new HardAffinityFragmentParallelizer()",
"modifier": "public static final",
"original_string": "public static final HardAffinityFragmentParallelizer INSTANCE = new HardAffinityFragmentParallelizer();",
"type": "HardAffinityFragmentParallelizer",
"var_name": "INSTANCE"
},
{
"declarator": "EOL = System.getProperty(\"line.separator\")",
"modifier": "private static",
"original_string": "private static String EOL = System.getProperty(\"line.separator\");",
"type": "String",
"var_name": "EOL"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/HardAffinityFragmentParallelizer.java",
"identifier": "HardAffinityFragmentParallelizer",
"interfaces": "implements FragmentParallelizer",
"methods": [
{
"class_method_signature": "HardAffinityFragmentParallelizer.HardAffinityFragmentParallelizer()",
"constructor": true,
"full_signature": "private HardAffinityFragmentParallelizer()",
"identifier": "HardAffinityFragmentParallelizer",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " HardAffinityFragmentParallelizer()",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
},
{
"class_method_signature": "HardAffinityFragmentParallelizer.checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"constructor": false,
"full_signature": "private static void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"identifier": "checkOrThrow",
"modifiers": "private static",
"parameters": "(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"return": "void",
"signature": "void checkOrThrow(final boolean expr, final Logger logger, final String errMsg, Object... args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Override\n public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints) throws PhysicalOperatorSetupException {\n\n final Stats stats = fragmentWrapper.getStats();\n final ParallelizationInfo pInfo = stats.getParallelizationInfo();\n\n int totalMaxWidth = 0;\n\n // Go through the affinity map and extract the endpoints that have mandatory assignment requirement\n final Map<DrillbitEndpoint, EndpointAffinity> endpointPool = Maps.newHashMap();\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : pInfo.getEndpointAffinityMap().entrySet()) {\n if (entry.getValue().isAssignmentRequired()) {\n endpointPool.put(entry.getKey(), entry.getValue());\n\n // Limit the max width of the endpoint to allowed max width.\n totalMaxWidth += Math.min(parameters.getMaxWidthPerNode(), entry.getValue().getMaxWidth());\n if (totalMaxWidth < 0) {\n // If the totalWidth overflows, just keep it at the max value.\n totalMaxWidth = Integer.MAX_VALUE;\n }\n }\n }\n\n // Step 1: Find the width taking into various parameters\n // 1.1. Find the parallelization based on cost. Use max cost of all operators in this fragment; this is consistent\n // with the calculation that ExcessiveExchangeRemover uses.\n int width = (int) Math.ceil(stats.getMaxCost() / parameters.getSliceTarget());\n\n // 1.2. Make sure the width is at least the number of endpoints that require an assignment\n width = Math.max(endpointPool.size(), width);\n\n // 1.3. Cap the parallelization width by fragment level width limit and system level per query width limit\n width = Math.max(1, Math.min(width, pInfo.getMaxWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed fragment max \" +\n \"width ({}).\", endpointPool.size(), pInfo.getMaxWidth());\n\n // 1.4 Cap the parallelization width by global max query width\n width = Math.max(1, Math.min(width, parameters.getMaxGlobalWidth()));\n checkOrThrow(endpointPool.size() <= width, logger,\n \"Number of mandatory endpoints ({}) that require an assignment is more than the allowed global query \" +\n \"width ({}).\", endpointPool.size(), parameters.getMaxGlobalWidth());\n\n // 1.5 Cap the parallelization width by max allowed parallelization per node\n width = Math.max(1, Math.min(width, endpointPool.size()*parameters.getMaxWidthPerNode()));\n\n // 1.6 Cap the parallelization width by total of max allowed width per node. The reason is if we the width is more,\n // we end up allocating more work units to one or more endpoints that don't have those many work units.\n width = Math.min(totalMaxWidth, width);\n\n // Step 2: Select the endpoints\n final Map<DrillbitEndpoint, Integer> endpoints = Maps.newHashMap();\n\n // 2.1 First add each endpoint from the pool once so that the mandatory assignment requirement is fulfilled.\n for(Entry<DrillbitEndpoint, EndpointAffinity> entry : endpointPool.entrySet()) {\n endpoints.put(entry.getKey(), 1);\n }\n int totalAssigned = endpoints.size();\n\n // 2.2 Assign the remaining slots to endpoints proportional to the affinity of each endpoint\n int remainingSlots = width - endpoints.size();\n while (remainingSlots > 0) {\n for(EndpointAffinity epAf : endpointPool.values()) {\n final int moreAllocation = (int) Math.ceil(epAf.getAffinity() * remainingSlots);\n int currentAssignments = endpoints.get(epAf.getEndpoint());\n for(int i=0;\n i < moreAllocation &&\n totalAssigned < width &&\n currentAssignments < parameters.getMaxWidthPerNode() &&\n currentAssignments < epAf.getMaxWidth();\n i++) {\n totalAssigned++;\n currentAssignments++;\n }\n endpoints.put(epAf.getEndpoint(), currentAssignments);\n }\n final int previousRemainingSlots = remainingSlots;\n remainingSlots = width - totalAssigned;\n if (previousRemainingSlots == remainingSlots) {\n logger.error(\"Can't parallelize fragment: \" +\n \"Every mandatory node has exhausted the maximum width per node limit.\" + EOL +\n \"Endpoint pool: {}\" + EOL + \"Assignment so far: {}\" + EOL + \"Width: {}\", endpointPool, endpoints, width);\n throw new PhysicalOperatorSetupException(\"Can not parallelize fragment.\");\n }\n }\n\n final List<DrillbitEndpoint> assignedEndpoints = Lists.newArrayList();\n for(Entry<DrillbitEndpoint, Integer> entry : endpoints.entrySet()) {\n for(int i=0; i < entry.getValue(); i++) {\n assignedEndpoints.add(entry.getKey());\n }\n }\n\n fragmentWrapper.setWidth(width);\n fragmentWrapper.assignEndpoints(assignedEndpoints);\n }",
"class_method_signature": "HardAffinityFragmentParallelizer.parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"constructor": false,
"full_signature": "@Override public void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"identifier": "parallelizeFragment",
"invocations": [
"getStats",
"getParallelizationInfo",
"newHashMap",
"entrySet",
"getEndpointAffinityMap",
"isAssignmentRequired",
"getValue",
"put",
"getKey",
"getValue",
"min",
"getMaxWidthPerNode",
"getMaxWidth",
"getValue",
"ceil",
"getMaxCost",
"getSliceTarget",
"max",
"size",
"max",
"min",
"getMaxWidth",
"checkOrThrow",
"size",
"size",
"getMaxWidth",
"max",
"min",
"getMaxGlobalWidth",
"checkOrThrow",
"size",
"size",
"getMaxGlobalWidth",
"max",
"min",
"size",
"getMaxWidthPerNode",
"min",
"newHashMap",
"entrySet",
"put",
"getKey",
"size",
"size",
"values",
"ceil",
"getAffinity",
"get",
"getEndpoint",
"getMaxWidthPerNode",
"getMaxWidth",
"put",
"getEndpoint",
"error",
"newArrayList",
"entrySet",
"getValue",
"add",
"getKey",
"setWidth",
"assignEndpoints"
],
"modifiers": "@Override public",
"parameters": "(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"return": "void",
"signature": "void parallelizeFragment(final Wrapper fragmentWrapper, final ParallelizationParameters parameters,\n final Collection<DrillbitEndpoint> activeEndpoints)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_42 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java",
"identifier": "DrillFileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListAllWithoutFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listAll(fs, new Path(base, \"a\"), false);\n assertEquals(\"File count should match\", 2, statuses.size());\n\n Collections.sort(statuses);\n assertEquals(\"File name should match\", \"aa\", statuses.get(0).getPath().getName());\n assertEquals(\"File name should match\", \"f.txt\", statuses.get(1).getPath().getName());\n }",
"class_method_signature": "DrillFileSystemUtilTest.testListAllWithoutFilter()",
"constructor": false,
"full_signature": "@Test public void testListAllWithoutFilter()",
"identifier": "testListAllWithoutFilter",
"invocations": [
"listAll",
"assertEquals",
"size",
"sort",
"assertEquals",
"getName",
"getPath",
"get",
"assertEquals",
"getName",
"getPath",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListAllWithoutFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };",
"type": "PathFilter",
"var_name": "DRILL_SYSTEM_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java",
"identifier": "DrillFileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listAll(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }",
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"invocations": [
"listAll",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_102 | {
"fields": [
{
"declarator": "config = DrillConfig.create()",
"modifier": "private final",
"original_string": "private final DrillConfig config = DrillConfig.create();",
"type": "DrillConfig",
"var_name": "config"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/client/DrillClientTest.java",
"identifier": "DrillClientTest",
"interfaces": "",
"superclass": "extends DrillSystemTestBase"
} | {
"body": "@Test\n public void testParseAndVerifyEndpointsEmptyString() throws Exception {\n\n // Test with empty string\n final String drillBitConnection = \"\";\n try {\n final List<CoordinationProtos.DrillbitEndpoint> endpointsList = DrillClient.parseAndVerifyEndpoints\n (drillBitConnection, config.getString(ExecConstants.INITIAL_USER_PORT));\n fail();\n } catch (InvalidConnectionInfoException e) {\n System.out.println(e.getMessage());\n }\n }",
"class_method_signature": "DrillClientTest.testParseAndVerifyEndpointsEmptyString()",
"constructor": false,
"full_signature": "@Test public void testParseAndVerifyEndpointsEmptyString()",
"identifier": "testParseAndVerifyEndpointsEmptyString",
"invocations": [
"parseAndVerifyEndpoints",
"getString",
"fail",
"println",
"getMessage"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testParseAndVerifyEndpointsEmptyString()",
"testcase": true
} | {
"fields": [
{
"declarator": "DEFAULT_CLIENT_NAME = \"Apache Drill Java client\"",
"modifier": "public static final",
"original_string": "public static final String DEFAULT_CLIENT_NAME = \"Apache Drill Java client\";",
"type": "String",
"var_name": "DEFAULT_CLIENT_NAME"
},
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "objectMapper = new ObjectMapper()",
"modifier": "private static final",
"original_string": "private static final ObjectMapper objectMapper = new ObjectMapper();",
"type": "ObjectMapper",
"var_name": "objectMapper"
},
{
"declarator": "config",
"modifier": "private final",
"original_string": "private final DrillConfig config;",
"type": "DrillConfig",
"var_name": "config"
},
{
"declarator": "client",
"modifier": "private",
"original_string": "private UserClient client;",
"type": "UserClient",
"var_name": "client"
},
{
"declarator": "properties",
"modifier": "private",
"original_string": "private DrillProperties properties;",
"type": "DrillProperties",
"var_name": "properties"
},
{
"declarator": "clusterCoordinator",
"modifier": "private volatile",
"original_string": "private volatile ClusterCoordinator clusterCoordinator;",
"type": "ClusterCoordinator",
"var_name": "clusterCoordinator"
},
{
"declarator": "connected = false",
"modifier": "private volatile",
"original_string": "private volatile boolean connected = false;",
"type": "boolean",
"var_name": "connected"
},
{
"declarator": "allocator",
"modifier": "private final",
"original_string": "private final BufferAllocator allocator;",
"type": "BufferAllocator",
"var_name": "allocator"
},
{
"declarator": "reconnectTimes",
"modifier": "private",
"original_string": "private int reconnectTimes;",
"type": "int",
"var_name": "reconnectTimes"
},
{
"declarator": "reconnectDelay",
"modifier": "private",
"original_string": "private int reconnectDelay;",
"type": "int",
"var_name": "reconnectDelay"
},
{
"declarator": "supportComplexTypes",
"modifier": "private",
"original_string": "private boolean supportComplexTypes;",
"type": "boolean",
"var_name": "supportComplexTypes"
},
{
"declarator": "ownsZkConnection",
"modifier": "private final",
"original_string": "private final boolean ownsZkConnection;",
"type": "boolean",
"var_name": "ownsZkConnection"
},
{
"declarator": "ownsAllocator",
"modifier": "private final",
"original_string": "private final boolean ownsAllocator;",
"type": "boolean",
"var_name": "ownsAllocator"
},
{
"declarator": "isDirectConnection",
"modifier": "private final",
"original_string": "private final boolean isDirectConnection;",
"type": "boolean",
"var_name": "isDirectConnection"
},
{
"declarator": "eventLoopGroup",
"modifier": "private",
"original_string": "private EventLoopGroup eventLoopGroup;",
"type": "EventLoopGroup",
"var_name": "eventLoopGroup"
},
{
"declarator": "executor",
"modifier": "private",
"original_string": "private ExecutorService executor;",
"type": "ExecutorService",
"var_name": "executor"
},
{
"declarator": "clientName = DEFAULT_CLIENT_NAME",
"modifier": "private",
"original_string": "private String clientName = DEFAULT_CLIENT_NAME;",
"type": "String",
"var_name": "clientName"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java",
"identifier": "DrillClient",
"interfaces": "implements Closeable, ConnectionThrottle",
"methods": [
{
"class_method_signature": "DrillClient.DrillClient()",
"constructor": true,
"full_signature": "public DrillClient()",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " DrillClient()",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(boolean isDirect)",
"return": "",
"signature": " DrillClient(boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(String fileName)",
"constructor": true,
"full_signature": "public DrillClient(String fileName)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(String fileName)",
"return": "",
"signature": " DrillClient(String fileName)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config)",
"return": "",
"signature": " DrillClient(DrillConfig config)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator)",
"testcase": false
},
{
"class_method_signature": "DrillClient.DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"constructor": true,
"full_signature": "public DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"identifier": "DrillClient",
"modifiers": "public",
"parameters": "(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"return": "",
"signature": " DrillClient(DrillConfig config, ClusterCoordinator coordinator, BufferAllocator allocator, boolean isDirect)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getConfig()",
"constructor": false,
"full_signature": "public DrillConfig getConfig()",
"identifier": "getConfig",
"modifiers": "public",
"parameters": "()",
"return": "DrillConfig",
"signature": "DrillConfig getConfig()",
"testcase": false
},
{
"class_method_signature": "DrillClient.setAutoRead(boolean enableAutoRead)",
"constructor": false,
"full_signature": "@Override public void setAutoRead(boolean enableAutoRead)",
"identifier": "setAutoRead",
"modifiers": "@Override public",
"parameters": "(boolean enableAutoRead)",
"return": "void",
"signature": "void setAutoRead(boolean enableAutoRead)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setClientName(String name)",
"constructor": false,
"full_signature": "public void setClientName(String name)",
"identifier": "setClientName",
"modifiers": "public",
"parameters": "(String name)",
"return": "void",
"signature": "void setClientName(String name)",
"testcase": false
},
{
"class_method_signature": "DrillClient.setSupportComplexTypes(boolean supportComplexTypes)",
"constructor": false,
"full_signature": "public void setSupportComplexTypes(boolean supportComplexTypes)",
"identifier": "setSupportComplexTypes",
"modifiers": "public",
"parameters": "(boolean supportComplexTypes)",
"return": "void",
"signature": "void setSupportComplexTypes(boolean supportComplexTypes)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect()",
"constructor": false,
"full_signature": "public void connect()",
"identifier": "connect",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void connect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(Properties props)",
"constructor": false,
"full_signature": "public void connect(Properties props)",
"identifier": "connect",
"modifiers": "public",
"parameters": "(Properties props)",
"return": "void",
"signature": "void connect(Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(String connect, Properties props)",
"constructor": false,
"full_signature": "public synchronized void connect(String connect, Properties props)",
"identifier": "connect",
"modifiers": "public synchronized",
"parameters": "(String connect, Properties props)",
"return": "void",
"signature": "void connect(String connect, Properties props)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createEventLoop(int size, String prefix)",
"constructor": false,
"full_signature": "protected static EventLoopGroup createEventLoop(int size, String prefix)",
"identifier": "createEventLoop",
"modifiers": "protected static",
"parameters": "(int size, String prefix)",
"return": "EventLoopGroup",
"signature": "EventLoopGroup createEventLoop(int size, String prefix)",
"testcase": false
},
{
"class_method_signature": "DrillClient.reconnect()",
"constructor": false,
"full_signature": "public synchronized boolean reconnect()",
"identifier": "reconnect",
"modifiers": "public synchronized",
"parameters": "()",
"return": "boolean",
"signature": "boolean reconnect()",
"testcase": false
},
{
"class_method_signature": "DrillClient.connect(DrillbitEndpoint endpoint)",
"constructor": false,
"full_signature": "private void connect(DrillbitEndpoint endpoint)",
"identifier": "connect",
"modifiers": "private",
"parameters": "(DrillbitEndpoint endpoint)",
"return": "void",
"signature": "void connect(DrillbitEndpoint endpoint)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getAllocator()",
"constructor": false,
"full_signature": "public BufferAllocator getAllocator()",
"identifier": "getAllocator",
"modifiers": "public",
"parameters": "()",
"return": "BufferAllocator",
"signature": "BufferAllocator getAllocator()",
"testcase": false
},
{
"class_method_signature": "DrillClient.close()",
"constructor": false,
"full_signature": "@Override public void close()",
"identifier": "close",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void close()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerInfos()",
"constructor": false,
"full_signature": "@Deprecated public RpcEndpointInfos getServerInfos()",
"identifier": "getServerInfos",
"modifiers": "@Deprecated public",
"parameters": "()",
"return": "RpcEndpointInfos",
"signature": "RpcEndpointInfos getServerInfos()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerName()",
"constructor": false,
"full_signature": "public String getServerName()",
"identifier": "getServerName",
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "String getServerName()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerVersion()",
"constructor": false,
"full_signature": "public Version getServerVersion()",
"identifier": "getServerVersion",
"modifiers": "public",
"parameters": "()",
"return": "Version",
"signature": "Version getServerVersion()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getServerMeta()",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"identifier": "getServerMeta",
"modifiers": "public",
"parameters": "()",
"return": "DrillRpcFuture<GetServerMetaResp>",
"signature": "DrillRpcFuture<GetServerMetaResp> getServerMeta()",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSupportedMethods()",
"constructor": false,
"full_signature": "public Set<ServerMethod> getSupportedMethods()",
"identifier": "getSupportedMethods",
"modifiers": "public",
"parameters": "()",
"return": "Set<ServerMethod>",
"signature": "Set<ServerMethod> getSupportedMethods()",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan)",
"constructor": false,
"full_signature": "public List<QueryDataBatch> runQuery(QueryType type, String plan)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> runQuery(QueryType type, String plan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.planQuery(QueryType type, String query, boolean isSplitPlan)",
"constructor": false,
"full_signature": "public DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"identifier": "planQuery",
"modifiers": "public",
"parameters": "(QueryType type, String query, boolean isSplitPlan)",
"return": "DrillRpcFuture<QueryPlanFragments>",
"signature": "DrillRpcFuture<QueryPlanFragments> planQuery(QueryType type, String query, boolean isSplitPlan)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, List<PlanFragment> planFragments, UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getUserCredentials()",
"constructor": false,
"full_signature": "private UserBitShared.UserCredentials getUserCredentials()",
"identifier": "getUserCredentials",
"modifiers": "private",
"parameters": "()",
"return": "UserBitShared.UserCredentials",
"signature": "UserBitShared.UserCredentials getUserCredentials()",
"testcase": false
},
{
"class_method_signature": "DrillClient.cancelQuery(QueryId id)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"identifier": "cancelQuery",
"modifiers": "public",
"parameters": "(QueryId id)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> cancelQuery(QueryId id)",
"testcase": false
},
{
"class_method_signature": "DrillClient.resumeQuery(final QueryId queryId)",
"constructor": false,
"full_signature": "public DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"identifier": "resumeQuery",
"modifiers": "public",
"parameters": "(final QueryId queryId)",
"return": "DrillRpcFuture<Ack>",
"signature": "DrillRpcFuture<Ack> resumeQuery(final QueryId queryId)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getCatalogs(LikeFilter catalogNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"identifier": "getCatalogs",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter)",
"return": "DrillRpcFuture<GetCatalogsResp>",
"signature": "DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"identifier": "getSchemas",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"return": "DrillRpcFuture<GetSchemasResp>",
"signature": "DrillRpcFuture<GetSchemasResp> getSchemas(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"identifier": "getTables",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"return": "DrillRpcFuture<GetTablesResp>",
"signature": "DrillRpcFuture<GetTablesResp> getTables(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, List<String> tableTypeFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"constructor": false,
"full_signature": "public DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"identifier": "getColumns",
"modifiers": "public",
"parameters": "(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"return": "DrillRpcFuture<GetColumnsResp>",
"signature": "DrillRpcFuture<GetColumnsResp> getColumns(LikeFilter catalogNameFilter, LikeFilter schemaNameFilter,\n LikeFilter tableNameFilter, LikeFilter columnNameFilter)",
"testcase": false
},
{
"class_method_signature": "DrillClient.createPreparedStatement(final String query)",
"constructor": false,
"full_signature": "public DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"identifier": "createPreparedStatement",
"modifiers": "public",
"parameters": "(final String query)",
"return": "DrillRpcFuture<CreatePreparedStatementResp>",
"signature": "DrillRpcFuture<CreatePreparedStatementResp> createPreparedStatement(final String query)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"identifier": "executePreparedStatement",
"modifiers": "public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"return": "void",
"signature": "void executePreparedStatement(final PreparedStatementHandle preparedStatementHandle,\n final UserResultsListener resultsListener)",
"testcase": false
},
{
"class_method_signature": "DrillClient.executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"constructor": false,
"full_signature": "@VisibleForTesting public List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"identifier": "executePreparedStatement",
"modifiers": "@VisibleForTesting public",
"parameters": "(final PreparedStatementHandle preparedStatementHandle)",
"return": "List<QueryDataBatch>",
"signature": "List<QueryDataBatch> executePreparedStatement(final PreparedStatementHandle preparedStatementHandle)",
"testcase": false
},
{
"class_method_signature": "DrillClient.runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"constructor": false,
"full_signature": "public void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"identifier": "runQuery",
"modifiers": "public",
"parameters": "(QueryType type, String plan, UserResultsListener resultsListener)",
"return": "void",
"signature": "void runQuery(QueryType type, String plan, UserResultsListener resultsListener)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)\n throws InvalidConnectionInfoException {\n // If no drillbits is provided then throw exception\n drillbits = drillbits.trim();\n if (drillbits.isEmpty()) {\n throw new InvalidConnectionInfoException(\"No drillbit information specified in the connection string\");\n }\n\n final List<DrillbitEndpoint> endpointList = new ArrayList<>();\n final String[] connectInfo = drillbits.split(\",\");\n\n // Fetch ip address and port information for each drillbit and populate the list\n for (String drillbit : connectInfo) {\n\n // Trim all the empty spaces and check if the entry is empty string.\n // Ignore the empty ones.\n drillbit = drillbit.trim();\n\n if (!drillbit.isEmpty()) {\n // Verify if we have only \":\" or only \":port\" pattern\n if (drillbit.charAt(0) == ':') {\n // Invalid drillbit information\n throw new InvalidConnectionInfoException(\"Malformed connection string with drillbit hostname or \" +\n \"hostaddress missing for an entry: \" + drillbit);\n }\n\n // We are now sure that each ip:port entry will have both the values atleast once.\n // Split each drillbit connection string to get ip address and port value\n final String[] drillbitInfo = drillbit.split(\":\");\n\n // Check if we have more than one port\n if (drillbitInfo.length > 2) {\n throw new InvalidConnectionInfoException(\"Malformed connection string with more than one port in a \" +\n \"drillbit entry: \" + drillbit);\n }\n\n // At this point we are sure that drillbitInfo has atleast hostname or host address\n // trim all the empty spaces which might be present in front of hostname or\n // host address information\n final String ipAddress = drillbitInfo[0].trim();\n String port = defaultUserPort;\n\n if (drillbitInfo.length == 2) {\n // We have a port value also given by user. trim all the empty spaces between : and port value before\n // validating the correctness of value.\n port = drillbitInfo[1].trim();\n }\n\n try {\n final DrillbitEndpoint endpoint = DrillbitEndpoint.newBuilder()\n .setAddress(ipAddress)\n .setUserPort(Integer.parseInt(port))\n .build();\n\n endpointList.add(endpoint);\n } catch (NumberFormatException e) {\n throw new InvalidConnectionInfoException(\"Malformed port value in entry: \" + ipAddress + \":\" + port + \" \" +\n \"passed in connection string\");\n }\n }\n }\n if (endpointList.size() == 0) {\n throw new InvalidConnectionInfoException(\"No valid drillbit information specified in the connection string\");\n }\n return endpointList;\n }",
"class_method_signature": "DrillClient.parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"constructor": false,
"full_signature": "static List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"identifier": "parseAndVerifyEndpoints",
"invocations": [
"trim",
"isEmpty",
"split",
"trim",
"isEmpty",
"charAt",
"split",
"trim",
"trim",
"build",
"setUserPort",
"setAddress",
"newBuilder",
"parseInt",
"add",
"size"
],
"modifiers": "static",
"parameters": "(String drillbits, String defaultUserPort)",
"return": "List<DrillbitEndpoint>",
"signature": "List<DrillbitEndpoint> parseAndVerifyEndpoints(String drillbits, String defaultUserPort)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_23 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListFilesRecursiveWithoutFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listFiles(fs, base, true);\n assertEquals(\"File count should match\", 11, statuses.size());\n }",
"class_method_signature": "FileSystemUtilTest.testListFilesRecursiveWithoutFilter()",
"constructor": false,
"full_signature": "@Test public void testListFilesRecursiveWithoutFilter()",
"identifier": "testListFilesRecursiveWithoutFilter",
"invocations": [
"listFiles",
"assertEquals",
"size"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListFilesRecursiveWithoutFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listFiles(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }",
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"invocations": [
"listFiles",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_35 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java",
"identifier": "DrillFileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListDirectoriesWithFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listDirectories(fs, base, false, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\"a\");\n }\n });\n assertEquals(\"Directory count should match\", 1, statuses.size());\n assertEquals(\"Directory name should match\", \"a\", statuses.get(0).getPath().getName());\n }",
"class_method_signature": "DrillFileSystemUtilTest.testListDirectoriesWithFilter()",
"constructor": false,
"full_signature": "@Test public void testListDirectoriesWithFilter()",
"identifier": "testListDirectoriesWithFilter",
"invocations": [
"listDirectories",
"endsWith",
"getName",
"assertEquals",
"size",
"assertEquals",
"getName",
"getPath",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListDirectoriesWithFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };",
"type": "PathFilter",
"var_name": "DRILL_SYSTEM_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java",
"identifier": "DrillFileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listDirectories(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }",
"class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"invocations": [
"listDirectories",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_62 | {
"fields": [
{
"declarator": "built_in = \"built-in\"",
"modifier": "private static final",
"original_string": "private static final String built_in = \"built-in\";",
"type": "String",
"var_name": "built_in"
},
{
"declarator": "udf_jar = \"DrillUDF-1.0.jar\"",
"modifier": "private static final",
"original_string": "private static final String udf_jar = \"DrillUDF-1.0.jar\";",
"type": "String",
"var_name": "udf_jar"
},
{
"declarator": "newJars",
"modifier": "private static",
"original_string": "private static Map<String, List<FunctionHolder>> newJars;",
"type": "Map<String, List<FunctionHolder>>",
"var_name": "newJars"
},
{
"declarator": "registryHolder",
"modifier": "private",
"original_string": "private FunctionRegistryHolder registryHolder;",
"type": "FunctionRegistryHolder",
"var_name": "registryHolder"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolderTest.java",
"identifier": "FunctionRegistryHolderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetAllFunctionsWithSignatures() {\n ListMultimap<String, String> expectedResult = ArrayListMultimap.create();\n for (List<FunctionHolder> functionHolders : newJars.values()) {\n for(FunctionHolder functionHolder : functionHolders) {\n expectedResult.put(functionHolder.getName(), functionHolder.getSignature());\n }\n }\n compareListMultimaps(expectedResult, registryHolder.getAllFunctionsWithSignatures());\n }",
"class_method_signature": "FunctionRegistryHolderTest.testGetAllFunctionsWithSignatures()",
"constructor": false,
"full_signature": "@Test public void testGetAllFunctionsWithSignatures()",
"identifier": "testGetAllFunctionsWithSignatures",
"invocations": [
"create",
"values",
"put",
"getName",
"getSignature",
"compareListMultimaps",
"getAllFunctionsWithSignatures"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetAllFunctionsWithSignatures()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "readWriteLock = new ReentrantReadWriteLock()",
"modifier": "private final",
"original_string": "private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();",
"type": "ReadWriteLock",
"var_name": "readWriteLock"
},
{
"declarator": "readLock = new AutoCloseableLock(readWriteLock.readLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock());",
"type": "AutoCloseableLock",
"var_name": "readLock"
},
{
"declarator": "writeLock = new AutoCloseableLock(readWriteLock.writeLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock());",
"type": "AutoCloseableLock",
"var_name": "writeLock"
},
{
"declarator": "version",
"modifier": "private",
"original_string": "private long version;",
"type": "long",
"var_name": "version"
},
{
"declarator": "jars",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, Queue<String>>> jars;",
"type": "Map<String, Map<String, Queue<String>>>",
"var_name": "jars"
},
{
"declarator": "functions",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, DrillFuncHolder>> functions;",
"type": "Map<String, Map<String, DrillFuncHolder>>",
"var_name": "functions"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolder.java",
"identifier": "FunctionRegistryHolder",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionRegistryHolder.FunctionRegistryHolder()",
"constructor": true,
"full_signature": "public FunctionRegistryHolder()",
"identifier": "FunctionRegistryHolder",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " FunctionRegistryHolder()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getVersion()",
"constructor": false,
"full_signature": "public long getVersion()",
"identifier": "getVersion",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getVersion()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"constructor": false,
"full_signature": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"identifier": "addJars",
"modifiers": "public",
"parameters": "(Map<String, List<FunctionHolder>> newJars, long version)",
"return": "void",
"signature": "void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeJar(String jarName)",
"constructor": false,
"full_signature": "public void removeJar(String jarName)",
"identifier": "removeJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllJarNames()",
"constructor": false,
"full_signature": "public List<String> getAllJarNames()",
"identifier": "getAllJarNames",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getAllJarNames()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getFunctionNamesByJar(String jarName)",
"constructor": false,
"full_signature": "public List<String> getFunctionNamesByJar(String jarName)",
"identifier": "getFunctionNamesByJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "List<String>",
"signature": "List<String> getFunctionNamesByJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders(AtomicLong version)",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "(AtomicLong version)",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders()",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithSignatures()",
"constructor": false,
"full_signature": "public ListMultimap<String, String> getAllFunctionsWithSignatures()",
"identifier": "getAllFunctionsWithSignatures",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, String>",
"signature": "ListMultimap<String, String> getAllFunctionsWithSignatures()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName, AtomicLong version)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName, AtomicLong version)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.containsJar(String jarName)",
"constructor": false,
"full_signature": "public boolean containsJar(String jarName)",
"identifier": "containsJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "boolean",
"signature": "boolean containsJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.functionsSize()",
"constructor": false,
"full_signature": "public int functionsSize()",
"identifier": "functionsSize",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int functionsSize()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getJarNameByFunctionSignature(String functionName, String functionSignature)",
"constructor": false,
"full_signature": "public String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"identifier": "getJarNameByFunctionSignature",
"modifiers": "public",
"parameters": "(String functionName, String functionSignature)",
"return": "String",
"signature": "String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"constructor": false,
"full_signature": "private void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"identifier": "addFunctions",
"modifiers": "private",
"parameters": "(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"return": "void",
"signature": "void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeAllByJar(String jarName)",
"constructor": false,
"full_signature": "private void removeAllByJar(String jarName)",
"identifier": "removeAllByJar",
"modifiers": "private",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeAllByJar(String jarName)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public ListMultimap<String, String> getAllFunctionsWithSignatures() {\n try (AutoCloseableLock lock = readLock.open()) {\n ListMultimap<String, String> functionsWithSignatures = ArrayListMultimap.create();\n for (Map.Entry<String, Map<String, DrillFuncHolder>> function : functions.entrySet()) {\n functionsWithSignatures.putAll(function.getKey(), Lists.newArrayList(function.getValue().keySet()));\n }\n return functionsWithSignatures;\n }\n }",
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithSignatures()",
"constructor": false,
"full_signature": "public ListMultimap<String, String> getAllFunctionsWithSignatures()",
"identifier": "getAllFunctionsWithSignatures",
"invocations": [
"open",
"create",
"entrySet",
"putAll",
"getKey",
"newArrayList",
"keySet",
"getValue"
],
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, String>",
"signature": "ListMultimap<String, String> getAllFunctionsWithSignatures()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_19 | {
"fields": [],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java",
"identifier": "FileSystemUtilTest",
"interfaces": "",
"superclass": "extends FileSystemUtilTestBase"
} | {
"body": "@Test\n public void testListDirectoriesRecursiveWithFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listDirectories(fs, base, true, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\"a\");\n }\n });\n assertEquals(\"Directory count should match\", 4, statuses.size());\n\n Collections.sort(statuses);\n assertEquals(\"Directory name should match\", \".a\", statuses.get(0).getPath().getName());\n assertEquals(\"Directory name should match\", \"_a\", statuses.get(1).getPath().getName());\n assertEquals(\"Directory name should match\", \"a\", statuses.get(2).getPath().getName());\n assertEquals(\"Directory name should match\", \"aa\", statuses.get(3).getPath().getName());\n }",
"class_method_signature": "FileSystemUtilTest.testListDirectoriesRecursiveWithFilter()",
"constructor": false,
"full_signature": "@Test public void testListDirectoriesRecursiveWithFilter()",
"identifier": "testListDirectoriesRecursiveWithFilter",
"invocations": [
"listDirectories",
"endsWith",
"getName",
"assertEquals",
"size",
"sort",
"assertEquals",
"getName",
"getPath",
"get",
"assertEquals",
"getName",
"getPath",
"get",
"assertEquals",
"getName",
"getPath",
"get",
"assertEquals",
"getName",
"getPath",
"get"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testListDirectoriesRecursiveWithFilter()",
"testcase": true
} | {
"fields": [
{
"declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }",
"modifier": "public static final",
"original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };",
"type": "PathFilter",
"var_name": "DUMMY_FILTER"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java",
"identifier": "FileSystemUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listFiles",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listAll",
"modifiers": "public static",
"parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(PathFilter filter, PathFilter[] filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)",
"constructor": false,
"full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)",
"identifier": "mergeFilters",
"modifiers": "public static",
"parameters": "(final PathFilter... filters)",
"return": "PathFilter",
"signature": "PathFilter mergeFilters(final PathFilter... filters)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listDirectories",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listFiles",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
},
{
"class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"constructor": false,
"full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"identifier": "listAll",
"modifiers": "private static",
"parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listDirectories(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }",
"class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"constructor": false,
"full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"identifier": "listDirectories",
"invocations": [
"listDirectories",
"mergeFilters"
],
"modifiers": "public static",
"parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"return": "List<FileStatus>",
"signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
124004218_58 | {
"fields": [
{
"declarator": "built_in = \"built-in\"",
"modifier": "private static final",
"original_string": "private static final String built_in = \"built-in\";",
"type": "String",
"var_name": "built_in"
},
{
"declarator": "udf_jar = \"DrillUDF-1.0.jar\"",
"modifier": "private static final",
"original_string": "private static final String udf_jar = \"DrillUDF-1.0.jar\";",
"type": "String",
"var_name": "udf_jar"
},
{
"declarator": "newJars",
"modifier": "private static",
"original_string": "private static Map<String, List<FunctionHolder>> newJars;",
"type": "Map<String, List<FunctionHolder>>",
"var_name": "newJars"
},
{
"declarator": "registryHolder",
"modifier": "private",
"original_string": "private FunctionRegistryHolder registryHolder;",
"type": "FunctionRegistryHolder",
"var_name": "registryHolder"
}
],
"file": "exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolderTest.java",
"identifier": "FunctionRegistryHolderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRemoveJar() {\n registryHolder.removeJar(built_in);\n assertFalse(\"Jar should be absent\", registryHolder.containsJar(built_in));\n assertTrue(\"Jar should be present\", registryHolder.containsJar(udf_jar));\n assertEquals(\"Functions size should match\", newJars.get(udf_jar).size(), registryHolder.functionsSize());\n }",
"class_method_signature": "FunctionRegistryHolderTest.testRemoveJar()",
"constructor": false,
"full_signature": "@Test public void testRemoveJar()",
"identifier": "testRemoveJar",
"invocations": [
"removeJar",
"assertFalse",
"containsJar",
"assertTrue",
"containsJar",
"assertEquals",
"size",
"get",
"functionsSize"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testRemoveJar()",
"testcase": true
} | {
"fields": [
{
"declarator": "logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class);",
"type": "org.slf4j.Logger",
"var_name": "logger"
},
{
"declarator": "readWriteLock = new ReentrantReadWriteLock()",
"modifier": "private final",
"original_string": "private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();",
"type": "ReadWriteLock",
"var_name": "readWriteLock"
},
{
"declarator": "readLock = new AutoCloseableLock(readWriteLock.readLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock());",
"type": "AutoCloseableLock",
"var_name": "readLock"
},
{
"declarator": "writeLock = new AutoCloseableLock(readWriteLock.writeLock())",
"modifier": "private final",
"original_string": "private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock());",
"type": "AutoCloseableLock",
"var_name": "writeLock"
},
{
"declarator": "version",
"modifier": "private",
"original_string": "private long version;",
"type": "long",
"var_name": "version"
},
{
"declarator": "jars",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, Queue<String>>> jars;",
"type": "Map<String, Map<String, Queue<String>>>",
"var_name": "jars"
},
{
"declarator": "functions",
"modifier": "private final",
"original_string": "private final Map<String, Map<String, DrillFuncHolder>> functions;",
"type": "Map<String, Map<String, DrillFuncHolder>>",
"var_name": "functions"
}
],
"file": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolder.java",
"identifier": "FunctionRegistryHolder",
"interfaces": "",
"methods": [
{
"class_method_signature": "FunctionRegistryHolder.FunctionRegistryHolder()",
"constructor": true,
"full_signature": "public FunctionRegistryHolder()",
"identifier": "FunctionRegistryHolder",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " FunctionRegistryHolder()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getVersion()",
"constructor": false,
"full_signature": "public long getVersion()",
"identifier": "getVersion",
"modifiers": "public",
"parameters": "()",
"return": "long",
"signature": "long getVersion()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"constructor": false,
"full_signature": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"identifier": "addJars",
"modifiers": "public",
"parameters": "(Map<String, List<FunctionHolder>> newJars, long version)",
"return": "void",
"signature": "void addJars(Map<String, List<FunctionHolder>> newJars, long version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeJar(String jarName)",
"constructor": false,
"full_signature": "public void removeJar(String jarName)",
"identifier": "removeJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllJarNames()",
"constructor": false,
"full_signature": "public List<String> getAllJarNames()",
"identifier": "getAllJarNames",
"modifiers": "public",
"parameters": "()",
"return": "List<String>",
"signature": "List<String> getAllJarNames()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getFunctionNamesByJar(String jarName)",
"constructor": false,
"full_signature": "public List<String> getFunctionNamesByJar(String jarName)",
"identifier": "getFunctionNamesByJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "List<String>",
"signature": "List<String> getFunctionNamesByJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders(AtomicLong version)",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "(AtomicLong version)",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders()",
"constructor": false,
"full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"identifier": "getAllFunctionsWithHolders",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, DrillFuncHolder>",
"signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithSignatures()",
"constructor": false,
"full_signature": "public ListMultimap<String, String> getAllFunctionsWithSignatures()",
"identifier": "getAllFunctionsWithSignatures",
"modifiers": "public",
"parameters": "()",
"return": "ListMultimap<String, String>",
"signature": "ListMultimap<String, String> getAllFunctionsWithSignatures()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName, AtomicLong version)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName, AtomicLong version)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName)",
"constructor": false,
"full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"identifier": "getHoldersByFunctionName",
"modifiers": "public",
"parameters": "(String functionName)",
"return": "List<DrillFuncHolder>",
"signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.containsJar(String jarName)",
"constructor": false,
"full_signature": "public boolean containsJar(String jarName)",
"identifier": "containsJar",
"modifiers": "public",
"parameters": "(String jarName)",
"return": "boolean",
"signature": "boolean containsJar(String jarName)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.functionsSize()",
"constructor": false,
"full_signature": "public int functionsSize()",
"identifier": "functionsSize",
"modifiers": "public",
"parameters": "()",
"return": "int",
"signature": "int functionsSize()",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.getJarNameByFunctionSignature(String functionName, String functionSignature)",
"constructor": false,
"full_signature": "public String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"identifier": "getJarNameByFunctionSignature",
"modifiers": "public",
"parameters": "(String functionName, String functionSignature)",
"return": "String",
"signature": "String getJarNameByFunctionSignature(String functionName, String functionSignature)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"constructor": false,
"full_signature": "private void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"identifier": "addFunctions",
"modifiers": "private",
"parameters": "(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"return": "void",
"signature": "void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)",
"testcase": false
},
{
"class_method_signature": "FunctionRegistryHolder.removeAllByJar(String jarName)",
"constructor": false,
"full_signature": "private void removeAllByJar(String jarName)",
"identifier": "removeAllByJar",
"modifiers": "private",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeAllByJar(String jarName)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public void removeJar(String jarName) {\n try (AutoCloseableLock lock = writeLock.open()) {\n removeAllByJar(jarName);\n }\n }",
"class_method_signature": "FunctionRegistryHolder.removeJar(String jarName)",
"constructor": false,
"full_signature": "public void removeJar(String jarName)",
"identifier": "removeJar",
"invocations": [
"open",
"removeAllByJar"
],
"modifiers": "public",
"parameters": "(String jarName)",
"return": "void",
"signature": "void removeJar(String jarName)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 0,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 124004218,
"size": 6036,
"stargazer_count": 12,
"stars": null,
"updates": null,
"url": "https://github.com/zpochen/drill"
} |
5243237_13 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private FailClosureTarget underTest;",
"type": "FailClosureTarget",
"var_name": "underTest"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/FailClosureTargetTest.java",
"identifier": "FailClosureTargetTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void fail_noArgs() throws Exception {\n try {\n underTest.call(new Object[0]);\n }\n catch (MojoExecutionException e) {\n assertThat(e.getMessage(), is(FailClosureTarget.FAILED));\n }\n }",
"class_method_signature": "FailClosureTargetTest.fail_noArgs()",
"constructor": false,
"full_signature": "@Test public void fail_noArgs()",
"identifier": "fail_noArgs",
"invocations": [
"call",
"assertThat",
"getMessage",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void fail_noArgs()",
"testcase": true
} | {
"fields": [
{
"declarator": "FAILED = \"Failed\"",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final String FAILED = \"Failed\";",
"type": "String",
"var_name": "FAILED"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/FailClosureTarget.java",
"identifier": "FailClosureTarget",
"interfaces": "implements ClosureTarget",
"methods": [
{
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Object call(final @Nullable Object[] args) throws Exception {\n if (args == null || args.length == 0) {\n throw new MojoExecutionException(FAILED);\n }\n else if (args.length == 1) {\n if (args[0] instanceof Throwable) {\n Throwable cause = (Throwable) args[0];\n throw new MojoExecutionException(cause.getMessage(), cause);\n }\n else {\n throw new MojoExecutionException(String.valueOf(args[0]));\n }\n }\n else if (args.length == 2) {\n if (args[1] instanceof Throwable) {\n throw new MojoExecutionException(String.valueOf(args[0]), (Throwable) args[1]);\n }\n else {\n throw new Error(\"Invalid arguments to fail(Object, Throwable), second argument must be a Throwable\");\n }\n }\n else {\n throw new Error(\"Too many arguments; expected one of: fail(), fail(Object) or fail(Object, Throwable)\");\n }\n }",
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"invocations": [
"getMessage",
"valueOf",
"valueOf"
],
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_0 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private GroovyRuntimeFactory underTest;",
"type": "GroovyRuntimeFactory",
"var_name": "underTest"
},
{
"declarator": "classLoader",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ClassLoader classLoader;",
"type": "ClassLoader",
"var_name": "classLoader"
},
{
"declarator": "services",
"modifier": "private",
"original_string": "private List<GroovyRuntime> services;",
"type": "List<GroovyRuntime>",
"var_name": "services"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/GroovyRuntimeFactoryTest.java",
"identifier": "GroovyRuntimeFactoryTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test(expected = IllegalStateException.class)\n public void create_noServices() {\n underTest.create(classLoader);\n fail();\n }",
"class_method_signature": "GroovyRuntimeFactoryTest.create_noServices()",
"constructor": false,
"full_signature": "@Test(expected = IllegalStateException.class) public void create_noServices()",
"identifier": "create_noServices",
"invocations": [
"create",
"fail"
],
"modifiers": "@Test(expected = IllegalStateException.class) public",
"parameters": "()",
"return": "void",
"signature": "void create_noServices()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/GroovyRuntimeFactory.java",
"identifier": "GroovyRuntimeFactory",
"interfaces": "",
"methods": [
{
"class_method_signature": "GroovyRuntimeFactory.create(final ClassLoader classLoader)",
"constructor": false,
"full_signature": "public GroovyRuntime create(final ClassLoader classLoader)",
"identifier": "create",
"modifiers": "public",
"parameters": "(final ClassLoader classLoader)",
"return": "GroovyRuntime",
"signature": "GroovyRuntime create(final ClassLoader classLoader)",
"testcase": false
},
{
"class_method_signature": "GroovyRuntimeFactory.findServices(final ClassLoader classLoader)",
"constructor": false,
"full_signature": "@VisibleForTesting protected Iterator<GroovyRuntime> findServices(final ClassLoader classLoader)",
"identifier": "findServices",
"modifiers": "@VisibleForTesting protected",
"parameters": "(final ClassLoader classLoader)",
"return": "Iterator<GroovyRuntime>",
"signature": "Iterator<GroovyRuntime> findServices(final ClassLoader classLoader)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public GroovyRuntime create(final ClassLoader classLoader) {\n checkNotNull(classLoader);\n\n Iterator<GroovyRuntime> services = findServices(classLoader);\n\n checkState(services.hasNext(), \"No GroovyRuntime service found\");\n\n GroovyRuntime runtime = services.next();\n\n checkState(!services.hasNext(), \"Multiple GroovyRuntime services found\");\n\n log.debug(\"Runtime: {}\", runtime);\n return runtime;\n }",
"class_method_signature": "GroovyRuntimeFactory.create(final ClassLoader classLoader)",
"constructor": false,
"full_signature": "public GroovyRuntime create(final ClassLoader classLoader)",
"identifier": "create",
"invocations": [
"checkNotNull",
"findServices",
"checkState",
"hasNext",
"next",
"checkState",
"hasNext",
"debug"
],
"modifiers": "public",
"parameters": "(final ClassLoader classLoader)",
"return": "GroovyRuntime",
"signature": "GroovyRuntime create(final ClassLoader classLoader)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_1 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private GroovyRuntimeFactory underTest;",
"type": "GroovyRuntimeFactory",
"var_name": "underTest"
},
{
"declarator": "classLoader",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ClassLoader classLoader;",
"type": "ClassLoader",
"var_name": "classLoader"
},
{
"declarator": "services",
"modifier": "private",
"original_string": "private List<GroovyRuntime> services;",
"type": "List<GroovyRuntime>",
"var_name": "services"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/GroovyRuntimeFactoryTest.java",
"identifier": "GroovyRuntimeFactoryTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test(expected = IllegalStateException.class)\n public void create_multipuleServices() {\n services.add(mock(GroovyRuntime.class));\n services.add(mock(GroovyRuntime.class));\n underTest.create(classLoader);\n fail();\n }",
"class_method_signature": "GroovyRuntimeFactoryTest.create_multipuleServices()",
"constructor": false,
"full_signature": "@Test(expected = IllegalStateException.class) public void create_multipuleServices()",
"identifier": "create_multipuleServices",
"invocations": [
"add",
"mock",
"add",
"mock",
"create",
"fail"
],
"modifiers": "@Test(expected = IllegalStateException.class) public",
"parameters": "()",
"return": "void",
"signature": "void create_multipuleServices()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/GroovyRuntimeFactory.java",
"identifier": "GroovyRuntimeFactory",
"interfaces": "",
"methods": [
{
"class_method_signature": "GroovyRuntimeFactory.create(final ClassLoader classLoader)",
"constructor": false,
"full_signature": "public GroovyRuntime create(final ClassLoader classLoader)",
"identifier": "create",
"modifiers": "public",
"parameters": "(final ClassLoader classLoader)",
"return": "GroovyRuntime",
"signature": "GroovyRuntime create(final ClassLoader classLoader)",
"testcase": false
},
{
"class_method_signature": "GroovyRuntimeFactory.findServices(final ClassLoader classLoader)",
"constructor": false,
"full_signature": "@VisibleForTesting protected Iterator<GroovyRuntime> findServices(final ClassLoader classLoader)",
"identifier": "findServices",
"modifiers": "@VisibleForTesting protected",
"parameters": "(final ClassLoader classLoader)",
"return": "Iterator<GroovyRuntime>",
"signature": "Iterator<GroovyRuntime> findServices(final ClassLoader classLoader)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public GroovyRuntime create(final ClassLoader classLoader) {\n checkNotNull(classLoader);\n\n Iterator<GroovyRuntime> services = findServices(classLoader);\n\n checkState(services.hasNext(), \"No GroovyRuntime service found\");\n\n GroovyRuntime runtime = services.next();\n\n checkState(!services.hasNext(), \"Multiple GroovyRuntime services found\");\n\n log.debug(\"Runtime: {}\", runtime);\n return runtime;\n }",
"class_method_signature": "GroovyRuntimeFactory.create(final ClassLoader classLoader)",
"constructor": false,
"full_signature": "public GroovyRuntime create(final ClassLoader classLoader)",
"identifier": "create",
"invocations": [
"checkNotNull",
"findServices",
"checkState",
"hasNext",
"next",
"checkState",
"hasNext",
"debug"
],
"modifiers": "public",
"parameters": "(final ClassLoader classLoader)",
"return": "GroovyRuntime",
"signature": "GroovyRuntime create(final ClassLoader classLoader)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_12 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private FailClosureTarget underTest;",
"type": "FailClosureTarget",
"var_name": "underTest"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/FailClosureTargetTest.java",
"identifier": "FailClosureTargetTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void fail_null() throws Exception {\n try {\n underTest.call(null);\n }\n catch (MojoExecutionException e) {\n assertThat(e.getMessage(), is(FailClosureTarget.FAILED));\n }\n }",
"class_method_signature": "FailClosureTargetTest.fail_null()",
"constructor": false,
"full_signature": "@Test public void fail_null()",
"identifier": "fail_null",
"invocations": [
"call",
"assertThat",
"getMessage",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void fail_null()",
"testcase": true
} | {
"fields": [
{
"declarator": "FAILED = \"Failed\"",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final String FAILED = \"Failed\";",
"type": "String",
"var_name": "FAILED"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/FailClosureTarget.java",
"identifier": "FailClosureTarget",
"interfaces": "implements ClosureTarget",
"methods": [
{
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Object call(final @Nullable Object[] args) throws Exception {\n if (args == null || args.length == 0) {\n throw new MojoExecutionException(FAILED);\n }\n else if (args.length == 1) {\n if (args[0] instanceof Throwable) {\n Throwable cause = (Throwable) args[0];\n throw new MojoExecutionException(cause.getMessage(), cause);\n }\n else {\n throw new MojoExecutionException(String.valueOf(args[0]));\n }\n }\n else if (args.length == 2) {\n if (args[1] instanceof Throwable) {\n throw new MojoExecutionException(String.valueOf(args[0]), (Throwable) args[1]);\n }\n else {\n throw new Error(\"Invalid arguments to fail(Object, Throwable), second argument must be a Throwable\");\n }\n }\n else {\n throw new Error(\"Too many arguments; expected one of: fail(), fail(Object) or fail(Object, Throwable)\");\n }\n }",
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"invocations": [
"getMessage",
"valueOf",
"valueOf"
],
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_15 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private FailClosureTarget underTest;",
"type": "FailClosureTarget",
"var_name": "underTest"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/FailClosureTargetTest.java",
"identifier": "FailClosureTargetTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void fail_throwable() throws Exception {\n @SuppressWarnings(\"ThrowableInstanceNeverThrown\")\n Throwable cause = new Throwable(\"foo\");\n try {\n underTest.call(new Object[]{cause});\n }\n catch (MojoExecutionException e) {\n assertThat(e.getMessage(), is(\"foo\"));\n assertThat(e.getCause(), is(cause));\n }\n }",
"class_method_signature": "FailClosureTargetTest.fail_throwable()",
"constructor": false,
"full_signature": "@Test public void fail_throwable()",
"identifier": "fail_throwable",
"invocations": [
"call",
"assertThat",
"getMessage",
"is",
"assertThat",
"getCause",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void fail_throwable()",
"testcase": true
} | {
"fields": [
{
"declarator": "FAILED = \"Failed\"",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final String FAILED = \"Failed\";",
"type": "String",
"var_name": "FAILED"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/FailClosureTarget.java",
"identifier": "FailClosureTarget",
"interfaces": "implements ClosureTarget",
"methods": [
{
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Object call(final @Nullable Object[] args) throws Exception {\n if (args == null || args.length == 0) {\n throw new MojoExecutionException(FAILED);\n }\n else if (args.length == 1) {\n if (args[0] instanceof Throwable) {\n Throwable cause = (Throwable) args[0];\n throw new MojoExecutionException(cause.getMessage(), cause);\n }\n else {\n throw new MojoExecutionException(String.valueOf(args[0]));\n }\n }\n else if (args.length == 2) {\n if (args[1] instanceof Throwable) {\n throw new MojoExecutionException(String.valueOf(args[0]), (Throwable) args[1]);\n }\n else {\n throw new Error(\"Invalid arguments to fail(Object, Throwable), second argument must be a Throwable\");\n }\n }\n else {\n throw new Error(\"Too many arguments; expected one of: fail(), fail(Object) or fail(Object, Throwable)\");\n }\n }",
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"invocations": [
"getMessage",
"valueOf",
"valueOf"
],
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_6 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private ClassSourceFactory underTest;",
"type": "ClassSourceFactory",
"var_name": "underTest"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/ClassSourceFactoryTest.java",
"identifier": "ClassSourceFactoryTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void create_inlineIncrementsCounter() {\n ClassSourceFactory.scriptCounter.set(0);\n\n underTest.create(\"println 1234\");\n assertThat(ClassSourceFactory.scriptCounter.get(), is(1));\n\n underTest.create(\"println 5678\");\n assertThat(ClassSourceFactory.scriptCounter.get(), is(2));\n }",
"class_method_signature": "ClassSourceFactoryTest.create_inlineIncrementsCounter()",
"constructor": false,
"full_signature": "@Test public void create_inlineIncrementsCounter()",
"identifier": "create_inlineIncrementsCounter",
"invocations": [
"set",
"create",
"assertThat",
"get",
"is",
"create",
"assertThat",
"get",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void create_inlineIncrementsCounter()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "scriptCounter = new AtomicInteger(0)",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final AtomicInteger scriptCounter = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "scriptCounter"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/ClassSourceFactory.java",
"identifier": "ClassSourceFactory",
"interfaces": "",
"methods": [
{
"class_method_signature": "ClassSourceFactory.create(final String source)",
"constructor": false,
"full_signature": "public ClassSource create(final String source)",
"identifier": "create",
"modifiers": "public",
"parameters": "(final String source)",
"return": "ClassSource",
"signature": "ClassSource create(final String source)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public ClassSource create(final String source) {\n checkNotNull(source);\n\n String trimmed = source.trim();\n log.trace(\"Creating class-source from: {}\", trimmed);\n\n // First try and parse the source as a URL\n try {\n return new ClassSourceImpl(new URL(trimmed), null, null);\n }\n catch (MalformedURLException e) {\n log.trace(\"Not a URL\", e);\n }\n\n // FIXME: This is _slightly_ problematic as if you have a valid file ref\n // FIXME: but the file is missing then it will be treated as inline instead of as a file\n\n // Then as a File\n try {\n File file = new File(trimmed).getCanonicalFile();\n if (file.exists()) {\n return new ClassSourceImpl(null, file, null);\n }\n }\n catch (IOException e) {\n log.trace(\"Not a File\", e);\n }\n\n // Else it is an inline\n return new ClassSourceImpl(null, null, new InlineImpl(source));\n }",
"class_method_signature": "ClassSourceFactory.create(final String source)",
"constructor": false,
"full_signature": "public ClassSource create(final String source)",
"identifier": "create",
"invocations": [
"checkNotNull",
"trim",
"trace",
"trace",
"getCanonicalFile",
"exists",
"trace"
],
"modifiers": "public",
"parameters": "(final String source)",
"return": "ClassSource",
"signature": "ClassSource create(final String source)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_7 | {
"fields": [
{
"declarator": "prepareCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger prepareCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "prepareCount"
},
{
"declarator": "runCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger runCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "runCount"
},
{
"declarator": "cleanupCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger cleanupCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "cleanupCount"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/MojoSupportTest.java",
"identifier": "MojoSupportTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void execute_prepare_run_cleanup() throws Exception {\n MojoSupport underTest = new MojoSupportTester();\n\n underTest.execute();\n\n assertThat(prepareCount.get(), is(1));\n assertThat(runCount.get(), is(1));\n assertThat(cleanupCount.get(), is(1));\n }",
"class_method_signature": "MojoSupportTest.execute_prepare_run_cleanup()",
"constructor": false,
"full_signature": "@Test public void execute_prepare_run_cleanup()",
"identifier": "execute_prepare_run_cleanup",
"invocations": [
"execute",
"assertThat",
"get",
"is",
"assertThat",
"get",
"is",
"assertThat",
"get",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void execute_prepare_run_cleanup()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "protected final",
"original_string": "protected final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/MojoSupport.java",
"identifier": "MojoSupport",
"interfaces": "",
"methods": [
{
"class_method_signature": "MojoSupport.MojoSupport()",
"constructor": true,
"full_signature": "protected MojoSupport()",
"identifier": "MojoSupport",
"modifiers": "protected",
"parameters": "()",
"return": "",
"signature": " MojoSupport()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.execute()",
"constructor": false,
"full_signature": "public void execute()",
"identifier": "execute",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void execute()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.prepare()",
"constructor": false,
"full_signature": "protected void prepare()",
"identifier": "prepare",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void prepare()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.run()",
"constructor": false,
"full_signature": "protected abstract void run()",
"identifier": "run",
"modifiers": "protected abstract",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.cleanup()",
"constructor": false,
"full_signature": "protected void cleanup()",
"identifier": "cleanup",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void cleanup()",
"testcase": false
}
],
"superclass": "extends AbstractMojo"
} | {
"body": "public void execute() throws MojoExecutionException, MojoFailureException {\n try {\n try {\n log.trace(\"Prepare\");\n prepare();\n\n log.trace(\"Run\");\n run();\n }\n finally {\n log.trace(\"Cleanup\");\n cleanup();\n }\n }\n catch (Exception e) {\n log.trace(\"Failure\", e);\n Throwables.propagateIfPossible(e, MojoExecutionException.class, MojoFailureException.class);\n throw Throwables.propagate(e);\n }\n }",
"class_method_signature": "MojoSupport.execute()",
"constructor": false,
"full_signature": "public void execute()",
"identifier": "execute",
"invocations": [
"trace",
"prepare",
"trace",
"run",
"trace",
"cleanup",
"trace",
"propagateIfPossible",
"propagate"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void execute()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_14 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private FailClosureTarget underTest;",
"type": "FailClosureTarget",
"var_name": "underTest"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/FailClosureTargetTest.java",
"identifier": "FailClosureTargetTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void fail_object() throws Exception {\n try {\n underTest.call(new Object[]{\"foo\"});\n }\n catch (MojoExecutionException e) {\n assertThat(e.getMessage(), is(\"foo\"));\n assertThat(e.getCause(), nullValue());\n }\n }",
"class_method_signature": "FailClosureTargetTest.fail_object()",
"constructor": false,
"full_signature": "@Test public void fail_object()",
"identifier": "fail_object",
"invocations": [
"call",
"assertThat",
"getMessage",
"is",
"assertThat",
"getCause",
"nullValue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void fail_object()",
"testcase": true
} | {
"fields": [
{
"declarator": "FAILED = \"Failed\"",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final String FAILED = \"Failed\";",
"type": "String",
"var_name": "FAILED"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/FailClosureTarget.java",
"identifier": "FailClosureTarget",
"interfaces": "implements ClosureTarget",
"methods": [
{
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Object call(final @Nullable Object[] args) throws Exception {\n if (args == null || args.length == 0) {\n throw new MojoExecutionException(FAILED);\n }\n else if (args.length == 1) {\n if (args[0] instanceof Throwable) {\n Throwable cause = (Throwable) args[0];\n throw new MojoExecutionException(cause.getMessage(), cause);\n }\n else {\n throw new MojoExecutionException(String.valueOf(args[0]));\n }\n }\n else if (args.length == 2) {\n if (args[1] instanceof Throwable) {\n throw new MojoExecutionException(String.valueOf(args[0]), (Throwable) args[1]);\n }\n else {\n throw new Error(\"Invalid arguments to fail(Object, Throwable), second argument must be a Throwable\");\n }\n }\n else {\n throw new Error(\"Too many arguments; expected one of: fail(), fail(Object) or fail(Object, Throwable)\");\n }\n }",
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"invocations": [
"getMessage",
"valueOf",
"valueOf"
],
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_18 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private FailClosureTarget underTest;",
"type": "FailClosureTarget",
"var_name": "underTest"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/FailClosureTargetTest.java",
"identifier": "FailClosureTargetTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test(expected = Error.class)\n public void fail_tooManyArgs() throws Exception {\n underTest.call(new Object[]{1, 2, 3});\n }",
"class_method_signature": "FailClosureTargetTest.fail_tooManyArgs()",
"constructor": false,
"full_signature": "@Test(expected = Error.class) public void fail_tooManyArgs()",
"identifier": "fail_tooManyArgs",
"invocations": [
"call"
],
"modifiers": "@Test(expected = Error.class) public",
"parameters": "()",
"return": "void",
"signature": "void fail_tooManyArgs()",
"testcase": true
} | {
"fields": [
{
"declarator": "FAILED = \"Failed\"",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final String FAILED = \"Failed\";",
"type": "String",
"var_name": "FAILED"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/FailClosureTarget.java",
"identifier": "FailClosureTarget",
"interfaces": "implements ClosureTarget",
"methods": [
{
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Object call(final @Nullable Object[] args) throws Exception {\n if (args == null || args.length == 0) {\n throw new MojoExecutionException(FAILED);\n }\n else if (args.length == 1) {\n if (args[0] instanceof Throwable) {\n Throwable cause = (Throwable) args[0];\n throw new MojoExecutionException(cause.getMessage(), cause);\n }\n else {\n throw new MojoExecutionException(String.valueOf(args[0]));\n }\n }\n else if (args.length == 2) {\n if (args[1] instanceof Throwable) {\n throw new MojoExecutionException(String.valueOf(args[0]), (Throwable) args[1]);\n }\n else {\n throw new Error(\"Invalid arguments to fail(Object, Throwable), second argument must be a Throwable\");\n }\n }\n else {\n throw new Error(\"Too many arguments; expected one of: fail(), fail(Object) or fail(Object, Throwable)\");\n }\n }",
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"invocations": [
"getMessage",
"valueOf",
"valueOf"
],
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_8 | {
"fields": [
{
"declarator": "prepareCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger prepareCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "prepareCount"
},
{
"declarator": "runCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger runCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "runCount"
},
{
"declarator": "cleanupCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger cleanupCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "cleanupCount"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/MojoSupportTest.java",
"identifier": "MojoSupportTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void execute_prepareExceptionCallsCleanup() throws Exception {\n MojoSupport underTest = new MojoSupportTester()\n {\n @Override\n protected void prepare() throws Exception {\n throw new Exception(\"fail\");\n }\n };\n\n try {\n underTest.execute();\n fail();\n }\n catch (Exception e) {\n // expected\n }\n\n assertThat(runCount.get(), is(0));\n assertThat(cleanupCount.get(), is(1));\n }",
"class_method_signature": "MojoSupportTest.execute_prepareExceptionCallsCleanup()",
"constructor": false,
"full_signature": "@Test public void execute_prepareExceptionCallsCleanup()",
"identifier": "execute_prepareExceptionCallsCleanup",
"invocations": [
"execute",
"fail",
"assertThat",
"get",
"is",
"assertThat",
"get",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void execute_prepareExceptionCallsCleanup()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "protected final",
"original_string": "protected final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/MojoSupport.java",
"identifier": "MojoSupport",
"interfaces": "",
"methods": [
{
"class_method_signature": "MojoSupport.MojoSupport()",
"constructor": true,
"full_signature": "protected MojoSupport()",
"identifier": "MojoSupport",
"modifiers": "protected",
"parameters": "()",
"return": "",
"signature": " MojoSupport()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.execute()",
"constructor": false,
"full_signature": "public void execute()",
"identifier": "execute",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void execute()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.prepare()",
"constructor": false,
"full_signature": "protected void prepare()",
"identifier": "prepare",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void prepare()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.run()",
"constructor": false,
"full_signature": "protected abstract void run()",
"identifier": "run",
"modifiers": "protected abstract",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.cleanup()",
"constructor": false,
"full_signature": "protected void cleanup()",
"identifier": "cleanup",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void cleanup()",
"testcase": false
}
],
"superclass": "extends AbstractMojo"
} | {
"body": "public void execute() throws MojoExecutionException, MojoFailureException {\n try {\n try {\n log.trace(\"Prepare\");\n prepare();\n\n log.trace(\"Run\");\n run();\n }\n finally {\n log.trace(\"Cleanup\");\n cleanup();\n }\n }\n catch (Exception e) {\n log.trace(\"Failure\", e);\n Throwables.propagateIfPossible(e, MojoExecutionException.class, MojoFailureException.class);\n throw Throwables.propagate(e);\n }\n }",
"class_method_signature": "MojoSupport.execute()",
"constructor": false,
"full_signature": "public void execute()",
"identifier": "execute",
"invocations": [
"trace",
"prepare",
"trace",
"run",
"trace",
"cleanup",
"trace",
"propagateIfPossible",
"propagate"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void execute()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_4 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private VersionHelper underTest;",
"type": "VersionHelper",
"var_name": "underTest"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/util/VersionHelperTest.java",
"identifier": "VersionHelperTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void before() {\n VersionRange range = underTest.before(1, 2, 3);\n log(range);\n assertThat(range.toString(), is(\"(,1.2.3-\" + VersionHelper.EARLIEST_SUFFIX + \")\"));\n }",
"class_method_signature": "VersionHelperTest.before()",
"constructor": false,
"full_signature": "@Test public void before()",
"identifier": "before",
"invocations": [
"before",
"log",
"assertThat",
"toString",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void before()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "EARLIEST_SUFFIX = \"alpha-SNAPSHOT\"",
"modifier": "public static final",
"original_string": "public static final String EARLIEST_SUFFIX = \"alpha-SNAPSHOT\";",
"type": "String",
"var_name": "EARLIEST_SUFFIX"
},
{
"declarator": "versionScheme",
"modifier": "private final",
"original_string": "private final VersionScheme versionScheme;",
"type": "VersionScheme",
"var_name": "versionScheme"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/util/VersionHelper.java",
"identifier": "VersionHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "VersionHelper.VersionHelper()",
"constructor": true,
"full_signature": "public VersionHelper()",
"identifier": "VersionHelper",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " VersionHelper()",
"testcase": false
},
{
"class_method_signature": "VersionHelper.VersionHelper(final VersionScheme versionScheme)",
"constructor": true,
"full_signature": "@VisibleForTesting public VersionHelper(final VersionScheme versionScheme)",
"identifier": "VersionHelper",
"modifiers": "@VisibleForTesting public",
"parameters": "(final VersionScheme versionScheme)",
"return": "",
"signature": " VersionHelper(final VersionScheme versionScheme)",
"testcase": false
},
{
"class_method_signature": "VersionHelper.getScheme()",
"constructor": false,
"full_signature": "public VersionScheme getScheme()",
"identifier": "getScheme",
"modifiers": "public",
"parameters": "()",
"return": "VersionScheme",
"signature": "VersionScheme getScheme()",
"testcase": false
},
{
"class_method_signature": "VersionHelper.parseVersion(final String version)",
"constructor": false,
"full_signature": "public Version parseVersion(final String version)",
"identifier": "parseVersion",
"modifiers": "public",
"parameters": "(final String version)",
"return": "Version",
"signature": "Version parseVersion(final String version)",
"testcase": false
},
{
"class_method_signature": "VersionHelper.parseRange(final String pattern)",
"constructor": false,
"full_signature": "public VersionRange parseRange(final String pattern)",
"identifier": "parseRange",
"modifiers": "public",
"parameters": "(final String pattern)",
"return": "VersionRange",
"signature": "VersionRange parseRange(final String pattern)",
"testcase": false
},
{
"class_method_signature": "VersionHelper.range(final int... parts)",
"constructor": false,
"full_signature": "public VersionRange range(final int... parts)",
"identifier": "range",
"modifiers": "public",
"parameters": "(final int... parts)",
"return": "VersionRange",
"signature": "VersionRange range(final int... parts)",
"testcase": false
},
{
"class_method_signature": "VersionHelper.before(final int... parts)",
"constructor": false,
"full_signature": "public VersionRange before(final int... parts)",
"identifier": "before",
"modifiers": "public",
"parameters": "(final int... parts)",
"return": "VersionRange",
"signature": "VersionRange before(final int... parts)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public VersionRange before(final int... parts) {\n checkNotNull(parts);\n checkArgument(parts.length != 0);\n\n StringBuilder buff = new StringBuilder()\n .append(\"(,\");\n\n for (int i = 0; i < parts.length; i++) {\n buff.append(parts[i]);\n if (i + 1 < parts.length) {\n buff.append(\".\");\n }\n }\n\n buff.append(\"-\")\n .append(EARLIEST_SUFFIX)\n .append(\")\");\n\n log.trace(\"Range pattern: {}\", buff);\n\n return parseRange(buff.toString());\n }",
"class_method_signature": "VersionHelper.before(final int... parts)",
"constructor": false,
"full_signature": "public VersionRange before(final int... parts)",
"identifier": "before",
"invocations": [
"checkNotNull",
"checkArgument",
"append",
"append",
"append",
"append",
"append",
"append",
"trace",
"parseRange",
"toString"
],
"modifiers": "public",
"parameters": "(final int... parts)",
"return": "VersionRange",
"signature": "VersionRange before(final int... parts)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_17 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private FailClosureTarget underTest;",
"type": "FailClosureTarget",
"var_name": "underTest"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/FailClosureTargetTest.java",
"identifier": "FailClosureTargetTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test(expected = Error.class)\n public void fail_invalidArgs() throws Exception {\n underTest.call(new Object[]{1, 2});\n }",
"class_method_signature": "FailClosureTargetTest.fail_invalidArgs()",
"constructor": false,
"full_signature": "@Test(expected = Error.class) public void fail_invalidArgs()",
"identifier": "fail_invalidArgs",
"invocations": [
"call"
],
"modifiers": "@Test(expected = Error.class) public",
"parameters": "()",
"return": "void",
"signature": "void fail_invalidArgs()",
"testcase": true
} | {
"fields": [
{
"declarator": "FAILED = \"Failed\"",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final String FAILED = \"Failed\";",
"type": "String",
"var_name": "FAILED"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/FailClosureTarget.java",
"identifier": "FailClosureTarget",
"interfaces": "implements ClosureTarget",
"methods": [
{
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Object call(final @Nullable Object[] args) throws Exception {\n if (args == null || args.length == 0) {\n throw new MojoExecutionException(FAILED);\n }\n else if (args.length == 1) {\n if (args[0] instanceof Throwable) {\n Throwable cause = (Throwable) args[0];\n throw new MojoExecutionException(cause.getMessage(), cause);\n }\n else {\n throw new MojoExecutionException(String.valueOf(args[0]));\n }\n }\n else if (args.length == 2) {\n if (args[1] instanceof Throwable) {\n throw new MojoExecutionException(String.valueOf(args[0]), (Throwable) args[1]);\n }\n else {\n throw new Error(\"Invalid arguments to fail(Object, Throwable), second argument must be a Throwable\");\n }\n }\n else {\n throw new Error(\"Too many arguments; expected one of: fail(), fail(Object) or fail(Object, Throwable)\");\n }\n }",
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"invocations": [
"getMessage",
"valueOf",
"valueOf"
],
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_16 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private FailClosureTarget underTest;",
"type": "FailClosureTarget",
"var_name": "underTest"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/FailClosureTargetTest.java",
"identifier": "FailClosureTargetTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void fail_objectAndThrowable() throws Exception {\n @SuppressWarnings(\"ThrowableInstanceNeverThrown\")\n Throwable cause = new Throwable(\"bar\");\n try {\n underTest.call(new Object[]{\"foo\", cause});\n }\n catch (MojoExecutionException e) {\n assertThat(e.getMessage(), is(\"foo\"));\n assertThat(e.getCause(), is(cause));\n }\n }",
"class_method_signature": "FailClosureTargetTest.fail_objectAndThrowable()",
"constructor": false,
"full_signature": "@Test public void fail_objectAndThrowable()",
"identifier": "fail_objectAndThrowable",
"invocations": [
"call",
"assertThat",
"getMessage",
"is",
"assertThat",
"getCause",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void fail_objectAndThrowable()",
"testcase": true
} | {
"fields": [
{
"declarator": "FAILED = \"Failed\"",
"modifier": "@VisibleForTesting\n static final",
"original_string": "@VisibleForTesting\n static final String FAILED = \"Failed\";",
"type": "String",
"var_name": "FAILED"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/FailClosureTarget.java",
"identifier": "FailClosureTarget",
"interfaces": "implements ClosureTarget",
"methods": [
{
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public Object call(final @Nullable Object[] args) throws Exception {\n if (args == null || args.length == 0) {\n throw new MojoExecutionException(FAILED);\n }\n else if (args.length == 1) {\n if (args[0] instanceof Throwable) {\n Throwable cause = (Throwable) args[0];\n throw new MojoExecutionException(cause.getMessage(), cause);\n }\n else {\n throw new MojoExecutionException(String.valueOf(args[0]));\n }\n }\n else if (args.length == 2) {\n if (args[1] instanceof Throwable) {\n throw new MojoExecutionException(String.valueOf(args[0]), (Throwable) args[1]);\n }\n else {\n throw new Error(\"Invalid arguments to fail(Object, Throwable), second argument must be a Throwable\");\n }\n }\n else {\n throw new Error(\"Too many arguments; expected one of: fail(), fail(Object) or fail(Object, Throwable)\");\n }\n }",
"class_method_signature": "FailClosureTarget.call(final @Nullable Object[] args)",
"constructor": false,
"full_signature": "public Object call(final @Nullable Object[] args)",
"identifier": "call",
"invocations": [
"getMessage",
"valueOf",
"valueOf"
],
"modifiers": "public",
"parameters": "(final @Nullable Object[] args)",
"return": "Object",
"signature": "Object call(final @Nullable Object[] args)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_5 | {
"fields": [],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/util/Maps2Test.java",
"identifier": "Maps2Test",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void fromProperties_entryWithNullValue() throws Exception {\n Properties props1 = new Properties() {\n @Override\n public Enumeration<?> propertyNames() {\n return Iterators.asEnumeration(ImmutableList.of(\"foo\").iterator());\n }\n\n @Override\n public String getProperty(final String key) {\n if (\"foo\".equals(key)) {\n return null;\n }\n return super.getProperty(key);\n }\n };\n Map<String, String> props2 = Maps2.fromProperties(props1);\n assertThat(props2, hasEntry(\"foo\", null));\n }",
"class_method_signature": "Maps2Test.fromProperties_entryWithNullValue()",
"constructor": false,
"full_signature": "@Test public void fromProperties_entryWithNullValue()",
"identifier": "fromProperties_entryWithNullValue",
"invocations": [
"asEnumeration",
"iterator",
"of",
"equals",
"getProperty",
"fromProperties",
"assertThat",
"hasEntry"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void fromProperties_entryWithNullValue()",
"testcase": true
} | {
"fields": [],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/util/Maps2.java",
"identifier": "Maps2",
"interfaces": "",
"methods": [
{
"class_method_signature": "Maps2.Maps2()",
"constructor": true,
"full_signature": "private Maps2()",
"identifier": "Maps2",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " Maps2()",
"testcase": false
},
{
"class_method_signature": "Maps2.fromProperties(final Properties properties)",
"constructor": false,
"full_signature": "public static Map<String,String> fromProperties(final Properties properties)",
"identifier": "fromProperties",
"modifiers": "public static",
"parameters": "(final Properties properties)",
"return": "Map<String,String>",
"signature": "Map<String,String> fromProperties(final Properties properties)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static Map<String,String> fromProperties(final Properties properties) {\n checkNotNull(properties);\n Map<String,String> result = new HashMap<String, String>(properties.size());\n Enumeration names = properties.propertyNames();\n while (names.hasMoreElements()) {\n String name = (String)names.nextElement();\n result.put(name, properties.getProperty(name));\n }\n return result;\n }",
"class_method_signature": "Maps2.fromProperties(final Properties properties)",
"constructor": false,
"full_signature": "public static Map<String,String> fromProperties(final Properties properties)",
"identifier": "fromProperties",
"invocations": [
"checkNotNull",
"size",
"propertyNames",
"hasMoreElements",
"nextElement",
"put",
"getProperty"
],
"modifiers": "public static",
"parameters": "(final Properties properties)",
"return": "Map<String,String>",
"signature": "Map<String,String> fromProperties(final Properties properties)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_9 | {
"fields": [
{
"declarator": "prepareCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger prepareCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "prepareCount"
},
{
"declarator": "runCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger runCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "runCount"
},
{
"declarator": "cleanupCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger cleanupCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "cleanupCount"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/MojoSupportTest.java",
"identifier": "MojoSupportTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void execute_runExceptionCallsCleanup() throws Exception {\n MojoSupport underTest = new MojoSupportTester()\n {\n @Override\n protected void run() throws Exception {\n throw new Exception(\"fail\");\n }\n };\n\n try {\n underTest.execute();\n fail();\n }\n catch (Exception e) {\n // expected\n }\n\n assertThat(prepareCount.get(), is(1));\n assertThat(cleanupCount.get(), is(1));\n }",
"class_method_signature": "MojoSupportTest.execute_runExceptionCallsCleanup()",
"constructor": false,
"full_signature": "@Test public void execute_runExceptionCallsCleanup()",
"identifier": "execute_runExceptionCallsCleanup",
"invocations": [
"execute",
"fail",
"assertThat",
"get",
"is",
"assertThat",
"get",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void execute_runExceptionCallsCleanup()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "protected final",
"original_string": "protected final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/MojoSupport.java",
"identifier": "MojoSupport",
"interfaces": "",
"methods": [
{
"class_method_signature": "MojoSupport.MojoSupport()",
"constructor": true,
"full_signature": "protected MojoSupport()",
"identifier": "MojoSupport",
"modifiers": "protected",
"parameters": "()",
"return": "",
"signature": " MojoSupport()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.execute()",
"constructor": false,
"full_signature": "public void execute()",
"identifier": "execute",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void execute()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.prepare()",
"constructor": false,
"full_signature": "protected void prepare()",
"identifier": "prepare",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void prepare()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.run()",
"constructor": false,
"full_signature": "protected abstract void run()",
"identifier": "run",
"modifiers": "protected abstract",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.cleanup()",
"constructor": false,
"full_signature": "protected void cleanup()",
"identifier": "cleanup",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void cleanup()",
"testcase": false
}
],
"superclass": "extends AbstractMojo"
} | {
"body": "public void execute() throws MojoExecutionException, MojoFailureException {\n try {\n try {\n log.trace(\"Prepare\");\n prepare();\n\n log.trace(\"Run\");\n run();\n }\n finally {\n log.trace(\"Cleanup\");\n cleanup();\n }\n }\n catch (Exception e) {\n log.trace(\"Failure\", e);\n Throwables.propagateIfPossible(e, MojoExecutionException.class, MojoFailureException.class);\n throw Throwables.propagate(e);\n }\n }",
"class_method_signature": "MojoSupport.execute()",
"constructor": false,
"full_signature": "public void execute()",
"identifier": "execute",
"invocations": [
"trace",
"prepare",
"trace",
"run",
"trace",
"cleanup",
"trace",
"propagateIfPossible",
"propagate"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void execute()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_2 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private GroovyRuntimeFactory underTest;",
"type": "GroovyRuntimeFactory",
"var_name": "underTest"
},
{
"declarator": "classLoader",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ClassLoader classLoader;",
"type": "ClassLoader",
"var_name": "classLoader"
},
{
"declarator": "services",
"modifier": "private",
"original_string": "private List<GroovyRuntime> services;",
"type": "List<GroovyRuntime>",
"var_name": "services"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/GroovyRuntimeFactoryTest.java",
"identifier": "GroovyRuntimeFactoryTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void create_singleService() {\n services.add(mock(GroovyRuntime.class));\n GroovyRuntime runtime = underTest.create(classLoader);\n assertThat(runtime, notNullValue());\n }",
"class_method_signature": "GroovyRuntimeFactoryTest.create_singleService()",
"constructor": false,
"full_signature": "@Test public void create_singleService()",
"identifier": "create_singleService",
"invocations": [
"add",
"mock",
"create",
"assertThat",
"notNullValue"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void create_singleService()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/GroovyRuntimeFactory.java",
"identifier": "GroovyRuntimeFactory",
"interfaces": "",
"methods": [
{
"class_method_signature": "GroovyRuntimeFactory.create(final ClassLoader classLoader)",
"constructor": false,
"full_signature": "public GroovyRuntime create(final ClassLoader classLoader)",
"identifier": "create",
"modifiers": "public",
"parameters": "(final ClassLoader classLoader)",
"return": "GroovyRuntime",
"signature": "GroovyRuntime create(final ClassLoader classLoader)",
"testcase": false
},
{
"class_method_signature": "GroovyRuntimeFactory.findServices(final ClassLoader classLoader)",
"constructor": false,
"full_signature": "@VisibleForTesting protected Iterator<GroovyRuntime> findServices(final ClassLoader classLoader)",
"identifier": "findServices",
"modifiers": "@VisibleForTesting protected",
"parameters": "(final ClassLoader classLoader)",
"return": "Iterator<GroovyRuntime>",
"signature": "Iterator<GroovyRuntime> findServices(final ClassLoader classLoader)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public GroovyRuntime create(final ClassLoader classLoader) {\n checkNotNull(classLoader);\n\n Iterator<GroovyRuntime> services = findServices(classLoader);\n\n checkState(services.hasNext(), \"No GroovyRuntime service found\");\n\n GroovyRuntime runtime = services.next();\n\n checkState(!services.hasNext(), \"Multiple GroovyRuntime services found\");\n\n log.debug(\"Runtime: {}\", runtime);\n return runtime;\n }",
"class_method_signature": "GroovyRuntimeFactory.create(final ClassLoader classLoader)",
"constructor": false,
"full_signature": "public GroovyRuntime create(final ClassLoader classLoader)",
"identifier": "create",
"invocations": [
"checkNotNull",
"findServices",
"checkState",
"hasNext",
"next",
"checkState",
"hasNext",
"debug"
],
"modifiers": "public",
"parameters": "(final ClassLoader classLoader)",
"return": "GroovyRuntime",
"signature": "GroovyRuntime create(final ClassLoader classLoader)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_11 | {
"fields": [
{
"declarator": "prepareCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger prepareCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "prepareCount"
},
{
"declarator": "runCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger runCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "runCount"
},
{
"declarator": "cleanupCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger cleanupCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "cleanupCount"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/MojoSupportTest.java",
"identifier": "MojoSupportTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void execute_MojoFailureException_propagates() throws Exception {\n MojoSupport underTest = new MojoSupportTester()\n {\n @Override\n protected void run() throws Exception {\n throw new MojoFailureException(\"fail\");\n }\n };\n\n try {\n underTest.execute();\n fail();\n }\n catch (Exception e) {\n assertThat(e, instanceOf(MojoFailureException.class));\n }\n }",
"class_method_signature": "MojoSupportTest.execute_MojoFailureException_propagates()",
"constructor": false,
"full_signature": "@Test public void execute_MojoFailureException_propagates()",
"identifier": "execute_MojoFailureException_propagates",
"invocations": [
"execute",
"fail",
"assertThat",
"instanceOf"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void execute_MojoFailureException_propagates()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "protected final",
"original_string": "protected final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/MojoSupport.java",
"identifier": "MojoSupport",
"interfaces": "",
"methods": [
{
"class_method_signature": "MojoSupport.MojoSupport()",
"constructor": true,
"full_signature": "protected MojoSupport()",
"identifier": "MojoSupport",
"modifiers": "protected",
"parameters": "()",
"return": "",
"signature": " MojoSupport()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.execute()",
"constructor": false,
"full_signature": "public void execute()",
"identifier": "execute",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void execute()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.prepare()",
"constructor": false,
"full_signature": "protected void prepare()",
"identifier": "prepare",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void prepare()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.run()",
"constructor": false,
"full_signature": "protected abstract void run()",
"identifier": "run",
"modifiers": "protected abstract",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.cleanup()",
"constructor": false,
"full_signature": "protected void cleanup()",
"identifier": "cleanup",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void cleanup()",
"testcase": false
}
],
"superclass": "extends AbstractMojo"
} | {
"body": "public void execute() throws MojoExecutionException, MojoFailureException {\n try {\n try {\n log.trace(\"Prepare\");\n prepare();\n\n log.trace(\"Run\");\n run();\n }\n finally {\n log.trace(\"Cleanup\");\n cleanup();\n }\n }\n catch (Exception e) {\n log.trace(\"Failure\", e);\n Throwables.propagateIfPossible(e, MojoExecutionException.class, MojoFailureException.class);\n throw Throwables.propagate(e);\n }\n }",
"class_method_signature": "MojoSupport.execute()",
"constructor": false,
"full_signature": "public void execute()",
"identifier": "execute",
"invocations": [
"trace",
"prepare",
"trace",
"run",
"trace",
"cleanup",
"trace",
"propagateIfPossible",
"propagate"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void execute()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_10 | {
"fields": [
{
"declarator": "prepareCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger prepareCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "prepareCount"
},
{
"declarator": "runCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger runCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "runCount"
},
{
"declarator": "cleanupCount = new AtomicInteger(0)",
"modifier": "private",
"original_string": "private AtomicInteger cleanupCount = new AtomicInteger(0);",
"type": "AtomicInteger",
"var_name": "cleanupCount"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/MojoSupportTest.java",
"identifier": "MojoSupportTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void execute_MojoExecutionException_propagates() throws Exception {\n MojoSupport underTest = new MojoSupportTester()\n {\n @Override\n protected void run() throws Exception {\n throw new MojoExecutionException(\"fail\");\n }\n };\n\n try {\n underTest.execute();\n fail();\n }\n catch (Exception e) {\n assertThat(e, instanceOf(MojoExecutionException.class));\n }\n }",
"class_method_signature": "MojoSupportTest.execute_MojoExecutionException_propagates()",
"constructor": false,
"full_signature": "@Test public void execute_MojoExecutionException_propagates()",
"identifier": "execute_MojoExecutionException_propagates",
"invocations": [
"execute",
"fail",
"assertThat",
"instanceOf"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void execute_MojoExecutionException_propagates()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "protected final",
"original_string": "protected final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/MojoSupport.java",
"identifier": "MojoSupport",
"interfaces": "",
"methods": [
{
"class_method_signature": "MojoSupport.MojoSupport()",
"constructor": true,
"full_signature": "protected MojoSupport()",
"identifier": "MojoSupport",
"modifiers": "protected",
"parameters": "()",
"return": "",
"signature": " MojoSupport()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.execute()",
"constructor": false,
"full_signature": "public void execute()",
"identifier": "execute",
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void execute()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.prepare()",
"constructor": false,
"full_signature": "protected void prepare()",
"identifier": "prepare",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void prepare()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.run()",
"constructor": false,
"full_signature": "protected abstract void run()",
"identifier": "run",
"modifiers": "protected abstract",
"parameters": "()",
"return": "void",
"signature": "void run()",
"testcase": false
},
{
"class_method_signature": "MojoSupport.cleanup()",
"constructor": false,
"full_signature": "protected void cleanup()",
"identifier": "cleanup",
"modifiers": "protected",
"parameters": "()",
"return": "void",
"signature": "void cleanup()",
"testcase": false
}
],
"superclass": "extends AbstractMojo"
} | {
"body": "public void execute() throws MojoExecutionException, MojoFailureException {\n try {\n try {\n log.trace(\"Prepare\");\n prepare();\n\n log.trace(\"Run\");\n run();\n }\n finally {\n log.trace(\"Cleanup\");\n cleanup();\n }\n }\n catch (Exception e) {\n log.trace(\"Failure\", e);\n Throwables.propagateIfPossible(e, MojoExecutionException.class, MojoFailureException.class);\n throw Throwables.propagate(e);\n }\n }",
"class_method_signature": "MojoSupport.execute()",
"constructor": false,
"full_signature": "public void execute()",
"identifier": "execute",
"invocations": [
"trace",
"prepare",
"trace",
"run",
"trace",
"cleanup",
"trace",
"propagateIfPossible",
"propagate"
],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void execute()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
5243237_3 | {
"fields": [
{
"declarator": "underTest",
"modifier": "private",
"original_string": "private VersionHelper underTest;",
"type": "VersionHelper",
"var_name": "underTest"
}
],
"file": "groovy-maven-plugin/src/test/java/org/codehaus/gmaven/plugin/util/VersionHelperTest.java",
"identifier": "VersionHelperTest",
"interfaces": "",
"superclass": "extends TestSupport"
} | {
"body": "@Test\n public void range() {\n VersionRange range = underTest.range(1, 2, 3);\n log(range);\n assertThat(range.toString(), is(\"[1.2.3,1.2.4)\"));\n }",
"class_method_signature": "VersionHelperTest.range()",
"constructor": false,
"full_signature": "@Test public void range()",
"identifier": "range",
"invocations": [
"range",
"log",
"assertThat",
"toString",
"is"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void range()",
"testcase": true
} | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "EARLIEST_SUFFIX = \"alpha-SNAPSHOT\"",
"modifier": "public static final",
"original_string": "public static final String EARLIEST_SUFFIX = \"alpha-SNAPSHOT\";",
"type": "String",
"var_name": "EARLIEST_SUFFIX"
},
{
"declarator": "versionScheme",
"modifier": "private final",
"original_string": "private final VersionScheme versionScheme;",
"type": "VersionScheme",
"var_name": "versionScheme"
}
],
"file": "groovy-maven-plugin/src/main/java/org/codehaus/gmaven/plugin/util/VersionHelper.java",
"identifier": "VersionHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "VersionHelper.VersionHelper()",
"constructor": true,
"full_signature": "public VersionHelper()",
"identifier": "VersionHelper",
"modifiers": "public",
"parameters": "()",
"return": "",
"signature": " VersionHelper()",
"testcase": false
},
{
"class_method_signature": "VersionHelper.VersionHelper(final VersionScheme versionScheme)",
"constructor": true,
"full_signature": "@VisibleForTesting public VersionHelper(final VersionScheme versionScheme)",
"identifier": "VersionHelper",
"modifiers": "@VisibleForTesting public",
"parameters": "(final VersionScheme versionScheme)",
"return": "",
"signature": " VersionHelper(final VersionScheme versionScheme)",
"testcase": false
},
{
"class_method_signature": "VersionHelper.getScheme()",
"constructor": false,
"full_signature": "public VersionScheme getScheme()",
"identifier": "getScheme",
"modifiers": "public",
"parameters": "()",
"return": "VersionScheme",
"signature": "VersionScheme getScheme()",
"testcase": false
},
{
"class_method_signature": "VersionHelper.parseVersion(final String version)",
"constructor": false,
"full_signature": "public Version parseVersion(final String version)",
"identifier": "parseVersion",
"modifiers": "public",
"parameters": "(final String version)",
"return": "Version",
"signature": "Version parseVersion(final String version)",
"testcase": false
},
{
"class_method_signature": "VersionHelper.parseRange(final String pattern)",
"constructor": false,
"full_signature": "public VersionRange parseRange(final String pattern)",
"identifier": "parseRange",
"modifiers": "public",
"parameters": "(final String pattern)",
"return": "VersionRange",
"signature": "VersionRange parseRange(final String pattern)",
"testcase": false
},
{
"class_method_signature": "VersionHelper.range(final int... parts)",
"constructor": false,
"full_signature": "public VersionRange range(final int... parts)",
"identifier": "range",
"modifiers": "public",
"parameters": "(final int... parts)",
"return": "VersionRange",
"signature": "VersionRange range(final int... parts)",
"testcase": false
},
{
"class_method_signature": "VersionHelper.before(final int... parts)",
"constructor": false,
"full_signature": "public VersionRange before(final int... parts)",
"identifier": "before",
"modifiers": "public",
"parameters": "(final int... parts)",
"return": "VersionRange",
"signature": "VersionRange before(final int... parts)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public VersionRange range(final int... parts) {\n checkNotNull(parts);\n checkArgument(parts.length != 0);\n\n StringBuilder buff = new StringBuilder()\n .append(\"[\");\n\n for (int i = 0; i < parts.length; i++) {\n buff.append(parts[i]);\n if (i + 1 < parts.length) {\n buff.append(\".\");\n }\n }\n\n buff.append(\",\");\n\n for (int i = 0; i < parts.length; i++) {\n if (i + 1 == parts.length) {\n buff.append(parts[i] + 1);\n }\n else {\n buff.append(parts[i])\n .append(\".\");\n }\n }\n\n buff.append(\")\");\n\n log.trace(\"Range pattern: {}\", buff);\n\n return parseRange(buff.toString());\n }",
"class_method_signature": "VersionHelper.range(final int... parts)",
"constructor": false,
"full_signature": "public VersionRange range(final int... parts)",
"identifier": "range",
"invocations": [
"checkNotNull",
"checkArgument",
"append",
"append",
"append",
"append",
"append",
"append",
"append",
"append",
"trace",
"parseRange",
"toString"
],
"modifiers": "public",
"parameters": "(final int... parts)",
"return": "VersionRange",
"signature": "VersionRange range(final int... parts)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 14,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5243237,
"size": 4727,
"stargazer_count": 36,
"stars": null,
"updates": null,
"url": "https://github.com/groovy/gmaven"
} |
50092217_2 | {
"fields": [
{
"declarator": "cityService",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private CityService cityService;",
"type": "CityService",
"var_name": "cityService"
},
{
"declarator": "thrown= ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown= ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "eureka-client-b/src/test/java/com/ggj/service/CityServiceTest.java",
"identifier": "CityServiceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected =NumberFormatException.class)\n// @Test\n public void testTransation() {\n// thrown.expect(NumberFormatException.class);\n// thrown.expectMessage(\"转换异常 Integer.parseInt(\\\"d\\\");\");\n cityService.transation();\n }",
"class_method_signature": "CityServiceTest.testTransation()",
"constructor": false,
"full_signature": "@Test(expected =NumberFormatException.class) // @Test public void testTransation()",
"identifier": "testTransation",
"invocations": [
"transation"
],
"modifiers": "@Test(expected =NumberFormatException.class) // @Test public",
"parameters": "()",
"return": "void",
"signature": "void testTransation()",
"testcase": true
} | {
"fields": [
{
"declarator": "cityDao",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private CityDao cityDao;",
"type": "CityDao",
"var_name": "cityDao"
}
],
"file": "eureka-client-b/src/main/java/com/ggj/service/CityService.java",
"identifier": "CityService",
"interfaces": "",
"methods": [
{
"class_method_signature": "CityService.getCity(int id)",
"constructor": false,
"full_signature": "public City getCity(int id)",
"identifier": "getCity",
"modifiers": "public",
"parameters": "(int id)",
"return": "City",
"signature": "City getCity(int id)",
"testcase": false
},
{
"class_method_signature": "CityService.insert(City city)",
"constructor": false,
"full_signature": "@Transactional(readOnly = false) public void insert(City city)",
"identifier": "insert",
"modifiers": "@Transactional(readOnly = false) public",
"parameters": "(City city)",
"return": "void",
"signature": "void insert(City city)",
"testcase": false
},
{
"class_method_signature": "CityService.transation()",
"constructor": false,
"full_signature": "@Transactional(readOnly = false) public void transation()",
"identifier": "transation",
"modifiers": "@Transactional(readOnly = false) public",
"parameters": "()",
"return": "void",
"signature": "void transation()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Transactional(readOnly = false)\n public void transation(){\n City city=new City(\"shanghai\",\"SH\");\n cityDao.insert(city);\n Integer.parseInt(\"d\");\n }",
"class_method_signature": "CityService.transation()",
"constructor": false,
"full_signature": "@Transactional(readOnly = false) public void transation()",
"identifier": "transation",
"invocations": [
"insert",
"parseInt"
],
"modifiers": "@Transactional(readOnly = false) public",
"parameters": "()",
"return": "void",
"signature": "void transation()",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 50092217,
"size": 345,
"stargazer_count": 26,
"stars": null,
"updates": null,
"url": "https://github.com/ggj2010/springcloudsamples-ggj"
} |
50092217_3 | {
"fields": [
{
"declarator": "cityAnnationService",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private CityAnnationService cityAnnationService;",
"type": "CityAnnationService",
"var_name": "cityAnnationService"
}
],
"file": "eureka-client-b/src/test/java/com/ggj/service/CityAnnationServiceTest.java",
"identifier": "CityAnnationServiceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetCity() throws Exception {\n City city=cityAnnationService.getCity(1);\n assertTrue(\"执行出错!\"+city.getName(),\"beijin\".equals(city.getName()));\n }",
"class_method_signature": "CityAnnationServiceTest.testGetCity()",
"constructor": false,
"full_signature": "@Test public void testGetCity()",
"identifier": "testGetCity",
"invocations": [
"getCity",
"assertTrue",
"\"beijin",
"y.getN",
");"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetCity()",
"testcase": true
} | {
"fields": [
{
"declarator": "cityAnnationDao",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private CityAnnationDao cityAnnationDao;",
"type": "CityAnnationDao",
"var_name": "cityAnnationDao"
}
],
"file": "eureka-client-b/src/main/java/com/ggj/service/CityAnnationService.java",
"identifier": "CityAnnationService",
"interfaces": "",
"methods": [
{
"class_method_signature": "CityAnnationService.getCity(int id)",
"constructor": false,
"full_signature": "public City getCity(int id)",
"identifier": "getCity",
"modifiers": "public",
"parameters": "(int id)",
"return": "City",
"signature": "City getCity(int id)",
"testcase": false
},
{
"class_method_signature": "CityAnnationService.insert(City city)",
"constructor": false,
"full_signature": "@Transactional(readOnly = false) public void insert(City city)",
"identifier": "insert",
"modifiers": "@Transactional(readOnly = false) public",
"parameters": "(City city)",
"return": "void",
"signature": "void insert(City city)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public City getCity(int id){\n return cityAnnationDao.getCity(id);\n }",
"class_method_signature": "CityAnnationService.getCity(int id)",
"constructor": false,
"full_signature": "public City getCity(int id)",
"identifier": "getCity",
"invocations": [
"getCity"
],
"modifiers": "public",
"parameters": "(int id)",
"return": "City",
"signature": "City getCity(int id)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 50092217,
"size": 345,
"stargazer_count": 26,
"stars": null,
"updates": null,
"url": "https://github.com/ggj2010/springcloudsamples-ggj"
} |
50092217_4 | {
"fields": [
{
"declarator": "cityAnnationService",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private CityAnnationService cityAnnationService;",
"type": "CityAnnationService",
"var_name": "cityAnnationService"
}
],
"file": "eureka-client-b/src/test/java/com/ggj/service/CityAnnationServiceTest.java",
"identifier": "CityAnnationServiceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testInsert() throws Exception {\n City city=new City(\"shanghai-annation\",\"SH-annation\");\n cityAnnationService.insert(city);\n }",
"class_method_signature": "CityAnnationServiceTest.testInsert()",
"constructor": false,
"full_signature": "@Test public void testInsert()",
"identifier": "testInsert",
"invocations": [
"insert"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testInsert()",
"testcase": true
} | {
"fields": [
{
"declarator": "cityAnnationDao",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private CityAnnationDao cityAnnationDao;",
"type": "CityAnnationDao",
"var_name": "cityAnnationDao"
}
],
"file": "eureka-client-b/src/main/java/com/ggj/service/CityAnnationService.java",
"identifier": "CityAnnationService",
"interfaces": "",
"methods": [
{
"class_method_signature": "CityAnnationService.getCity(int id)",
"constructor": false,
"full_signature": "public City getCity(int id)",
"identifier": "getCity",
"modifiers": "public",
"parameters": "(int id)",
"return": "City",
"signature": "City getCity(int id)",
"testcase": false
},
{
"class_method_signature": "CityAnnationService.insert(City city)",
"constructor": false,
"full_signature": "@Transactional(readOnly = false) public void insert(City city)",
"identifier": "insert",
"modifiers": "@Transactional(readOnly = false) public",
"parameters": "(City city)",
"return": "void",
"signature": "void insert(City city)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Transactional(readOnly = false)\n public void insert(City city){\n cityAnnationDao.insert(city);\n }",
"class_method_signature": "CityAnnationService.insert(City city)",
"constructor": false,
"full_signature": "@Transactional(readOnly = false) public void insert(City city)",
"identifier": "insert",
"invocations": [
"insert"
],
"modifiers": "@Transactional(readOnly = false) public",
"parameters": "(City city)",
"return": "void",
"signature": "void insert(City city)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 50092217,
"size": 345,
"stargazer_count": 26,
"stars": null,
"updates": null,
"url": "https://github.com/ggj2010/springcloudsamples-ggj"
} |
50092217_0 | {
"fields": [
{
"declarator": "cityService",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private CityService cityService;",
"type": "CityService",
"var_name": "cityService"
},
{
"declarator": "thrown= ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown= ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "eureka-client-b/src/test/java/com/ggj/service/CityServiceTest.java",
"identifier": "CityServiceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetCity() {\n City city= cityService.getCity(1);\n assertTrue(\"执行出错!\"+city.getName(),\"beijin\".equals(city.getName()));\n }",
"class_method_signature": "CityServiceTest.testGetCity()",
"constructor": false,
"full_signature": "@Test public void testGetCity()",
"identifier": "testGetCity",
"invocations": [
"getCity",
"assertTrue",
"\"beijin",
"y.getN",
");"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testGetCity()",
"testcase": true
} | {
"fields": [
{
"declarator": "cityDao",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private CityDao cityDao;",
"type": "CityDao",
"var_name": "cityDao"
}
],
"file": "eureka-client-b/src/main/java/com/ggj/service/CityService.java",
"identifier": "CityService",
"interfaces": "",
"methods": [
{
"class_method_signature": "CityService.getCity(int id)",
"constructor": false,
"full_signature": "public City getCity(int id)",
"identifier": "getCity",
"modifiers": "public",
"parameters": "(int id)",
"return": "City",
"signature": "City getCity(int id)",
"testcase": false
},
{
"class_method_signature": "CityService.insert(City city)",
"constructor": false,
"full_signature": "@Transactional(readOnly = false) public void insert(City city)",
"identifier": "insert",
"modifiers": "@Transactional(readOnly = false) public",
"parameters": "(City city)",
"return": "void",
"signature": "void insert(City city)",
"testcase": false
},
{
"class_method_signature": "CityService.transation()",
"constructor": false,
"full_signature": "@Transactional(readOnly = false) public void transation()",
"identifier": "transation",
"modifiers": "@Transactional(readOnly = false) public",
"parameters": "()",
"return": "void",
"signature": "void transation()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public City getCity(int id){\n return cityDao.getCity(id);\n }",
"class_method_signature": "CityService.getCity(int id)",
"constructor": false,
"full_signature": "public City getCity(int id)",
"identifier": "getCity",
"invocations": [
"getCity"
],
"modifiers": "public",
"parameters": "(int id)",
"return": "City",
"signature": "City getCity(int id)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 50092217,
"size": 345,
"stargazer_count": 26,
"stars": null,
"updates": null,
"url": "https://github.com/ggj2010/springcloudsamples-ggj"
} |
50092217_1 | {
"fields": [
{
"declarator": "cityService",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private CityService cityService;",
"type": "CityService",
"var_name": "cityService"
},
{
"declarator": "thrown= ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown= ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "eureka-client-b/src/test/java/com/ggj/service/CityServiceTest.java",
"identifier": "CityServiceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testInsert() {\n City city=new City(\"shanghai\",\"SH\");\n cityService.insert(city);\n }",
"class_method_signature": "CityServiceTest.testInsert()",
"constructor": false,
"full_signature": "@Test public void testInsert()",
"identifier": "testInsert",
"invocations": [
"insert"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testInsert()",
"testcase": true
} | {
"fields": [
{
"declarator": "cityDao",
"modifier": "@Autowired\n private",
"original_string": "@Autowired\n private CityDao cityDao;",
"type": "CityDao",
"var_name": "cityDao"
}
],
"file": "eureka-client-b/src/main/java/com/ggj/service/CityService.java",
"identifier": "CityService",
"interfaces": "",
"methods": [
{
"class_method_signature": "CityService.getCity(int id)",
"constructor": false,
"full_signature": "public City getCity(int id)",
"identifier": "getCity",
"modifiers": "public",
"parameters": "(int id)",
"return": "City",
"signature": "City getCity(int id)",
"testcase": false
},
{
"class_method_signature": "CityService.insert(City city)",
"constructor": false,
"full_signature": "@Transactional(readOnly = false) public void insert(City city)",
"identifier": "insert",
"modifiers": "@Transactional(readOnly = false) public",
"parameters": "(City city)",
"return": "void",
"signature": "void insert(City city)",
"testcase": false
},
{
"class_method_signature": "CityService.transation()",
"constructor": false,
"full_signature": "@Transactional(readOnly = false) public void transation()",
"identifier": "transation",
"modifiers": "@Transactional(readOnly = false) public",
"parameters": "()",
"return": "void",
"signature": "void transation()",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@Transactional(readOnly = false)\n public void insert(City city){\n cityDao.insert(city);\n }",
"class_method_signature": "CityService.insert(City city)",
"constructor": false,
"full_signature": "@Transactional(readOnly = false) public void insert(City city)",
"identifier": "insert",
"invocations": [
"insert"
],
"modifiers": "@Transactional(readOnly = false) public",
"parameters": "(City city)",
"return": "void",
"signature": "void insert(City city)",
"testcase": false
} | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 50092217,
"size": 345,
"stargazer_count": 26,
"stars": null,
"updates": null,
"url": "https://github.com/ggj2010/springcloudsamples-ggj"
} |
20473418_48 | {
"fields": [],
"file": "phoenix-core/src/test/java/org/apache/phoenix/util/JDBCUtilTest.java",
"identifier": "JDBCUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSchema() {\n assertTrue(JDBCUtil.getSchema(\"localhost;schema=TEST\", new Properties(), null).equals(\"TEST\"));\n assertNull(JDBCUtil.getSchema(\"localhost;schema=\", new Properties(), null));\n assertNull(JDBCUtil.getSchema(\"localhost;\", new Properties(), null));\n }",
"class_method_signature": "JDBCUtilTest.testSchema()",
"constructor": false,
"full_signature": "@Test public void testSchema()",
"identifier": "testSchema",
"invocations": [
"assertTrue",
"equals",
"getSchema",
"assertNull",
"getSchema",
"assertNull",
"getSchema"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testSchema()",
"testcase": true
} | {
"fields": [],
"file": "phoenix-core/src/main/java/org/apache/phoenix/util/JDBCUtil.java",
"identifier": "JDBCUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "JDBCUtil.JDBCUtil()",
"constructor": true,
"full_signature": "private JDBCUtil()",
"identifier": "JDBCUtil",
"modifiers": "private",
"parameters": "()",
"return": "",
"signature": " JDBCUtil()",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.findProperty(String url, Properties info, String propName)",
"constructor": false,
"full_signature": "public static String findProperty(String url, Properties info, String propName)",
"identifier": "findProperty",
"modifiers": "public static",
"parameters": "(String url, Properties info, String propName)",
"return": "String",
"signature": "String findProperty(String url, Properties info, String propName)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.removeProperty(String url, String propName)",
"constructor": false,
"full_signature": "public static String removeProperty(String url, String propName)",
"identifier": "removeProperty",
"modifiers": "public static",
"parameters": "(String url, String propName)",
"return": "String",
"signature": "String removeProperty(String url, String propName)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.getCombinedConnectionProperties(String url, Properties info)",
"constructor": false,
"full_signature": "private static Map<String, String> getCombinedConnectionProperties(String url, Properties info)",
"identifier": "getCombinedConnectionProperties",
"modifiers": "private static",
"parameters": "(String url, Properties info)",
"return": "Map<String, String>",
"signature": "Map<String, String> getCombinedConnectionProperties(String url, Properties info)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.getAnnotations(@NonNull String url, @NonNull Properties info)",
"constructor": false,
"full_signature": "public static Map<String, String> getAnnotations(@NonNull String url, @NonNull Properties info)",
"identifier": "getAnnotations",
"modifiers": "public static",
"parameters": "(@NonNull String url, @NonNull Properties info)",
"return": "Map<String, String>",
"signature": "Map<String, String> getAnnotations(@NonNull String url, @NonNull Properties info)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.getCurrentSCN(String url, Properties info)",
"constructor": false,
"full_signature": "public static Long getCurrentSCN(String url, Properties info)",
"identifier": "getCurrentSCN",
"modifiers": "public static",
"parameters": "(String url, Properties info)",
"return": "Long",
"signature": "Long getCurrentSCN(String url, Properties info)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.getBuildIndexSCN(String url, Properties info)",
"constructor": false,
"full_signature": "public static Long getBuildIndexSCN(String url, Properties info)",
"identifier": "getBuildIndexSCN",
"modifiers": "public static",
"parameters": "(String url, Properties info)",
"return": "Long",
"signature": "Long getBuildIndexSCN(String url, Properties info)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.getMutateBatchSize(String url, Properties info, ReadOnlyProps props)",
"constructor": false,
"full_signature": "public static int getMutateBatchSize(String url, Properties info, ReadOnlyProps props)",
"identifier": "getMutateBatchSize",
"modifiers": "public static",
"parameters": "(String url, Properties info, ReadOnlyProps props)",
"return": "int",
"signature": "int getMutateBatchSize(String url, Properties info, ReadOnlyProps props)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.getMutateBatchSizeBytes(String url, Properties info, ReadOnlyProps props)",
"constructor": false,
"full_signature": "public static long getMutateBatchSizeBytes(String url, Properties info, ReadOnlyProps props)",
"identifier": "getMutateBatchSizeBytes",
"modifiers": "public static",
"parameters": "(String url, Properties info, ReadOnlyProps props)",
"return": "long",
"signature": "long getMutateBatchSizeBytes(String url, Properties info, ReadOnlyProps props)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.getTenantId(String url, Properties info)",
"constructor": false,
"full_signature": "public static @Nullable PName getTenantId(String url, Properties info)",
"identifier": "getTenantId",
"modifiers": "public static @Nullable",
"parameters": "(String url, Properties info)",
"return": "PName",
"signature": "PName getTenantId(String url, Properties info)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.getAutoCommit(String url, Properties info, boolean defaultValue)",
"constructor": false,
"full_signature": "public static boolean getAutoCommit(String url, Properties info, boolean defaultValue)",
"identifier": "getAutoCommit",
"modifiers": "public static",
"parameters": "(String url, Properties info, boolean defaultValue)",
"return": "boolean",
"signature": "boolean getAutoCommit(String url, Properties info, boolean defaultValue)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.getConsistencyLevel(String url, Properties info, String defaultValue)",
"constructor": false,
"full_signature": "public static Consistency getConsistencyLevel(String url, Properties info, String defaultValue)",
"identifier": "getConsistencyLevel",
"modifiers": "public static",
"parameters": "(String url, Properties info, String defaultValue)",
"return": "Consistency",
"signature": "Consistency getConsistencyLevel(String url, Properties info, String defaultValue)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.isCollectingRequestLevelMetricsEnabled(String url, Properties overrideProps, ReadOnlyProps queryServicesProps)",
"constructor": false,
"full_signature": "public static boolean isCollectingRequestLevelMetricsEnabled(String url, Properties overrideProps, ReadOnlyProps queryServicesProps)",
"identifier": "isCollectingRequestLevelMetricsEnabled",
"modifiers": "public static",
"parameters": "(String url, Properties overrideProps, ReadOnlyProps queryServicesProps)",
"return": "boolean",
"signature": "boolean isCollectingRequestLevelMetricsEnabled(String url, Properties overrideProps, ReadOnlyProps queryServicesProps)",
"testcase": false
},
{
"class_method_signature": "JDBCUtil.getSchema(String url, Properties info, String defaultValue)",
"constructor": false,
"full_signature": "public static String getSchema(String url, Properties info, String defaultValue)",
"identifier": "getSchema",
"modifiers": "public static",
"parameters": "(String url, Properties info, String defaultValue)",
"return": "String",
"signature": "String getSchema(String url, Properties info, String defaultValue)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static String getSchema(String url, Properties info, String defaultValue) {\n String schema = findProperty(url, info, PhoenixRuntime.SCHEMA_ATTRIB);\n return (schema == null || schema.equals(\"\")) ? defaultValue : schema;\n }",
"class_method_signature": "JDBCUtil.getSchema(String url, Properties info, String defaultValue)",
"constructor": false,
"full_signature": "public static String getSchema(String url, Properties info, String defaultValue)",
"identifier": "getSchema",
"invocations": [
"findProperty",
"equals"
],
"modifiers": "public static",
"parameters": "(String url, Properties info, String defaultValue)",
"return": "String",
"signature": "String getSchema(String url, Properties info, String defaultValue)",
"testcase": false
} | {
"created": "6/4/2014 7:00:08 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 20473418,
"size": null,
"stargazer_count": null,
"stars": 752,
"updates": "2020-01-27T08:20:53+00:00",
"url": "https://github.com/apache/phoenix"
} |
20473418_188 | {
"fields": [
{
"declarator": "schema",
"modifier": "private static",
"original_string": "private static String schema;",
"type": "String",
"var_name": "schema"
},
{
"declarator": "baseTable",
"modifier": "private static",
"original_string": "private static String baseTable;",
"type": "String",
"var_name": "baseTable"
},
{
"declarator": "phxConn",
"modifier": "private static",
"original_string": "private static PhoenixConnection phxConn;",
"type": "PhoenixConnection",
"var_name": "phxConn"
},
{
"declarator": "mockClient",
"modifier": "private static",
"original_string": "private static MetaDataClient mockClient;",
"type": "MetaDataClient",
"var_name": "mockClient"
},
{
"declarator": "ddlFormat",
"modifier": "private static",
"original_string": "private static String ddlFormat;",
"type": "String",
"var_name": "ddlFormat"
},
{
"declarator": "stmt",
"modifier": "private static",
"original_string": "private static CreateTableStatement stmt;",
"type": "CreateTableStatement",
"var_name": "stmt"
}
],
"file": "phoenix-core/src/test/java/org/apache/phoenix/schema/MetaDataClientTest.java",
"identifier": "MetaDataClientTest",
"interfaces": "",
"superclass": "extends BaseConnectionlessQueryTest"
} | {
"body": "@Test\n //Testing the case when Mutation code thrown from sever is not handled by MetaDataClient\n public void testHandleCreateTableMutationCodeWithNewCode() throws SQLException {\n MetaDataProtocol.MetaDataMutationResult result = new MetaDataProtocol\n .MetaDataMutationResult(MetaDataProtocol.MutationCode.NO_PK_COLUMNS,\n new PSchema(schema), EnvironmentEdgeManager.currentTimeMillis());\n try {\n mockClient.handleCreateTableMutationCode(result, result.getMutationCode(), stmt,\n schema, baseTable, null);\n } catch (SQLException e) {\n assertEquals(SQLExceptionCode.UNEXPECTED_MUTATION_CODE.getErrorCode(),\n e.getErrorCode());\n assertTrue(e.getMessage().contains(\"NO_PK_COLUMNS\"));\n }\n }",
"class_method_signature": "MetaDataClientTest.testHandleCreateTableMutationCodeWithNewCode()",
"constructor": false,
"full_signature": "@Test //Testing the case when Mutation code thrown from sever is not handled by MetaDataClient public void testHandleCreateTableMutationCodeWithNewCode()",
"identifier": "testHandleCreateTableMutationCodeWithNewCode",
"invocations": [
"currentTimeMillis",
"handleCreateTableMutationCode",
"getMutationCode",
"assertEquals",
"getErrorCode",
"getErrorCode",
"assertTrue",
"contains",
"getMessage"
],
"modifiers": "@Test //Testing the case when Mutation code thrown from sever is not handled by MetaDataClient public",
"parameters": "()",
"return": "void",
"signature": "void testHandleCreateTableMutationCodeWithNewCode()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(MetaDataClient.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MetaDataClient.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "FACTORY = new ParseNodeFactory()",
"modifier": "private static final",
"original_string": "private static final ParseNodeFactory FACTORY = new ParseNodeFactory();",
"type": "ParseNodeFactory",
"var_name": "FACTORY"
},
{
"declarator": "SET_ASYNC_CREATED_DATE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n ASYNC_CREATED_DATE + \" \" + PDate.INSTANCE.getSqlTypeName() +\n \") VALUES (?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String SET_ASYNC_CREATED_DATE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n ASYNC_CREATED_DATE + \" \" + PDate.INSTANCE.getSqlTypeName() +\n \") VALUES (?, ?, ?, ?)\";",
"type": "String",
"var_name": "SET_ASYNC_CREATED_DATE"
},
{
"declarator": "SET_INDEX_SYNC_CREATED_DATE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n SYNC_INDEX_CREATED_DATE + \" \" + PDate.INSTANCE.getSqlTypeName() +\n \") VALUES (?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String SET_INDEX_SYNC_CREATED_DATE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n SYNC_INDEX_CREATED_DATE + \" \" + PDate.INSTANCE.getSqlTypeName() +\n \") VALUES (?, ?, ?, ?)\";",
"type": "String",
"var_name": "SET_INDEX_SYNC_CREATED_DATE"
},
{
"declarator": "CREATE_TABLE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n TABLE_TYPE + \",\" +\n TABLE_SEQ_NUM + \",\" +\n COLUMN_COUNT + \",\" +\n SALT_BUCKETS + \",\" +\n PK_NAME + \",\" +\n DATA_TABLE_NAME + \",\" +\n INDEX_STATE + \",\" +\n IMMUTABLE_ROWS + \",\" +\n DEFAULT_COLUMN_FAMILY_NAME + \",\" +\n VIEW_STATEMENT + \",\" +\n DISABLE_WAL + \",\" +\n MULTI_TENANT + \",\" +\n VIEW_TYPE + \",\" +\n INDEX_TYPE + \",\" +\n STORE_NULLS + \",\" +\n BASE_COLUMN_COUNT + \",\" +\n TRANSACTION_PROVIDER + \",\" +\n UPDATE_CACHE_FREQUENCY + \",\" +\n IS_NAMESPACE_MAPPED + \",\" +\n AUTO_PARTITION_SEQ + \",\" +\n APPEND_ONLY_SCHEMA + \",\" +\n GUIDE_POSTS_WIDTH + \",\" +\n IMMUTABLE_STORAGE_SCHEME + \",\" +\n ENCODING_SCHEME + \",\" +\n USE_STATS_FOR_PARALLELIZATION +\",\" +\n VIEW_INDEX_ID_DATA_TYPE +\",\" +\n PHOENIX_TTL +\",\" +\n PHOENIX_TTL_HWM +\n \") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String CREATE_TABLE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n TABLE_TYPE + \",\" +\n TABLE_SEQ_NUM + \",\" +\n COLUMN_COUNT + \",\" +\n SALT_BUCKETS + \",\" +\n PK_NAME + \",\" +\n DATA_TABLE_NAME + \",\" +\n INDEX_STATE + \",\" +\n IMMUTABLE_ROWS + \",\" +\n DEFAULT_COLUMN_FAMILY_NAME + \",\" +\n VIEW_STATEMENT + \",\" +\n DISABLE_WAL + \",\" +\n MULTI_TENANT + \",\" +\n VIEW_TYPE + \",\" +\n INDEX_TYPE + \",\" +\n STORE_NULLS + \",\" +\n BASE_COLUMN_COUNT + \",\" +\n TRANSACTION_PROVIDER + \",\" +\n UPDATE_CACHE_FREQUENCY + \",\" +\n IS_NAMESPACE_MAPPED + \",\" +\n AUTO_PARTITION_SEQ + \",\" +\n APPEND_ONLY_SCHEMA + \",\" +\n GUIDE_POSTS_WIDTH + \",\" +\n IMMUTABLE_STORAGE_SCHEME + \",\" +\n ENCODING_SCHEME + \",\" +\n USE_STATS_FOR_PARALLELIZATION +\",\" +\n VIEW_INDEX_ID_DATA_TYPE +\",\" +\n PHOENIX_TTL +\",\" +\n PHOENIX_TTL_HWM +\n \") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "CREATE_TABLE"
},
{
"declarator": "CREATE_SCHEMA = \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE\n + \"\\\"( \" + TABLE_SCHEM + \",\" + TABLE_NAME + \") VALUES (?,?)\"",
"modifier": "private static final",
"original_string": "private static final String CREATE_SCHEMA = \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE\n + \"\\\"( \" + TABLE_SCHEM + \",\" + TABLE_NAME + \") VALUES (?,?)\";",
"type": "String",
"var_name": "CREATE_SCHEMA"
},
{
"declarator": "CREATE_LINK =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n LINK_TYPE + \",\" +\n TABLE_SEQ_NUM +\",\"+ // this is actually set to the parent table's sequence number\n TABLE_TYPE +\n \") VALUES (?, ?, ?, ?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String CREATE_LINK =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n LINK_TYPE + \",\" +\n TABLE_SEQ_NUM +\",\"+ // this is actually set to the parent table's sequence number\n TABLE_TYPE +\n \") VALUES (?, ?, ?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "CREATE_LINK"
},
{
"declarator": "CREATE_VIEW_LINK =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n LINK_TYPE + \",\" +\n PARENT_TENANT_ID + \" \" + PVarchar.INSTANCE.getSqlTypeName() + // Dynamic column for now to prevent schema change\n \") VALUES (?, ?, ?, ?, ?, ?)\"",
"modifier": "public static final",
"original_string": "public static final String CREATE_VIEW_LINK =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n LINK_TYPE + \",\" +\n PARENT_TENANT_ID + \" \" + PVarchar.INSTANCE.getSqlTypeName() + // Dynamic column for now to prevent schema change\n \") VALUES (?, ?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "CREATE_VIEW_LINK"
},
{
"declarator": "UPDATE_ENCODED_COLUMN_COUNTER = \n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \", \" + \n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n COLUMN_QUALIFIER_COUNTER + \n \") VALUES (?, ?, ?, ?, ?)\"",
"modifier": "public static final",
"original_string": "public static final String UPDATE_ENCODED_COLUMN_COUNTER = \n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \", \" + \n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n COLUMN_QUALIFIER_COUNTER + \n \") VALUES (?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "UPDATE_ENCODED_COLUMN_COUNTER"
},
{
"declarator": "CREATE_CHILD_LINK =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n LINK_TYPE + \n \") VALUES (?, ?, ?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String CREATE_CHILD_LINK =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n LINK_TYPE + \n \") VALUES (?, ?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "CREATE_CHILD_LINK"
},
{
"declarator": "CREATE_VIEW_INDEX_PARENT_LINK =\n \t\t\"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n LINK_TYPE + \n \") VALUES (?, ?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String CREATE_VIEW_INDEX_PARENT_LINK =\n \t\t\"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n LINK_TYPE + \n \") VALUES (?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "CREATE_VIEW_INDEX_PARENT_LINK"
},
{
"declarator": "INCREMENT_SEQ_NUM =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n TABLE_SEQ_NUM +\n \") VALUES (?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String INCREMENT_SEQ_NUM =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n TABLE_SEQ_NUM +\n \") VALUES (?, ?, ?, ?)\";",
"type": "String",
"var_name": "INCREMENT_SEQ_NUM"
},
{
"declarator": "MUTATE_TABLE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n TABLE_TYPE + \",\" +\n TABLE_SEQ_NUM + \",\" +\n COLUMN_COUNT +\n \") VALUES (?, ?, ?, ?, ?, ?)\"",
"modifier": "public static final",
"original_string": "public static final String MUTATE_TABLE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n TABLE_TYPE + \",\" +\n TABLE_SEQ_NUM + \",\" +\n COLUMN_COUNT +\n \") VALUES (?, ?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "MUTATE_TABLE"
},
{
"declarator": "UPDATE_INDEX_STATE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n INDEX_STATE + \",\" +\n ASYNC_REBUILD_TIMESTAMP + \" \" + PLong.INSTANCE.getSqlTypeName() +\n \") VALUES (?, ?, ?, ?, ?)\"",
"modifier": "public static final",
"original_string": "public static final String UPDATE_INDEX_STATE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n INDEX_STATE + \",\" +\n ASYNC_REBUILD_TIMESTAMP + \" \" + PLong.INSTANCE.getSqlTypeName() +\n \") VALUES (?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "UPDATE_INDEX_STATE"
},
{
"declarator": "UPDATE_INDEX_REBUILD_ASYNC_STATE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n ASYNC_REBUILD_TIMESTAMP + \" \" + PLong.INSTANCE.getSqlTypeName() +\n \") VALUES (?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String UPDATE_INDEX_REBUILD_ASYNC_STATE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n ASYNC_REBUILD_TIMESTAMP + \" \" + PLong.INSTANCE.getSqlTypeName() +\n \") VALUES (?, ?, ?, ?)\";",
"type": "String",
"var_name": "UPDATE_INDEX_REBUILD_ASYNC_STATE"
},
{
"declarator": "UPDATE_INDEX_STATE_TO_ACTIVE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n INDEX_STATE + \",\" +\n INDEX_DISABLE_TIMESTAMP +\",\"+\n ASYNC_REBUILD_TIMESTAMP + \" \" + PLong.INSTANCE.getSqlTypeName() +\n \") VALUES (?, ?, ?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String UPDATE_INDEX_STATE_TO_ACTIVE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n INDEX_STATE + \",\" +\n INDEX_DISABLE_TIMESTAMP +\",\"+\n ASYNC_REBUILD_TIMESTAMP + \" \" + PLong.INSTANCE.getSqlTypeName() +\n \") VALUES (?, ?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "UPDATE_INDEX_STATE_TO_ACTIVE"
},
{
"declarator": "INSERT_COLUMN_CREATE_TABLE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n DATA_TYPE + \",\" +\n NULLABLE + \",\" +\n COLUMN_SIZE + \",\" +\n DECIMAL_DIGITS + \",\" +\n ORDINAL_POSITION + \",\" +\n SORT_ORDER + \",\" +\n DATA_TABLE_NAME + \",\" + // write this both in the column and table rows for access by metadata APIs\n ARRAY_SIZE + \",\" +\n VIEW_CONSTANT + \",\" +\n IS_VIEW_REFERENCED + \",\" +\n PK_NAME + \",\" + // write this both in the column and table rows for access by metadata APIs\n KEY_SEQ + \",\" +\n COLUMN_DEF + \",\" +\n COLUMN_QUALIFIER + \", \" +\n IS_ROW_TIMESTAMP +\n \") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String INSERT_COLUMN_CREATE_TABLE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n DATA_TYPE + \",\" +\n NULLABLE + \",\" +\n COLUMN_SIZE + \",\" +\n DECIMAL_DIGITS + \",\" +\n ORDINAL_POSITION + \",\" +\n SORT_ORDER + \",\" +\n DATA_TABLE_NAME + \",\" + // write this both in the column and table rows for access by metadata APIs\n ARRAY_SIZE + \",\" +\n VIEW_CONSTANT + \",\" +\n IS_VIEW_REFERENCED + \",\" +\n PK_NAME + \",\" + // write this both in the column and table rows for access by metadata APIs\n KEY_SEQ + \",\" +\n COLUMN_DEF + \",\" +\n COLUMN_QUALIFIER + \", \" +\n IS_ROW_TIMESTAMP +\n \") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "INSERT_COLUMN_CREATE_TABLE"
},
{
"declarator": "ALTER_SYSCATALOG_TABLE_UPGRADE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n DATA_TYPE + \",\" +\n NULLABLE + \",\" +\n COLUMN_SIZE + \",\" +\n DECIMAL_DIGITS + \",\" +\n ORDINAL_POSITION + \",\" +\n SORT_ORDER + \",\" +\n DATA_TABLE_NAME + \",\" + // write this both in the column and table rows for access by metadata APIs\n ARRAY_SIZE + \",\" +\n VIEW_CONSTANT + \",\" +\n IS_VIEW_REFERENCED + \",\" +\n PK_NAME + \",\" + // write this both in the column and table rows for access by metadata APIs\n KEY_SEQ + \",\" +\n COLUMN_DEF +\n \") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String ALTER_SYSCATALOG_TABLE_UPGRADE =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\"( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n DATA_TYPE + \",\" +\n NULLABLE + \",\" +\n COLUMN_SIZE + \",\" +\n DECIMAL_DIGITS + \",\" +\n ORDINAL_POSITION + \",\" +\n SORT_ORDER + \",\" +\n DATA_TABLE_NAME + \",\" + // write this both in the column and table rows for access by metadata APIs\n ARRAY_SIZE + \",\" +\n VIEW_CONSTANT + \",\" +\n IS_VIEW_REFERENCED + \",\" +\n PK_NAME + \",\" + // write this both in the column and table rows for access by metadata APIs\n KEY_SEQ + \",\" +\n COLUMN_DEF +\n \") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "ALTER_SYSCATALOG_TABLE_UPGRADE"
},
{
"declarator": "UPDATE_COLUMN_POSITION =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\" ( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n ORDINAL_POSITION +\n \") VALUES (?, ?, ?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String UPDATE_COLUMN_POSITION =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_CATALOG_TABLE + \"\\\" ( \" +\n TENANT_ID + \",\" +\n TABLE_SCHEM + \",\" +\n TABLE_NAME + \",\" +\n COLUMN_NAME + \",\" +\n COLUMN_FAMILY + \",\" +\n ORDINAL_POSITION +\n \") VALUES (?, ?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "UPDATE_COLUMN_POSITION"
},
{
"declarator": "CREATE_FUNCTION =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_FUNCTION_TABLE + \"\\\" ( \" +\n TENANT_ID +\",\"+\n FUNCTION_NAME + \",\" +\n NUM_ARGS + \",\" +\n CLASS_NAME + \",\" +\n JAR_PATH + \",\" +\n RETURN_TYPE +\n \") VALUES (?, ?, ?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String CREATE_FUNCTION =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_FUNCTION_TABLE + \"\\\" ( \" +\n TENANT_ID +\",\"+\n FUNCTION_NAME + \",\" +\n NUM_ARGS + \",\" +\n CLASS_NAME + \",\" +\n JAR_PATH + \",\" +\n RETURN_TYPE +\n \") VALUES (?, ?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "CREATE_FUNCTION"
},
{
"declarator": "INSERT_FUNCTION_ARGUMENT =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_FUNCTION_TABLE + \"\\\" ( \" +\n TENANT_ID +\",\"+\n FUNCTION_NAME + \",\" +\n TYPE + \",\" +\n ARG_POSITION +\",\"+\n IS_ARRAY + \",\" +\n IS_CONSTANT + \",\" +\n DEFAULT_VALUE + \",\" +\n MIN_VALUE + \",\" +\n MAX_VALUE +\n \") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)\"",
"modifier": "private static final",
"original_string": "private static final String INSERT_FUNCTION_ARGUMENT =\n \"UPSERT INTO \" + SYSTEM_CATALOG_SCHEMA + \".\\\"\" + SYSTEM_FUNCTION_TABLE + \"\\\" ( \" +\n TENANT_ID +\",\"+\n FUNCTION_NAME + \",\" +\n TYPE + \",\" +\n ARG_POSITION +\",\"+\n IS_ARRAY + \",\" +\n IS_CONSTANT + \",\" +\n DEFAULT_VALUE + \",\" +\n MIN_VALUE + \",\" +\n MAX_VALUE +\n \") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)\";",
"type": "String",
"var_name": "INSERT_FUNCTION_ARGUMENT"
},
{
"declarator": "EMPTY_TABLE = \" \"",
"modifier": "public static final",
"original_string": "public static final String EMPTY_TABLE = \" \";",
"type": "String",
"var_name": "EMPTY_TABLE"
},
{
"declarator": "connection",
"modifier": "private final",
"original_string": "private final PhoenixConnection connection;",
"type": "PhoenixConnection",
"var_name": "connection"
}
],
"file": "phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java",
"identifier": "MetaDataClient",
"interfaces": "",
"methods": [
{
"class_method_signature": "MetaDataClient.MetaDataClient(PhoenixConnection connection)",
"constructor": true,
"full_signature": "public MetaDataClient(PhoenixConnection connection)",
"identifier": "MetaDataClient",
"modifiers": "public",
"parameters": "(PhoenixConnection connection)",
"return": "",
"signature": " MetaDataClient(PhoenixConnection connection)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getConnection()",
"constructor": false,
"full_signature": "public PhoenixConnection getConnection()",
"identifier": "getConnection",
"modifiers": "public",
"parameters": "()",
"return": "PhoenixConnection",
"signature": "PhoenixConnection getConnection()",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getCurrentTime(String schemaName, String tableName)",
"constructor": false,
"full_signature": "public long getCurrentTime(String schemaName, String tableName)",
"identifier": "getCurrentTime",
"modifiers": "public",
"parameters": "(String schemaName, String tableName)",
"return": "long",
"signature": "long getCurrentTime(String schemaName, String tableName)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateCache(String schemaName, String tableName)",
"constructor": false,
"full_signature": "public MetaDataMutationResult updateCache(String schemaName, String tableName)",
"identifier": "updateCache",
"modifiers": "public",
"parameters": "(String schemaName, String tableName)",
"return": "MetaDataMutationResult",
"signature": "MetaDataMutationResult updateCache(String schemaName, String tableName)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateCache(String schemaName, String tableName,\n boolean alwaysHitServer)",
"constructor": false,
"full_signature": "public MetaDataMutationResult updateCache(String schemaName, String tableName,\n boolean alwaysHitServer)",
"identifier": "updateCache",
"modifiers": "public",
"parameters": "(String schemaName, String tableName,\n boolean alwaysHitServer)",
"return": "MetaDataMutationResult",
"signature": "MetaDataMutationResult updateCache(String schemaName, String tableName,\n boolean alwaysHitServer)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateCache(PName tenantId, String schemaName, String tableName, boolean alwaysHitServer)",
"constructor": false,
"full_signature": "public MetaDataMutationResult updateCache(PName tenantId, String schemaName, String tableName, boolean alwaysHitServer)",
"identifier": "updateCache",
"modifiers": "public",
"parameters": "(PName tenantId, String schemaName, String tableName, boolean alwaysHitServer)",
"return": "MetaDataMutationResult",
"signature": "MetaDataMutationResult updateCache(PName tenantId, String schemaName, String tableName, boolean alwaysHitServer)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateCache(List<String> functionNames)",
"constructor": false,
"full_signature": "public MetaDataMutationResult updateCache(List<String> functionNames)",
"identifier": "updateCache",
"modifiers": "public",
"parameters": "(List<String> functionNames)",
"return": "MetaDataMutationResult",
"signature": "MetaDataMutationResult updateCache(List<String> functionNames)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateCache(List<String> functionNames, boolean alwaysHitServer)",
"constructor": false,
"full_signature": "private MetaDataMutationResult updateCache(List<String> functionNames, boolean alwaysHitServer)",
"identifier": "updateCache",
"modifiers": "private",
"parameters": "(List<String> functionNames, boolean alwaysHitServer)",
"return": "MetaDataMutationResult",
"signature": "MetaDataMutationResult updateCache(List<String> functionNames, boolean alwaysHitServer)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateCache(PName tenantId, List<String> functionNames)",
"constructor": false,
"full_signature": "public MetaDataMutationResult updateCache(PName tenantId, List<String> functionNames)",
"identifier": "updateCache",
"modifiers": "public",
"parameters": "(PName tenantId, List<String> functionNames)",
"return": "MetaDataMutationResult",
"signature": "MetaDataMutationResult updateCache(PName tenantId, List<String> functionNames)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getClientTimeStamp()",
"constructor": false,
"full_signature": "private long getClientTimeStamp()",
"identifier": "getClientTimeStamp",
"modifiers": "private",
"parameters": "()",
"return": "long",
"signature": "long getClientTimeStamp()",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getCurrentScn()",
"constructor": false,
"full_signature": "private long getCurrentScn()",
"identifier": "getCurrentScn",
"modifiers": "private",
"parameters": "()",
"return": "long",
"signature": "long getCurrentScn()",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateCache(PName origTenantId, String schemaName, String tableName,\n boolean alwaysHitServer, Long resolvedTimestamp)",
"constructor": false,
"full_signature": "public MetaDataMutationResult updateCache(PName origTenantId, String schemaName, String tableName,\n boolean alwaysHitServer, Long resolvedTimestamp)",
"identifier": "updateCache",
"modifiers": "public",
"parameters": "(PName origTenantId, String schemaName, String tableName,\n boolean alwaysHitServer, Long resolvedTimestamp)",
"return": "MetaDataMutationResult",
"signature": "MetaDataMutationResult updateCache(PName origTenantId, String schemaName, String tableName,\n boolean alwaysHitServer, Long resolvedTimestamp)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.avoidRpcToGetTable(boolean alwaysHitServer, Long resolvedTimestamp,\n boolean systemTable, PTable table, PTableRef tableRef, long tableResolvedTimestamp)",
"constructor": false,
"full_signature": "private boolean avoidRpcToGetTable(boolean alwaysHitServer, Long resolvedTimestamp,\n boolean systemTable, PTable table, PTableRef tableRef, long tableResolvedTimestamp)",
"identifier": "avoidRpcToGetTable",
"modifiers": "private",
"parameters": "(boolean alwaysHitServer, Long resolvedTimestamp,\n boolean systemTable, PTable table, PTableRef tableRef, long tableResolvedTimestamp)",
"return": "boolean",
"signature": "boolean avoidRpcToGetTable(boolean alwaysHitServer, Long resolvedTimestamp,\n boolean systemTable, PTable table, PTableRef tableRef, long tableResolvedTimestamp)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateCache(String schemaName)",
"constructor": false,
"full_signature": "public MetaDataMutationResult updateCache(String schemaName)",
"identifier": "updateCache",
"modifiers": "public",
"parameters": "(String schemaName)",
"return": "MetaDataMutationResult",
"signature": "MetaDataMutationResult updateCache(String schemaName)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateCache(String schemaName, boolean alwaysHitServer)",
"constructor": false,
"full_signature": "public MetaDataMutationResult updateCache(String schemaName, boolean alwaysHitServer)",
"identifier": "updateCache",
"modifiers": "public",
"parameters": "(String schemaName, boolean alwaysHitServer)",
"return": "MetaDataMutationResult",
"signature": "MetaDataMutationResult updateCache(String schemaName, boolean alwaysHitServer)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateCache(PName tenantId, List<String> functionNames,\n boolean alwaysHitServer)",
"constructor": false,
"full_signature": "public MetaDataMutationResult updateCache(PName tenantId, List<String> functionNames,\n boolean alwaysHitServer)",
"identifier": "updateCache",
"modifiers": "public",
"parameters": "(PName tenantId, List<String> functionNames,\n boolean alwaysHitServer)",
"return": "MetaDataMutationResult",
"signature": "MetaDataMutationResult updateCache(PName tenantId, List<String> functionNames,\n boolean alwaysHitServer)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.addColumnsAndIndexesFromAncestors(MetaDataMutationResult result, Long resolvedTimestamp,\n boolean alwaysAddAncestorColumnsAndIndexes)",
"constructor": false,
"full_signature": "private boolean addColumnsAndIndexesFromAncestors(MetaDataMutationResult result, Long resolvedTimestamp,\n boolean alwaysAddAncestorColumnsAndIndexes)",
"identifier": "addColumnsAndIndexesFromAncestors",
"modifiers": "private",
"parameters": "(MetaDataMutationResult result, Long resolvedTimestamp,\n boolean alwaysAddAncestorColumnsAndIndexes)",
"return": "boolean",
"signature": "boolean addColumnsAndIndexesFromAncestors(MetaDataMutationResult result, Long resolvedTimestamp,\n boolean alwaysAddAncestorColumnsAndIndexes)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.addColumnMutation(String schemaName, String tableName, PColumn column, PreparedStatement colUpsert, String parentTableName, String pkName, Short keySeq, boolean isSalted)",
"constructor": false,
"full_signature": "private void addColumnMutation(String schemaName, String tableName, PColumn column, PreparedStatement colUpsert, String parentTableName, String pkName, Short keySeq, boolean isSalted)",
"identifier": "addColumnMutation",
"modifiers": "private",
"parameters": "(String schemaName, String tableName, PColumn column, PreparedStatement colUpsert, String parentTableName, String pkName, Short keySeq, boolean isSalted)",
"return": "void",
"signature": "void addColumnMutation(String schemaName, String tableName, PColumn column, PreparedStatement colUpsert, String parentTableName, String pkName, Short keySeq, boolean isSalted)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.addFunctionArgMutation(String functionName, FunctionArgument arg, PreparedStatement argUpsert, int position)",
"constructor": false,
"full_signature": "private void addFunctionArgMutation(String functionName, FunctionArgument arg, PreparedStatement argUpsert, int position)",
"identifier": "addFunctionArgMutation",
"modifiers": "private",
"parameters": "(String functionName, FunctionArgument arg, PreparedStatement argUpsert, int position)",
"return": "void",
"signature": "void addFunctionArgMutation(String functionName, FunctionArgument arg, PreparedStatement argUpsert, int position)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.newColumn(int position, ColumnDef def, PrimaryKeyConstraint pkConstraint, String defaultColumnFamily,\n boolean addingToPK, byte[] columnQualifierBytes, boolean isImmutableRows)",
"constructor": false,
"full_signature": "private PColumn newColumn(int position, ColumnDef def, PrimaryKeyConstraint pkConstraint, String defaultColumnFamily,\n boolean addingToPK, byte[] columnQualifierBytes, boolean isImmutableRows)",
"identifier": "newColumn",
"modifiers": "private",
"parameters": "(int position, ColumnDef def, PrimaryKeyConstraint pkConstraint, String defaultColumnFamily,\n boolean addingToPK, byte[] columnQualifierBytes, boolean isImmutableRows)",
"return": "PColumn",
"signature": "PColumn newColumn(int position, ColumnDef def, PrimaryKeyConstraint pkConstraint, String defaultColumnFamily,\n boolean addingToPK, byte[] columnQualifierBytes, boolean isImmutableRows)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.createTable(CreateTableStatement statement, byte[][] splits, PTable parent, String viewStatement, ViewType viewType, PDataType viewIndexIdType, byte[][] viewColumnConstants, BitSet isViewColumnReferenced)",
"constructor": false,
"full_signature": "public MutationState createTable(CreateTableStatement statement, byte[][] splits, PTable parent, String viewStatement, ViewType viewType, PDataType viewIndexIdType, byte[][] viewColumnConstants, BitSet isViewColumnReferenced)",
"identifier": "createTable",
"modifiers": "public",
"parameters": "(CreateTableStatement statement, byte[][] splits, PTable parent, String viewStatement, ViewType viewType, PDataType viewIndexIdType, byte[][] viewColumnConstants, BitSet isViewColumnReferenced)",
"return": "MutationState",
"signature": "MutationState createTable(CreateTableStatement statement, byte[][] splits, PTable parent, String viewStatement, ViewType viewType, PDataType viewIndexIdType, byte[][] viewColumnConstants, BitSet isViewColumnReferenced)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.populatePropertyMaps(ListMultimap<String,Pair<String,Object>> statementProps, Map<String, Object> tableProps,\n Map<String, Object> commonFamilyProps, PTableType tableType)",
"constructor": false,
"full_signature": "private void populatePropertyMaps(ListMultimap<String,Pair<String,Object>> statementProps, Map<String, Object> tableProps,\n Map<String, Object> commonFamilyProps, PTableType tableType)",
"identifier": "populatePropertyMaps",
"modifiers": "private",
"parameters": "(ListMultimap<String,Pair<String,Object>> statementProps, Map<String, Object> tableProps,\n Map<String, Object> commonFamilyProps, PTableType tableType)",
"return": "void",
"signature": "void populatePropertyMaps(ListMultimap<String,Pair<String,Object>> statementProps, Map<String, Object> tableProps,\n Map<String, Object> commonFamilyProps, PTableType tableType)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateStatistics(UpdateStatisticsStatement updateStatisticsStmt)",
"constructor": false,
"full_signature": "public MutationState updateStatistics(UpdateStatisticsStatement updateStatisticsStmt)",
"identifier": "updateStatistics",
"modifiers": "public",
"parameters": "(UpdateStatisticsStatement updateStatisticsStmt)",
"return": "MutationState",
"signature": "MutationState updateStatistics(UpdateStatisticsStatement updateStatisticsStmt)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateStatisticsInternal(PName physicalName, PTable logicalTable, Map<String, Object> statsProps, boolean checkLastStatsUpdateTime)",
"constructor": false,
"full_signature": "private long updateStatisticsInternal(PName physicalName, PTable logicalTable, Map<String, Object> statsProps, boolean checkLastStatsUpdateTime)",
"identifier": "updateStatisticsInternal",
"modifiers": "private",
"parameters": "(PName physicalName, PTable logicalTable, Map<String, Object> statsProps, boolean checkLastStatsUpdateTime)",
"return": "long",
"signature": "long updateStatisticsInternal(PName physicalName, PTable logicalTable, Map<String, Object> statsProps, boolean checkLastStatsUpdateTime)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.updateStatisticsInternal(PName physicalName, PTable logicalTable, Map<String, Object> statsProps, List<byte[]> cfs, boolean checkLastStatsUpdateTime)",
"constructor": false,
"full_signature": "private long updateStatisticsInternal(PName physicalName, PTable logicalTable, Map<String, Object> statsProps, List<byte[]> cfs, boolean checkLastStatsUpdateTime)",
"identifier": "updateStatisticsInternal",
"modifiers": "private",
"parameters": "(PName physicalName, PTable logicalTable, Map<String, Object> statsProps, List<byte[]> cfs, boolean checkLastStatsUpdateTime)",
"return": "long",
"signature": "long updateStatisticsInternal(PName physicalName, PTable logicalTable, Map<String, Object> statsProps, List<byte[]> cfs, boolean checkLastStatsUpdateTime)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.buildIndexAtTimeStamp(PTable index, NamedTableNode dataTableNode)",
"constructor": false,
"full_signature": "private MutationState buildIndexAtTimeStamp(PTable index, NamedTableNode dataTableNode)",
"identifier": "buildIndexAtTimeStamp",
"modifiers": "private",
"parameters": "(PTable index, NamedTableNode dataTableNode)",
"return": "MutationState",
"signature": "MutationState buildIndexAtTimeStamp(PTable index, NamedTableNode dataTableNode)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getMutationPlanForBuildingIndex(PTable index, TableRef dataTableRef)",
"constructor": false,
"full_signature": "private MutationPlan getMutationPlanForBuildingIndex(PTable index, TableRef dataTableRef)",
"identifier": "getMutationPlanForBuildingIndex",
"modifiers": "private",
"parameters": "(PTable index, TableRef dataTableRef)",
"return": "MutationPlan",
"signature": "MutationPlan getMutationPlanForBuildingIndex(PTable index, TableRef dataTableRef)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.buildIndex(PTable index, TableRef dataTableRef)",
"constructor": false,
"full_signature": "private MutationState buildIndex(PTable index, TableRef dataTableRef)",
"identifier": "buildIndex",
"modifiers": "private",
"parameters": "(PTable index, TableRef dataTableRef)",
"return": "MutationState",
"signature": "MutationState buildIndex(PTable index, TableRef dataTableRef)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getFullTableName(TableRef dataTableRef)",
"constructor": false,
"full_signature": "private String getFullTableName(TableRef dataTableRef)",
"identifier": "getFullTableName",
"modifiers": "private",
"parameters": "(TableRef dataTableRef)",
"return": "String",
"signature": "String getFullTableName(TableRef dataTableRef)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.declareCursor(DeclareCursorStatement statement, QueryPlan queryPlan)",
"constructor": false,
"full_signature": "public MutationState declareCursor(DeclareCursorStatement statement, QueryPlan queryPlan)",
"identifier": "declareCursor",
"modifiers": "public",
"parameters": "(DeclareCursorStatement statement, QueryPlan queryPlan)",
"return": "MutationState",
"signature": "MutationState declareCursor(DeclareCursorStatement statement, QueryPlan queryPlan)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.open(OpenStatement statement)",
"constructor": false,
"full_signature": "public MutationState open(OpenStatement statement)",
"identifier": "open",
"modifiers": "public",
"parameters": "(OpenStatement statement)",
"return": "MutationState",
"signature": "MutationState open(OpenStatement statement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.close(CloseStatement statement)",
"constructor": false,
"full_signature": "public MutationState close(CloseStatement statement)",
"identifier": "close",
"modifiers": "public",
"parameters": "(CloseStatement statement)",
"return": "MutationState",
"signature": "MutationState close(CloseStatement statement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getViewIndexDataType()",
"constructor": false,
"full_signature": "private PDataType getViewIndexDataType()",
"identifier": "getViewIndexDataType",
"modifiers": "private",
"parameters": "()",
"return": "PDataType",
"signature": "PDataType getViewIndexDataType()",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.createIndex(CreateIndexStatement statement, byte[][] splits)",
"constructor": false,
"full_signature": "public MutationState createIndex(CreateIndexStatement statement, byte[][] splits)",
"identifier": "createIndex",
"modifiers": "public",
"parameters": "(CreateIndexStatement statement, byte[][] splits)",
"return": "MutationState",
"signature": "MutationState createIndex(CreateIndexStatement statement, byte[][] splits)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.dropSequence(DropSequenceStatement statement)",
"constructor": false,
"full_signature": "public MutationState dropSequence(DropSequenceStatement statement)",
"identifier": "dropSequence",
"modifiers": "public",
"parameters": "(DropSequenceStatement statement)",
"return": "MutationState",
"signature": "MutationState dropSequence(DropSequenceStatement statement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.createSequence(CreateSequenceStatement statement, long startWith,\n long incrementBy, long cacheSize, long minValue, long maxValue)",
"constructor": false,
"full_signature": "public MutationState createSequence(CreateSequenceStatement statement, long startWith,\n long incrementBy, long cacheSize, long minValue, long maxValue)",
"identifier": "createSequence",
"modifiers": "public",
"parameters": "(CreateSequenceStatement statement, long startWith,\n long incrementBy, long cacheSize, long minValue, long maxValue)",
"return": "MutationState",
"signature": "MutationState createSequence(CreateSequenceStatement statement, long startWith,\n long incrementBy, long cacheSize, long minValue, long maxValue)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.createSequence(String tenantId, String schemaName, String sequenceName,\n boolean ifNotExists, long startWith, long incrementBy, long cacheSize, boolean cycle,\n long minValue, long maxValue, long timestamp)",
"constructor": false,
"full_signature": "private MutationState createSequence(String tenantId, String schemaName, String sequenceName,\n boolean ifNotExists, long startWith, long incrementBy, long cacheSize, boolean cycle,\n long minValue, long maxValue, long timestamp)",
"identifier": "createSequence",
"modifiers": "private",
"parameters": "(String tenantId, String schemaName, String sequenceName,\n boolean ifNotExists, long startWith, long incrementBy, long cacheSize, boolean cycle,\n long minValue, long maxValue, long timestamp)",
"return": "MutationState",
"signature": "MutationState createSequence(String tenantId, String schemaName, String sequenceName,\n boolean ifNotExists, long startWith, long incrementBy, long cacheSize, boolean cycle,\n long minValue, long maxValue, long timestamp)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.createFunction(CreateFunctionStatement stmt)",
"constructor": false,
"full_signature": "public MutationState createFunction(CreateFunctionStatement stmt)",
"identifier": "createFunction",
"modifiers": "public",
"parameters": "(CreateFunctionStatement stmt)",
"return": "MutationState",
"signature": "MutationState createFunction(CreateFunctionStatement stmt)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.findColumnDefOrNull(List<ColumnDef> colDefs, ColumnName colName)",
"constructor": false,
"full_signature": "private static ColumnDef findColumnDefOrNull(List<ColumnDef> colDefs, ColumnName colName)",
"identifier": "findColumnDefOrNull",
"modifiers": "private static",
"parameters": "(List<ColumnDef> colDefs, ColumnName colName)",
"return": "ColumnDef",
"signature": "ColumnDef findColumnDefOrNull(List<ColumnDef> colDefs, ColumnName colName)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.checkAndValidateRowTimestampCol(ColumnDef colDef, PrimaryKeyConstraint pkConstraint,\n boolean rowTimeStampColAlreadyFound, PTableType tableType)",
"constructor": false,
"full_signature": "private static boolean checkAndValidateRowTimestampCol(ColumnDef colDef, PrimaryKeyConstraint pkConstraint,\n boolean rowTimeStampColAlreadyFound, PTableType tableType)",
"identifier": "checkAndValidateRowTimestampCol",
"modifiers": "private static",
"parameters": "(ColumnDef colDef, PrimaryKeyConstraint pkConstraint,\n boolean rowTimeStampColAlreadyFound, PTableType tableType)",
"return": "boolean",
"signature": "boolean checkAndValidateRowTimestampCol(ColumnDef colDef, PrimaryKeyConstraint pkConstraint,\n boolean rowTimeStampColAlreadyFound, PTableType tableType)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.writeCell(String tenantId, String schemaName, String tableName, String columnName)",
"constructor": false,
"full_signature": "private boolean writeCell(String tenantId, String schemaName, String tableName, String columnName)",
"identifier": "writeCell",
"modifiers": "private",
"parameters": "(String tenantId, String schemaName, String tableName, String columnName)",
"return": "boolean",
"signature": "boolean writeCell(String tenantId, String schemaName, String tableName, String columnName)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.deleteCell(String tenantId, String schemaName, String tableName, String columnName)",
"constructor": false,
"full_signature": "private void deleteCell(String tenantId, String schemaName, String tableName, String columnName)",
"identifier": "deleteCell",
"modifiers": "private",
"parameters": "(String tenantId, String schemaName, String tableName, String columnName)",
"return": "void",
"signature": "void deleteCell(String tenantId, String schemaName, String tableName, String columnName)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.populateFamilyPropsList(Map<String, PName> familyNames, Map<String,Object> commonFamilyProps,\n CreateTableStatement statement, String defaultFamilyName, boolean isLocalIndex,\n final List<Pair<byte[],Map<String,Object>>> familyPropList)",
"constructor": false,
"full_signature": "private void populateFamilyPropsList(Map<String, PName> familyNames, Map<String,Object> commonFamilyProps,\n CreateTableStatement statement, String defaultFamilyName, boolean isLocalIndex,\n final List<Pair<byte[],Map<String,Object>>> familyPropList)",
"identifier": "populateFamilyPropsList",
"modifiers": "private",
"parameters": "(Map<String, PName> familyNames, Map<String,Object> commonFamilyProps,\n CreateTableStatement statement, String defaultFamilyName, boolean isLocalIndex,\n final List<Pair<byte[],Map<String,Object>>> familyPropList)",
"return": "void",
"signature": "void populateFamilyPropsList(Map<String, PName> familyNames, Map<String,Object> commonFamilyProps,\n CreateTableStatement statement, String defaultFamilyName, boolean isLocalIndex,\n final List<Pair<byte[],Map<String,Object>>> familyPropList)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.createTableInternal(CreateTableStatement statement, byte[][] splits,\n final PTable parent, String viewStatement, ViewType viewType, PDataType viewIndexIdType,\n final byte[][] viewColumnConstants, final BitSet isViewColumnReferenced, boolean allocateIndexId,\n IndexType indexType, Date asyncCreatedDate,\n Map<String,Object> tableProps,\n Map<String,Object> commonFamilyProps)",
"constructor": false,
"full_signature": "private PTable createTableInternal(CreateTableStatement statement, byte[][] splits,\n final PTable parent, String viewStatement, ViewType viewType, PDataType viewIndexIdType,\n final byte[][] viewColumnConstants, final BitSet isViewColumnReferenced, boolean allocateIndexId,\n IndexType indexType, Date asyncCreatedDate,\n Map<String,Object> tableProps,\n Map<String,Object> commonFamilyProps)",
"identifier": "createTableInternal",
"modifiers": "private",
"parameters": "(CreateTableStatement statement, byte[][] splits,\n final PTable parent, String viewStatement, ViewType viewType, PDataType viewIndexIdType,\n final byte[][] viewColumnConstants, final BitSet isViewColumnReferenced, boolean allocateIndexId,\n IndexType indexType, Date asyncCreatedDate,\n Map<String,Object> tableProps,\n Map<String,Object> commonFamilyProps)",
"return": "PTable",
"signature": "PTable createTableInternal(CreateTableStatement statement, byte[][] splits,\n final PTable parent, String viewStatement, ViewType viewType, PDataType viewIndexIdType,\n final byte[][] viewColumnConstants, final BitSet isViewColumnReferenced, boolean allocateIndexId,\n IndexType indexType, Date asyncCreatedDate,\n Map<String,Object> tableProps,\n Map<String,Object> commonFamilyProps)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.handleCreateTableMutationCode(MetaDataMutationResult result, MutationCode code,\n CreateTableStatement statement, String schemaName, String tableName,\n PTable parent)",
"constructor": false,
"full_signature": "@VisibleForTesting public boolean handleCreateTableMutationCode(MetaDataMutationResult result, MutationCode code,\n CreateTableStatement statement, String schemaName, String tableName,\n PTable parent)",
"identifier": "handleCreateTableMutationCode",
"modifiers": "@VisibleForTesting public",
"parameters": "(MetaDataMutationResult result, MutationCode code,\n CreateTableStatement statement, String schemaName, String tableName,\n PTable parent)",
"return": "boolean",
"signature": "boolean handleCreateTableMutationCode(MetaDataMutationResult result, MutationCode code,\n CreateTableStatement statement, String schemaName, String tableName,\n PTable parent)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.throwsSQLExceptionUtil(String code,String schemaName, String tableName)",
"constructor": false,
"full_signature": "private void throwsSQLExceptionUtil(String code,String schemaName, String tableName)",
"identifier": "throwsSQLExceptionUtil",
"modifiers": "private",
"parameters": "(String code,String schemaName, String tableName)",
"return": "void",
"signature": "void throwsSQLExceptionUtil(String code,String schemaName, String tableName)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.isPkColumn(PrimaryKeyConstraint pkConstraint, ColumnDef colDef)",
"constructor": false,
"full_signature": "private static boolean isPkColumn(PrimaryKeyConstraint pkConstraint, ColumnDef colDef)",
"identifier": "isPkColumn",
"modifiers": "private static",
"parameters": "(PrimaryKeyConstraint pkConstraint, ColumnDef colDef)",
"return": "boolean",
"signature": "boolean isPkColumn(PrimaryKeyConstraint pkConstraint, ColumnDef colDef)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.throwIfInsufficientColumns(String schemaName, String tableName, Collection<PColumn> columns, boolean isSalted, boolean isMultiTenant)",
"constructor": false,
"full_signature": "private static void throwIfInsufficientColumns(String schemaName, String tableName, Collection<PColumn> columns, boolean isSalted, boolean isMultiTenant)",
"identifier": "throwIfInsufficientColumns",
"modifiers": "private static",
"parameters": "(String schemaName, String tableName, Collection<PColumn> columns, boolean isSalted, boolean isMultiTenant)",
"return": "void",
"signature": "void throwIfInsufficientColumns(String schemaName, String tableName, Collection<PColumn> columns, boolean isSalted, boolean isMultiTenant)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.dropTable(DropTableStatement statement)",
"constructor": false,
"full_signature": "public MutationState dropTable(DropTableStatement statement)",
"identifier": "dropTable",
"modifiers": "public",
"parameters": "(DropTableStatement statement)",
"return": "MutationState",
"signature": "MutationState dropTable(DropTableStatement statement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.dropFunction(DropFunctionStatement statement)",
"constructor": false,
"full_signature": "public MutationState dropFunction(DropFunctionStatement statement)",
"identifier": "dropFunction",
"modifiers": "public",
"parameters": "(DropFunctionStatement statement)",
"return": "MutationState",
"signature": "MutationState dropFunction(DropFunctionStatement statement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.dropIndex(DropIndexStatement statement)",
"constructor": false,
"full_signature": "public MutationState dropIndex(DropIndexStatement statement)",
"identifier": "dropIndex",
"modifiers": "public",
"parameters": "(DropIndexStatement statement)",
"return": "MutationState",
"signature": "MutationState dropIndex(DropIndexStatement statement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.dropFunction(String functionName,\n boolean ifExists)",
"constructor": false,
"full_signature": "private MutationState dropFunction(String functionName,\n boolean ifExists)",
"identifier": "dropFunction",
"modifiers": "private",
"parameters": "(String functionName,\n boolean ifExists)",
"return": "MutationState",
"signature": "MutationState dropFunction(String functionName,\n boolean ifExists)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.dropTable(String schemaName, String tableName, String parentTableName, PTableType tableType,\n boolean ifExists, boolean cascade, boolean skipAddingParentColumns)",
"constructor": false,
"full_signature": " MutationState dropTable(String schemaName, String tableName, String parentTableName, PTableType tableType,\n boolean ifExists, boolean cascade, boolean skipAddingParentColumns)",
"identifier": "dropTable",
"modifiers": "",
"parameters": "(String schemaName, String tableName, String parentTableName, PTableType tableType,\n boolean ifExists, boolean cascade, boolean skipAddingParentColumns)",
"return": "MutationState",
"signature": "MutationState dropTable(String schemaName, String tableName, String parentTableName, PTableType tableType,\n boolean ifExists, boolean cascade, boolean skipAddingParentColumns)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.processMutationResult(String schemaName, String tableName, MetaDataMutationResult result)",
"constructor": false,
"full_signature": "private MutationCode processMutationResult(String schemaName, String tableName, MetaDataMutationResult result)",
"identifier": "processMutationResult",
"modifiers": "private",
"parameters": "(String schemaName, String tableName, MetaDataMutationResult result)",
"return": "MutationCode",
"signature": "MutationCode processMutationResult(String schemaName, String tableName, MetaDataMutationResult result)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.incrementTableSeqNum(PTable table, PTableType expectedType, int columnCountDelta, MetaPropertiesEvaluated metaPropertiesEvaluated)",
"constructor": false,
"full_signature": "private long incrementTableSeqNum(PTable table, PTableType expectedType, int columnCountDelta, MetaPropertiesEvaluated metaPropertiesEvaluated)",
"identifier": "incrementTableSeqNum",
"modifiers": "private",
"parameters": "(PTable table, PTableType expectedType, int columnCountDelta, MetaPropertiesEvaluated metaPropertiesEvaluated)",
"return": "long",
"signature": "long incrementTableSeqNum(PTable table, PTableType expectedType, int columnCountDelta, MetaPropertiesEvaluated metaPropertiesEvaluated)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.incrementTableSeqNum(PTable table, PTableType expectedType, int columnCountDelta, Boolean isTransactional, Long updateCacheFrequency, Long phoenixTTL)",
"constructor": false,
"full_signature": "private long incrementTableSeqNum(PTable table, PTableType expectedType, int columnCountDelta, Boolean isTransactional, Long updateCacheFrequency, Long phoenixTTL)",
"identifier": "incrementTableSeqNum",
"modifiers": "private",
"parameters": "(PTable table, PTableType expectedType, int columnCountDelta, Boolean isTransactional, Long updateCacheFrequency, Long phoenixTTL)",
"return": "long",
"signature": "long incrementTableSeqNum(PTable table, PTableType expectedType, int columnCountDelta, Boolean isTransactional, Long updateCacheFrequency, Long phoenixTTL)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.incrementTableSeqNum(PTable table, PTableType expectedType, int columnCountDelta,\n Boolean isTransactional, TransactionFactory.Provider transactionProvider,\n Long updateCacheFrequency, Boolean isImmutableRows, Boolean disableWAL,\n Boolean isMultiTenant, Boolean storeNulls, Long guidePostWidth, Boolean appendOnlySchema,\n ImmutableStorageScheme immutableStorageScheme, Boolean useStatsForParallelization, Long phoenixTTL)",
"constructor": false,
"full_signature": "private long incrementTableSeqNum(PTable table, PTableType expectedType, int columnCountDelta,\n Boolean isTransactional, TransactionFactory.Provider transactionProvider,\n Long updateCacheFrequency, Boolean isImmutableRows, Boolean disableWAL,\n Boolean isMultiTenant, Boolean storeNulls, Long guidePostWidth, Boolean appendOnlySchema,\n ImmutableStorageScheme immutableStorageScheme, Boolean useStatsForParallelization, Long phoenixTTL)",
"identifier": "incrementTableSeqNum",
"modifiers": "private",
"parameters": "(PTable table, PTableType expectedType, int columnCountDelta,\n Boolean isTransactional, TransactionFactory.Provider transactionProvider,\n Long updateCacheFrequency, Boolean isImmutableRows, Boolean disableWAL,\n Boolean isMultiTenant, Boolean storeNulls, Long guidePostWidth, Boolean appendOnlySchema,\n ImmutableStorageScheme immutableStorageScheme, Boolean useStatsForParallelization, Long phoenixTTL)",
"return": "long",
"signature": "long incrementTableSeqNum(PTable table, PTableType expectedType, int columnCountDelta,\n Boolean isTransactional, TransactionFactory.Provider transactionProvider,\n Long updateCacheFrequency, Boolean isImmutableRows, Boolean disableWAL,\n Boolean isMultiTenant, Boolean storeNulls, Long guidePostWidth, Boolean appendOnlySchema,\n ImmutableStorageScheme immutableStorageScheme, Boolean useStatsForParallelization, Long phoenixTTL)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.mutateBooleanProperty(String tenantId, String schemaName, String tableName,\n String propertyName, boolean propertyValue)",
"constructor": false,
"full_signature": "private void mutateBooleanProperty(String tenantId, String schemaName, String tableName,\n String propertyName, boolean propertyValue)",
"identifier": "mutateBooleanProperty",
"modifiers": "private",
"parameters": "(String tenantId, String schemaName, String tableName,\n String propertyName, boolean propertyValue)",
"return": "void",
"signature": "void mutateBooleanProperty(String tenantId, String schemaName, String tableName,\n String propertyName, boolean propertyValue)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.mutateLongProperty(String tenantId, String schemaName, String tableName,\n String propertyName, Long propertyValue)",
"constructor": false,
"full_signature": "private void mutateLongProperty(String tenantId, String schemaName, String tableName,\n String propertyName, Long propertyValue)",
"identifier": "mutateLongProperty",
"modifiers": "private",
"parameters": "(String tenantId, String schemaName, String tableName,\n String propertyName, Long propertyValue)",
"return": "void",
"signature": "void mutateLongProperty(String tenantId, String schemaName, String tableName,\n String propertyName, Long propertyValue)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.mutateByteProperty(String tenantId, String schemaName, String tableName,\n String propertyName, Byte propertyValue)",
"constructor": false,
"full_signature": "private void mutateByteProperty(String tenantId, String schemaName, String tableName,\n String propertyName, Byte propertyValue)",
"identifier": "mutateByteProperty",
"modifiers": "private",
"parameters": "(String tenantId, String schemaName, String tableName,\n String propertyName, Byte propertyValue)",
"return": "void",
"signature": "void mutateByteProperty(String tenantId, String schemaName, String tableName,\n String propertyName, Byte propertyValue)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.mutateStringProperty(String tenantId, String schemaName, String tableName,\n String propertyName, String propertyValue)",
"constructor": false,
"full_signature": "private void mutateStringProperty(String tenantId, String schemaName, String tableName,\n String propertyName, String propertyValue)",
"identifier": "mutateStringProperty",
"modifiers": "private",
"parameters": "(String tenantId, String schemaName, String tableName,\n String propertyName, String propertyValue)",
"return": "void",
"signature": "void mutateStringProperty(String tenantId, String schemaName, String tableName,\n String propertyName, String propertyValue)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.addColumn(AddColumnStatement statement)",
"constructor": false,
"full_signature": "public MutationState addColumn(AddColumnStatement statement)",
"identifier": "addColumn",
"modifiers": "public",
"parameters": "(AddColumnStatement statement)",
"return": "MutationState",
"signature": "MutationState addColumn(AddColumnStatement statement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.addColumn(PTable table, List<ColumnDef> origColumnDefs,\n ListMultimap<String, Pair<String, Object>> stmtProperties, boolean ifNotExists,\n boolean removeTableProps, NamedTableNode namedTableNode, PTableType tableType, boolean cascade, List<NamedNode> indexes)",
"constructor": false,
"full_signature": "public MutationState addColumn(PTable table, List<ColumnDef> origColumnDefs,\n ListMultimap<String, Pair<String, Object>> stmtProperties, boolean ifNotExists,\n boolean removeTableProps, NamedTableNode namedTableNode, PTableType tableType, boolean cascade, List<NamedNode> indexes)",
"identifier": "addColumn",
"modifiers": "public",
"parameters": "(PTable table, List<ColumnDef> origColumnDefs,\n ListMultimap<String, Pair<String, Object>> stmtProperties, boolean ifNotExists,\n boolean removeTableProps, NamedTableNode namedTableNode, PTableType tableType, boolean cascade, List<NamedNode> indexes)",
"return": "MutationState",
"signature": "MutationState addColumn(PTable table, List<ColumnDef> origColumnDefs,\n ListMultimap<String, Pair<String, Object>> stmtProperties, boolean ifNotExists,\n boolean removeTableProps, NamedTableNode namedTableNode, PTableType tableType, boolean cascade, List<NamedNode> indexes)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getIndexesPTableForCascade(List<NamedNode> indexes, PTable table)",
"constructor": false,
"full_signature": "private List<PTable> getIndexesPTableForCascade(List<NamedNode> indexes, PTable table)",
"identifier": "getIndexesPTableForCascade",
"modifiers": "private",
"parameters": "(List<NamedNode> indexes, PTable table)",
"return": "List<PTable>",
"signature": "List<PTable> getIndexesPTableForCascade(List<NamedNode> indexes, PTable table)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getPTablePColumnHashMapForCascade(List<PTable> indexesPTable,\n boolean willBeImmutableRows, ColumnDef colDef, String familyName, Map<PTable, Integer> indexToColumnSizeMap)",
"constructor": false,
"full_signature": "private HashMap<PTable, PColumn> getPTablePColumnHashMapForCascade(List<PTable> indexesPTable,\n boolean willBeImmutableRows, ColumnDef colDef, String familyName, Map<PTable, Integer> indexToColumnSizeMap)",
"identifier": "getPTablePColumnHashMapForCascade",
"modifiers": "private",
"parameters": "(List<PTable> indexesPTable,\n boolean willBeImmutableRows, ColumnDef colDef, String familyName, Map<PTable, Integer> indexToColumnSizeMap)",
"return": "HashMap<PTable, PColumn>",
"signature": "HashMap<PTable, PColumn> getPTablePColumnHashMapForCascade(List<PTable> indexesPTable,\n boolean willBeImmutableRows, ColumnDef colDef, String familyName, Map<PTable, Integer> indexToColumnSizeMap)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.deleteMutexCells(String physicalSchemaName, String physicalTableName, Set<String> acquiredColumnMutexSet)",
"constructor": false,
"full_signature": "private void deleteMutexCells(String physicalSchemaName, String physicalTableName, Set<String> acquiredColumnMutexSet)",
"identifier": "deleteMutexCells",
"modifiers": "private",
"parameters": "(String physicalSchemaName, String physicalTableName, Set<String> acquiredColumnMutexSet)",
"return": "void",
"signature": "void deleteMutexCells(String physicalSchemaName, String physicalTableName, Set<String> acquiredColumnMutexSet)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.dropColumnMutations(PTable table, List<PColumn> columnsToDrop)",
"constructor": false,
"full_signature": "private String dropColumnMutations(PTable table, List<PColumn> columnsToDrop)",
"identifier": "dropColumnMutations",
"modifiers": "private",
"parameters": "(PTable table, List<PColumn> columnsToDrop)",
"return": "String",
"signature": "String dropColumnMutations(PTable table, List<PColumn> columnsToDrop)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getNewEmptyColumnFamilyOrNull(PTable table, PColumn columnToDrop)",
"constructor": false,
"full_signature": "private static byte[] getNewEmptyColumnFamilyOrNull(PTable table, PColumn columnToDrop)",
"identifier": "getNewEmptyColumnFamilyOrNull",
"modifiers": "private static",
"parameters": "(PTable table, PColumn columnToDrop)",
"return": "byte[]",
"signature": "byte[] getNewEmptyColumnFamilyOrNull(PTable table, PColumn columnToDrop)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getParentTable(PTable table)",
"constructor": false,
"full_signature": "private PTable getParentTable(PTable table)",
"identifier": "getParentTable",
"modifiers": "private",
"parameters": "(PTable table)",
"return": "PTable",
"signature": "PTable getParentTable(PTable table)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.dropColumn(DropColumnStatement statement)",
"constructor": false,
"full_signature": "public MutationState dropColumn(DropColumnStatement statement)",
"identifier": "dropColumn",
"modifiers": "public",
"parameters": "(DropColumnStatement statement)",
"return": "MutationState",
"signature": "MutationState dropColumn(DropColumnStatement statement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.alterIndex(AlterIndexStatement statement)",
"constructor": false,
"full_signature": "public MutationState alterIndex(AlterIndexStatement statement)",
"identifier": "alterIndex",
"modifiers": "public",
"parameters": "(AlterIndexStatement statement)",
"return": "MutationState",
"signature": "MutationState alterIndex(AlterIndexStatement statement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.addTableToCache(MetaDataMutationResult result)",
"constructor": false,
"full_signature": "private PTable addTableToCache(MetaDataMutationResult result)",
"identifier": "addTableToCache",
"modifiers": "private",
"parameters": "(MetaDataMutationResult result)",
"return": "PTable",
"signature": "PTable addTableToCache(MetaDataMutationResult result)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.addTableToCache(MetaDataMutationResult result, long timestamp)",
"constructor": false,
"full_signature": "private PTable addTableToCache(MetaDataMutationResult result, long timestamp)",
"identifier": "addTableToCache",
"modifiers": "private",
"parameters": "(MetaDataMutationResult result, long timestamp)",
"return": "PTable",
"signature": "PTable addTableToCache(MetaDataMutationResult result, long timestamp)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.addFunctionToCache(MetaDataMutationResult result)",
"constructor": false,
"full_signature": "private List<PFunction> addFunctionToCache(MetaDataMutationResult result)",
"identifier": "addFunctionToCache",
"modifiers": "private",
"parameters": "(MetaDataMutationResult result)",
"return": "List<PFunction>",
"signature": "List<PFunction> addFunctionToCache(MetaDataMutationResult result)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.addSchemaToCache(MetaDataMutationResult result)",
"constructor": false,
"full_signature": "private void addSchemaToCache(MetaDataMutationResult result)",
"identifier": "addSchemaToCache",
"modifiers": "private",
"parameters": "(MetaDataMutationResult result)",
"return": "void",
"signature": "void addSchemaToCache(MetaDataMutationResult result)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.throwIfLastPKOfParentIsVariableLength(PTable parent, String viewSchemaName, String viewName, ColumnDef col)",
"constructor": false,
"full_signature": "private void throwIfLastPKOfParentIsVariableLength(PTable parent, String viewSchemaName, String viewName, ColumnDef col)",
"identifier": "throwIfLastPKOfParentIsVariableLength",
"modifiers": "private",
"parameters": "(PTable parent, String viewSchemaName, String viewName, ColumnDef col)",
"return": "void",
"signature": "void throwIfLastPKOfParentIsVariableLength(PTable parent, String viewSchemaName, String viewName, ColumnDef col)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.isLastPKVariableLength(PTable table)",
"constructor": false,
"full_signature": "private boolean isLastPKVariableLength(PTable table)",
"identifier": "isLastPKVariableLength",
"modifiers": "private",
"parameters": "(PTable table)",
"return": "boolean",
"signature": "boolean isLastPKVariableLength(PTable table)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.getParentOfView(PTable view)",
"constructor": false,
"full_signature": "private PTable getParentOfView(PTable view)",
"identifier": "getParentOfView",
"modifiers": "private",
"parameters": "(PTable view)",
"return": "PTable",
"signature": "PTable getParentOfView(PTable view)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.createSchema(CreateSchemaStatement create)",
"constructor": false,
"full_signature": "public MutationState createSchema(CreateSchemaStatement create)",
"identifier": "createSchema",
"modifiers": "public",
"parameters": "(CreateSchemaStatement create)",
"return": "MutationState",
"signature": "MutationState createSchema(CreateSchemaStatement create)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.validateSchema(String schemaName)",
"constructor": false,
"full_signature": "private void validateSchema(String schemaName)",
"identifier": "validateSchema",
"modifiers": "private",
"parameters": "(String schemaName)",
"return": "void",
"signature": "void validateSchema(String schemaName)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.dropSchema(DropSchemaStatement executableDropSchemaStatement)",
"constructor": false,
"full_signature": "public MutationState dropSchema(DropSchemaStatement executableDropSchemaStatement)",
"identifier": "dropSchema",
"modifiers": "public",
"parameters": "(DropSchemaStatement executableDropSchemaStatement)",
"return": "MutationState",
"signature": "MutationState dropSchema(DropSchemaStatement executableDropSchemaStatement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.useSchema(UseSchemaStatement useSchemaStatement)",
"constructor": false,
"full_signature": "public MutationState useSchema(UseSchemaStatement useSchemaStatement)",
"identifier": "useSchema",
"modifiers": "public",
"parameters": "(UseSchemaStatement useSchemaStatement)",
"return": "MutationState",
"signature": "MutationState useSchema(UseSchemaStatement useSchemaStatement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.loadStmtProperties(ListMultimap<String, Pair<String, Object>> stmtProperties, Map<String, List<Pair<String, Object>>> properties, PTable table, boolean removeTableProps)",
"constructor": false,
"full_signature": "private MetaProperties loadStmtProperties(ListMultimap<String, Pair<String, Object>> stmtProperties, Map<String, List<Pair<String, Object>>> properties, PTable table, boolean removeTableProps)",
"identifier": "loadStmtProperties",
"modifiers": "private",
"parameters": "(ListMultimap<String, Pair<String, Object>> stmtProperties, Map<String, List<Pair<String, Object>>> properties, PTable table, boolean removeTableProps)",
"return": "MetaProperties",
"signature": "MetaProperties loadStmtProperties(ListMultimap<String, Pair<String, Object>> stmtProperties, Map<String, List<Pair<String, Object>>> properties, PTable table, boolean removeTableProps)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.evaluateStmtProperties(MetaProperties metaProperties, MetaPropertiesEvaluated metaPropertiesEvaluated, PTable table, String schemaName, String tableName)",
"constructor": false,
"full_signature": "private boolean evaluateStmtProperties(MetaProperties metaProperties, MetaPropertiesEvaluated metaPropertiesEvaluated, PTable table, String schemaName, String tableName)",
"identifier": "evaluateStmtProperties",
"modifiers": "private",
"parameters": "(MetaProperties metaProperties, MetaPropertiesEvaluated metaPropertiesEvaluated, PTable table, String schemaName, String tableName)",
"return": "boolean",
"signature": "boolean evaluateStmtProperties(MetaProperties metaProperties, MetaPropertiesEvaluated metaPropertiesEvaluated, PTable table, String schemaName, String tableName)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.changePermissions(ChangePermsStatement changePermsStatement)",
"constructor": false,
"full_signature": "public MutationState changePermissions(ChangePermsStatement changePermsStatement)",
"identifier": "changePermissions",
"modifiers": "public",
"parameters": "(ChangePermsStatement changePermsStatement)",
"return": "MutationState",
"signature": "MutationState changePermissions(ChangePermsStatement changePermsStatement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.changePermsOnSchema(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement)",
"constructor": false,
"full_signature": "private void changePermsOnSchema(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement)",
"identifier": "changePermsOnSchema",
"modifiers": "private",
"parameters": "(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement)",
"return": "void",
"signature": "void changePermsOnSchema(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.changePermsOnTables(ClusterConnection clusterConnection, Admin admin, ChangePermsStatement changePermsStatement, PTable inputTable)",
"constructor": false,
"full_signature": "private void changePermsOnTables(ClusterConnection clusterConnection, Admin admin, ChangePermsStatement changePermsStatement, PTable inputTable)",
"identifier": "changePermsOnTables",
"modifiers": "private",
"parameters": "(ClusterConnection clusterConnection, Admin admin, ChangePermsStatement changePermsStatement, PTable inputTable)",
"return": "void",
"signature": "void changePermsOnTables(ClusterConnection clusterConnection, Admin admin, ChangePermsStatement changePermsStatement, PTable inputTable)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.changePermsOnTable(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement, org.apache.hadoop.hbase.TableName tableName)",
"constructor": false,
"full_signature": "private void changePermsOnTable(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement, org.apache.hadoop.hbase.TableName tableName)",
"identifier": "changePermsOnTable",
"modifiers": "private",
"parameters": "(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement, org.apache.hadoop.hbase.TableName tableName)",
"return": "void",
"signature": "void changePermsOnTable(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement, org.apache.hadoop.hbase.TableName tableName)",
"testcase": false
},
{
"class_method_signature": "MetaDataClient.changePermsOnUser(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement)",
"constructor": false,
"full_signature": "private void changePermsOnUser(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement)",
"identifier": "changePermsOnUser",
"modifiers": "private",
"parameters": "(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement)",
"return": "void",
"signature": "void changePermsOnUser(ClusterConnection clusterConnection, ChangePermsStatement changePermsStatement)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "@VisibleForTesting\n public boolean handleCreateTableMutationCode(MetaDataMutationResult result, MutationCode code,\n CreateTableStatement statement, String schemaName, String tableName,\n PTable parent) throws SQLException {\n switch(code) {\n case TABLE_ALREADY_EXISTS:\n if(result.getTable() != null) {\n addTableToCache(result);\n }\n if(!statement.ifNotExists()) {\n throw new TableAlreadyExistsException(schemaName, tableName, result.getTable());\n }\n return true;\n case NEWER_TABLE_FOUND:\n // Add table to ConnectionQueryServices so it's cached, but don't add\n // it to this connection as we can't see it.\n if (!statement.ifNotExists()) {\n throw new NewerTableAlreadyExistsException(schemaName, tableName,\n result.getTable());\n }\n return false;\n case UNALLOWED_TABLE_MUTATION:\n throwsSQLExceptionUtil(\"CANNOT_MUTATE_TABLE\",schemaName,tableName);\n case CONCURRENT_TABLE_MUTATION:\n addTableToCache(result);\n throw new ConcurrentTableMutationException(schemaName, tableName);\n case AUTO_PARTITION_SEQUENCE_NOT_FOUND:\n throw new SQLExceptionInfo.Builder(SQLExceptionCode.AUTO_PARTITION_SEQUENCE_UNDEFINED)\n .setSchemaName(schemaName).setTableName(tableName).build().buildException();\n case CANNOT_COERCE_AUTO_PARTITION_ID:\n case UNABLE_TO_CREATE_CHILD_LINK:\n case PARENT_TABLE_NOT_FOUND:\n case TABLE_NOT_IN_REGION:\n throwsSQLExceptionUtil(String.valueOf(code), schemaName, tableName);\n case TOO_MANY_INDEXES:\n case UNABLE_TO_UPDATE_PARENT_TABLE:\n throwsSQLExceptionUtil(String.valueOf(code), SchemaUtil.getSchemaNameFromFullName(\n parent.getPhysicalName().getString()),SchemaUtil.getTableNameFromFullName(\n parent.getPhysicalName().getString()));\n default:\n // Cannot use SQLExecptionInfo here since not all mutation codes have their\n // corresponding codes in the enum SQLExceptionCode\n throw new SQLExceptionInfo.Builder(SQLExceptionCode.UNEXPECTED_MUTATION_CODE)\n .setSchemaName(schemaName).setTableName(tableName).setMessage(\"mutation code: \"\n + code).build().buildException();\n }\n }",
"class_method_signature": "MetaDataClient.handleCreateTableMutationCode(MetaDataMutationResult result, MutationCode code,\n CreateTableStatement statement, String schemaName, String tableName,\n PTable parent)",
"constructor": false,
"full_signature": "@VisibleForTesting public boolean handleCreateTableMutationCode(MetaDataMutationResult result, MutationCode code,\n CreateTableStatement statement, String schemaName, String tableName,\n PTable parent)",
"identifier": "handleCreateTableMutationCode",
"invocations": [
"getTable",
"addTableToCache",
"ifNotExists",
"getTable",
"ifNotExists",
"getTable",
"throwsSQLExceptionUtil",
"addTableToCache",
"buildException",
"build",
"setTableName",
"setSchemaName",
"throwsSQLExceptionUtil",
"valueOf",
"throwsSQLExceptionUtil",
"valueOf",
"getSchemaNameFromFullName",
"getString",
"getPhysicalName",
"getTableNameFromFullName",
"getString",
"getPhysicalName",
"buildException",
"build",
"setMessage",
"setTableName",
"setSchemaName"
],
"modifiers": "@VisibleForTesting public",
"parameters": "(MetaDataMutationResult result, MutationCode code,\n CreateTableStatement statement, String schemaName, String tableName,\n PTable parent)",
"return": "boolean",
"signature": "boolean handleCreateTableMutationCode(MetaDataMutationResult result, MutationCode code,\n CreateTableStatement statement, String schemaName, String tableName,\n PTable parent)",
"testcase": false
} | {
"created": "6/4/2014 7:00:08 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 20473418,
"size": null,
"stargazer_count": null,
"stars": 752,
"updates": "2020-01-27T08:20:53+00:00",
"url": "https://github.com/apache/phoenix"
} |
20473418_72 | {
"fields": [],
"file": "phoenix-core/src/test/java/org/apache/phoenix/util/PhoenixContextExecutorTest.java",
"identifier": "PhoenixContextExecutorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCall() {\n URLClassLoader customerClassLoader = new URLClassLoader(new URL[]{});\n ClassLoader saveCcl = Thread.currentThread().getContextClassLoader();\n Thread.currentThread().setContextClassLoader(customerClassLoader);\n try {\n PhoenixContextExecutor.callWithoutPropagation(new Callable<Object>() {\n @Override\n public Object call() {\n assertEquals(\n PhoenixContextExecutor.class.getClassLoader(),\n Thread.currentThread().getContextClassLoader());\n return null;\n }\n });\n } finally {\n Thread.currentThread().setContextClassLoader(saveCcl);\n }\n\n }",
"class_method_signature": "PhoenixContextExecutorTest.testCall()",
"constructor": false,
"full_signature": "@Test public void testCall()",
"identifier": "testCall",
"invocations": [
"getContextClassLoader",
"currentThread",
"setContextClassLoader",
"currentThread",
"callWithoutPropagation",
"assertEquals",
"getClassLoader",
"getContextClassLoader",
"currentThread",
"setContextClassLoader",
"currentThread"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testCall()",
"testcase": true
} | {
"fields": [
{
"declarator": "CACHED_CLASSLOADER = PhoenixContextExecutor.class.getClassLoader()",
"modifier": "private static final",
"original_string": "private static final ClassLoader CACHED_CLASSLOADER = PhoenixContextExecutor.class.getClassLoader();",
"type": "ClassLoader",
"var_name": "CACHED_CLASSLOADER"
}
],
"file": "phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixContextExecutor.java",
"identifier": "PhoenixContextExecutor",
"interfaces": "",
"methods": [
{
"class_method_signature": "PhoenixContextExecutor.inContext()",
"constructor": false,
"full_signature": "public static CallWrapper inContext()",
"identifier": "inContext",
"modifiers": "public static",
"parameters": "()",
"return": "CallWrapper",
"signature": "CallWrapper inContext()",
"testcase": false
},
{
"class_method_signature": "PhoenixContextExecutor.call(Callable<T> target)",
"constructor": false,
"full_signature": "public static T call(Callable<T> target)",
"identifier": "call",
"modifiers": "public static",
"parameters": "(Callable<T> target)",
"return": "T",
"signature": "T call(Callable<T> target)",
"testcase": false
},
{
"class_method_signature": "PhoenixContextExecutor.callWithoutPropagation(Callable<T> target)",
"constructor": false,
"full_signature": "public static T callWithoutPropagation(Callable<T> target)",
"identifier": "callWithoutPropagation",
"modifiers": "public static",
"parameters": "(Callable<T> target)",
"return": "T",
"signature": "T callWithoutPropagation(Callable<T> target)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "public static <T> T call(Callable<T> target) throws Exception {\n ClassLoader saveCcl = Thread.currentThread().getContextClassLoader();\n try {\n Thread.currentThread().setContextClassLoader(CACHED_CLASSLOADER);\n return target.call();\n } finally {\n Thread.currentThread().setContextClassLoader(saveCcl);\n }\n }",
"class_method_signature": "PhoenixContextExecutor.call(Callable<T> target)",
"constructor": false,
"full_signature": "public static T call(Callable<T> target)",
"identifier": "call",
"invocations": [
"getContextClassLoader",
"currentThread",
"setContextClassLoader",
"currentThread",
"call",
"setContextClassLoader",
"currentThread"
],
"modifiers": "public static",
"parameters": "(Callable<T> target)",
"return": "T",
"signature": "T call(Callable<T> target)",
"testcase": false
} | {
"created": "6/4/2014 7:00:08 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 20473418,
"size": null,
"stargazer_count": null,
"stars": 752,
"updates": "2020-01-27T08:20:53+00:00",
"url": "https://github.com/apache/phoenix"
} |
20473418_167 | {
"fields": [],
"file": "phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixPreparedStatementTest.java",
"identifier": "PhoenixPreparedStatementTest",
"interfaces": "",
"superclass": "extends BaseConnectionlessQueryTest"
} | {
"body": "@Test\n public void testQueriesUsingExecuteUpdateShouldFail() throws Exception {\n Properties connectionProperties = new Properties();\n Connection connection = DriverManager.getConnection(getUrl(), connectionProperties);\n PreparedStatement stmt = connection.prepareStatement(\"SELECT * FROM \" + ATABLE);\n try {\n stmt.executeUpdate();\n fail();\n } catch(SQLException e) {\n assertEquals(SQLExceptionCode.EXECUTE_UPDATE_NOT_APPLICABLE.getErrorCode(), e.getErrorCode());\n }\n }",
"class_method_signature": "PhoenixPreparedStatementTest.testQueriesUsingExecuteUpdateShouldFail()",
"constructor": false,
"full_signature": "@Test public void testQueriesUsingExecuteUpdateShouldFail()",
"identifier": "testQueriesUsingExecuteUpdateShouldFail",
"invocations": [
"getConnection",
"getUrl",
"prepareStatement",
"executeUpdate",
"fail",
"assertEquals",
"getErrorCode",
"getErrorCode"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testQueriesUsingExecuteUpdateShouldFail()",
"testcase": true
} | {
"fields": [
{
"declarator": "parameterCount",
"modifier": "private final",
"original_string": "private final int parameterCount;",
"type": "int",
"var_name": "parameterCount"
},
{
"declarator": "parameters",
"modifier": "private final",
"original_string": "private final List<Object> parameters;",
"type": "List<Object>",
"var_name": "parameters"
},
{
"declarator": "statement",
"modifier": "private final",
"original_string": "private final CompilableStatement statement;",
"type": "CompilableStatement",
"var_name": "statement"
},
{
"declarator": "query",
"modifier": "private final",
"original_string": "private final String query;",
"type": "String",
"var_name": "query"
}
],
"file": "phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixPreparedStatement.java",
"identifier": "PhoenixPreparedStatement",
"interfaces": "implements PreparedStatement, SQLCloseable",
"methods": [
{
"class_method_signature": "PhoenixPreparedStatement.PhoenixPreparedStatement(PhoenixConnection connection, PhoenixStatementParser parser)",
"constructor": true,
"full_signature": "public PhoenixPreparedStatement(PhoenixConnection connection, PhoenixStatementParser parser)",
"identifier": "PhoenixPreparedStatement",
"modifiers": "public",
"parameters": "(PhoenixConnection connection, PhoenixStatementParser parser)",
"return": "",
"signature": " PhoenixPreparedStatement(PhoenixConnection connection, PhoenixStatementParser parser)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.PhoenixPreparedStatement(PhoenixConnection connection, String query)",
"constructor": true,
"full_signature": "public PhoenixPreparedStatement(PhoenixConnection connection, String query)",
"identifier": "PhoenixPreparedStatement",
"modifiers": "public",
"parameters": "(PhoenixConnection connection, String query)",
"return": "",
"signature": " PhoenixPreparedStatement(PhoenixConnection connection, String query)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.PhoenixPreparedStatement(PhoenixPreparedStatement statement)",
"constructor": true,
"full_signature": "public PhoenixPreparedStatement(PhoenixPreparedStatement statement)",
"identifier": "PhoenixPreparedStatement",
"modifiers": "public",
"parameters": "(PhoenixPreparedStatement statement)",
"return": "",
"signature": " PhoenixPreparedStatement(PhoenixPreparedStatement statement)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.addBatch()",
"constructor": false,
"full_signature": "@Override public void addBatch()",
"identifier": "addBatch",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void addBatch()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setParameter(int parameterIndex, Object value)",
"constructor": false,
"full_signature": "private void setParameter(int parameterIndex, Object value)",
"identifier": "setParameter",
"modifiers": "private",
"parameters": "(int parameterIndex, Object value)",
"return": "void",
"signature": "void setParameter(int parameterIndex, Object value)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.clearParameters()",
"constructor": false,
"full_signature": "@Override public void clearParameters()",
"identifier": "clearParameters",
"modifiers": "@Override public",
"parameters": "()",
"return": "void",
"signature": "void clearParameters()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.getParameters()",
"constructor": false,
"full_signature": "@Override public List<Object> getParameters()",
"identifier": "getParameters",
"modifiers": "@Override public",
"parameters": "()",
"return": "List<Object>",
"signature": "List<Object> getParameters()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.throwIfUnboundParameters()",
"constructor": false,
"full_signature": "private void throwIfUnboundParameters()",
"identifier": "throwIfUnboundParameters",
"modifiers": "private",
"parameters": "()",
"return": "void",
"signature": "void throwIfUnboundParameters()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.compileQuery()",
"constructor": false,
"full_signature": "public QueryPlan compileQuery()",
"identifier": "compileQuery",
"modifiers": "public",
"parameters": "()",
"return": "QueryPlan",
"signature": "QueryPlan compileQuery()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.compileMutation()",
"constructor": false,
"full_signature": "public MutationPlan compileMutation()",
"identifier": "compileMutation",
"modifiers": "public",
"parameters": "()",
"return": "MutationPlan",
"signature": "MutationPlan compileMutation()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.execute(boolean batched)",
"constructor": false,
"full_signature": " boolean execute(boolean batched)",
"identifier": "execute",
"modifiers": "",
"parameters": "(boolean batched)",
"return": "boolean",
"signature": "boolean execute(boolean batched)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.execute()",
"constructor": false,
"full_signature": "@Override public boolean execute()",
"identifier": "execute",
"modifiers": "@Override public",
"parameters": "()",
"return": "boolean",
"signature": "boolean execute()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.executeQuery()",
"constructor": false,
"full_signature": "@Override public ResultSet executeQuery()",
"identifier": "executeQuery",
"modifiers": "@Override public",
"parameters": "()",
"return": "ResultSet",
"signature": "ResultSet executeQuery()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.executeUpdate()",
"constructor": false,
"full_signature": "@Override public int executeUpdate()",
"identifier": "executeUpdate",
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int executeUpdate()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.optimizeQuery()",
"constructor": false,
"full_signature": "public QueryPlan optimizeQuery()",
"identifier": "optimizeQuery",
"modifiers": "public",
"parameters": "()",
"return": "QueryPlan",
"signature": "QueryPlan optimizeQuery()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.getMetaData()",
"constructor": false,
"full_signature": "@Override public ResultSetMetaData getMetaData()",
"identifier": "getMetaData",
"modifiers": "@Override public",
"parameters": "()",
"return": "ResultSetMetaData",
"signature": "ResultSetMetaData getMetaData()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.getParameterMetaData()",
"constructor": false,
"full_signature": "@Override public ParameterMetaData getParameterMetaData()",
"identifier": "getParameterMetaData",
"modifiers": "@Override public",
"parameters": "()",
"return": "ParameterMetaData",
"signature": "ParameterMetaData getParameterMetaData()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.toString()",
"constructor": false,
"full_signature": "@Override public String toString()",
"identifier": "toString",
"modifiers": "@Override public",
"parameters": "()",
"return": "String",
"signature": "String toString()",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setArray(int parameterIndex, Array x)",
"constructor": false,
"full_signature": "@Override public void setArray(int parameterIndex, Array x)",
"identifier": "setArray",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Array x)",
"return": "void",
"signature": "void setArray(int parameterIndex, Array x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setAsciiStream(int parameterIndex, InputStream x)",
"constructor": false,
"full_signature": "@Override public void setAsciiStream(int parameterIndex, InputStream x)",
"identifier": "setAsciiStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, InputStream x)",
"return": "void",
"signature": "void setAsciiStream(int parameterIndex, InputStream x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setAsciiStream(int parameterIndex, InputStream x, int length)",
"constructor": false,
"full_signature": "@Override public void setAsciiStream(int parameterIndex, InputStream x, int length)",
"identifier": "setAsciiStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, InputStream x, int length)",
"return": "void",
"signature": "void setAsciiStream(int parameterIndex, InputStream x, int length)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setAsciiStream(int parameterIndex, InputStream x, long length)",
"constructor": false,
"full_signature": "@Override public void setAsciiStream(int parameterIndex, InputStream x, long length)",
"identifier": "setAsciiStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, InputStream x, long length)",
"return": "void",
"signature": "void setAsciiStream(int parameterIndex, InputStream x, long length)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setBigDecimal(int parameterIndex, BigDecimal x)",
"constructor": false,
"full_signature": "@Override public void setBigDecimal(int parameterIndex, BigDecimal x)",
"identifier": "setBigDecimal",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, BigDecimal x)",
"return": "void",
"signature": "void setBigDecimal(int parameterIndex, BigDecimal x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setBytes(int parameterIndex, byte[] x)",
"constructor": false,
"full_signature": "@Override public void setBytes(int parameterIndex, byte[] x)",
"identifier": "setBytes",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, byte[] x)",
"return": "void",
"signature": "void setBytes(int parameterIndex, byte[] x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setBinaryStream(int parameterIndex, InputStream x)",
"constructor": false,
"full_signature": "@Override public void setBinaryStream(int parameterIndex, InputStream x)",
"identifier": "setBinaryStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, InputStream x)",
"return": "void",
"signature": "void setBinaryStream(int parameterIndex, InputStream x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setBinaryStream(int parameterIndex, InputStream x, int length)",
"constructor": false,
"full_signature": "@Override public void setBinaryStream(int parameterIndex, InputStream x, int length)",
"identifier": "setBinaryStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, InputStream x, int length)",
"return": "void",
"signature": "void setBinaryStream(int parameterIndex, InputStream x, int length)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setBinaryStream(int parameterIndex, InputStream x, long length)",
"constructor": false,
"full_signature": "@Override public void setBinaryStream(int parameterIndex, InputStream x, long length)",
"identifier": "setBinaryStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, InputStream x, long length)",
"return": "void",
"signature": "void setBinaryStream(int parameterIndex, InputStream x, long length)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setBlob(int parameterIndex, Blob x)",
"constructor": false,
"full_signature": "@Override public void setBlob(int parameterIndex, Blob x)",
"identifier": "setBlob",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Blob x)",
"return": "void",
"signature": "void setBlob(int parameterIndex, Blob x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setBlob(int parameterIndex, InputStream inputStream)",
"constructor": false,
"full_signature": "@Override public void setBlob(int parameterIndex, InputStream inputStream)",
"identifier": "setBlob",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, InputStream inputStream)",
"return": "void",
"signature": "void setBlob(int parameterIndex, InputStream inputStream)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setBlob(int parameterIndex, InputStream inputStream, long length)",
"constructor": false,
"full_signature": "@Override public void setBlob(int parameterIndex, InputStream inputStream, long length)",
"identifier": "setBlob",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, InputStream inputStream, long length)",
"return": "void",
"signature": "void setBlob(int parameterIndex, InputStream inputStream, long length)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setBoolean(int parameterIndex, boolean x)",
"constructor": false,
"full_signature": "@Override public void setBoolean(int parameterIndex, boolean x)",
"identifier": "setBoolean",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, boolean x)",
"return": "void",
"signature": "void setBoolean(int parameterIndex, boolean x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setByte(int parameterIndex, byte x)",
"constructor": false,
"full_signature": "@Override public void setByte(int parameterIndex, byte x)",
"identifier": "setByte",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, byte x)",
"return": "void",
"signature": "void setByte(int parameterIndex, byte x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setCharacterStream(int parameterIndex, Reader reader)",
"constructor": false,
"full_signature": "@Override public void setCharacterStream(int parameterIndex, Reader reader)",
"identifier": "setCharacterStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Reader reader)",
"return": "void",
"signature": "void setCharacterStream(int parameterIndex, Reader reader)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setCharacterStream(int parameterIndex, Reader reader, int length)",
"constructor": false,
"full_signature": "@Override public void setCharacterStream(int parameterIndex, Reader reader, int length)",
"identifier": "setCharacterStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Reader reader, int length)",
"return": "void",
"signature": "void setCharacterStream(int parameterIndex, Reader reader, int length)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setCharacterStream(int parameterIndex, Reader reader, long length)",
"constructor": false,
"full_signature": "@Override public void setCharacterStream(int parameterIndex, Reader reader, long length)",
"identifier": "setCharacterStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Reader reader, long length)",
"return": "void",
"signature": "void setCharacterStream(int parameterIndex, Reader reader, long length)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setClob(int parameterIndex, Clob x)",
"constructor": false,
"full_signature": "@Override public void setClob(int parameterIndex, Clob x)",
"identifier": "setClob",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Clob x)",
"return": "void",
"signature": "void setClob(int parameterIndex, Clob x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setClob(int parameterIndex, Reader reader)",
"constructor": false,
"full_signature": "@Override public void setClob(int parameterIndex, Reader reader)",
"identifier": "setClob",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Reader reader)",
"return": "void",
"signature": "void setClob(int parameterIndex, Reader reader)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setClob(int parameterIndex, Reader reader, long length)",
"constructor": false,
"full_signature": "@Override public void setClob(int parameterIndex, Reader reader, long length)",
"identifier": "setClob",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Reader reader, long length)",
"return": "void",
"signature": "void setClob(int parameterIndex, Reader reader, long length)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setDate(int parameterIndex, Date x)",
"constructor": false,
"full_signature": "@Override public void setDate(int parameterIndex, Date x)",
"identifier": "setDate",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Date x)",
"return": "void",
"signature": "void setDate(int parameterIndex, Date x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setDate(int parameterIndex, Date x, Calendar cal)",
"constructor": false,
"full_signature": "@Override public void setDate(int parameterIndex, Date x, Calendar cal)",
"identifier": "setDate",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Date x, Calendar cal)",
"return": "void",
"signature": "void setDate(int parameterIndex, Date x, Calendar cal)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setDouble(int parameterIndex, double x)",
"constructor": false,
"full_signature": "@Override public void setDouble(int parameterIndex, double x)",
"identifier": "setDouble",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, double x)",
"return": "void",
"signature": "void setDouble(int parameterIndex, double x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setFloat(int parameterIndex, float x)",
"constructor": false,
"full_signature": "@Override public void setFloat(int parameterIndex, float x)",
"identifier": "setFloat",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, float x)",
"return": "void",
"signature": "void setFloat(int parameterIndex, float x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setInt(int parameterIndex, int x)",
"constructor": false,
"full_signature": "@Override public void setInt(int parameterIndex, int x)",
"identifier": "setInt",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, int x)",
"return": "void",
"signature": "void setInt(int parameterIndex, int x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setLong(int parameterIndex, long x)",
"constructor": false,
"full_signature": "@Override public void setLong(int parameterIndex, long x)",
"identifier": "setLong",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, long x)",
"return": "void",
"signature": "void setLong(int parameterIndex, long x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setNCharacterStream(int parameterIndex, Reader value)",
"constructor": false,
"full_signature": "@Override public void setNCharacterStream(int parameterIndex, Reader value)",
"identifier": "setNCharacterStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Reader value)",
"return": "void",
"signature": "void setNCharacterStream(int parameterIndex, Reader value)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setNCharacterStream(int parameterIndex, Reader value, long length)",
"constructor": false,
"full_signature": "@Override public void setNCharacterStream(int parameterIndex, Reader value, long length)",
"identifier": "setNCharacterStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Reader value, long length)",
"return": "void",
"signature": "void setNCharacterStream(int parameterIndex, Reader value, long length)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setNClob(int parameterIndex, NClob value)",
"constructor": false,
"full_signature": "@Override public void setNClob(int parameterIndex, NClob value)",
"identifier": "setNClob",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, NClob value)",
"return": "void",
"signature": "void setNClob(int parameterIndex, NClob value)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setNClob(int parameterIndex, Reader reader)",
"constructor": false,
"full_signature": "@Override public void setNClob(int parameterIndex, Reader reader)",
"identifier": "setNClob",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Reader reader)",
"return": "void",
"signature": "void setNClob(int parameterIndex, Reader reader)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setNClob(int parameterIndex, Reader reader, long length)",
"constructor": false,
"full_signature": "@Override public void setNClob(int parameterIndex, Reader reader, long length)",
"identifier": "setNClob",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Reader reader, long length)",
"return": "void",
"signature": "void setNClob(int parameterIndex, Reader reader, long length)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setNString(int parameterIndex, String value)",
"constructor": false,
"full_signature": "@Override public void setNString(int parameterIndex, String value)",
"identifier": "setNString",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, String value)",
"return": "void",
"signature": "void setNString(int parameterIndex, String value)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setNull(int parameterIndex, int sqlType)",
"constructor": false,
"full_signature": "@Override public void setNull(int parameterIndex, int sqlType)",
"identifier": "setNull",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, int sqlType)",
"return": "void",
"signature": "void setNull(int parameterIndex, int sqlType)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setNull(int parameterIndex, int sqlType, String typeName)",
"constructor": false,
"full_signature": "@Override public void setNull(int parameterIndex, int sqlType, String typeName)",
"identifier": "setNull",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, int sqlType, String typeName)",
"return": "void",
"signature": "void setNull(int parameterIndex, int sqlType, String typeName)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setObject(int parameterIndex, Object o)",
"constructor": false,
"full_signature": "@Override public void setObject(int parameterIndex, Object o)",
"identifier": "setObject",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Object o)",
"return": "void",
"signature": "void setObject(int parameterIndex, Object o)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setObject(int parameterIndex, Object o, int targetSqlType)",
"constructor": false,
"full_signature": "@Override public void setObject(int parameterIndex, Object o, int targetSqlType)",
"identifier": "setObject",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Object o, int targetSqlType)",
"return": "void",
"signature": "void setObject(int parameterIndex, Object o, int targetSqlType)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)",
"constructor": false,
"full_signature": "@Override public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)",
"identifier": "setObject",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)",
"return": "void",
"signature": "void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setRef(int parameterIndex, Ref x)",
"constructor": false,
"full_signature": "@Override public void setRef(int parameterIndex, Ref x)",
"identifier": "setRef",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Ref x)",
"return": "void",
"signature": "void setRef(int parameterIndex, Ref x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setRowId(int parameterIndex, RowId x)",
"constructor": false,
"full_signature": "@Override public void setRowId(int parameterIndex, RowId x)",
"identifier": "setRowId",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, RowId x)",
"return": "void",
"signature": "void setRowId(int parameterIndex, RowId x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setSQLXML(int parameterIndex, SQLXML xmlObject)",
"constructor": false,
"full_signature": "@Override public void setSQLXML(int parameterIndex, SQLXML xmlObject)",
"identifier": "setSQLXML",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, SQLXML xmlObject)",
"return": "void",
"signature": "void setSQLXML(int parameterIndex, SQLXML xmlObject)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setShort(int parameterIndex, short x)",
"constructor": false,
"full_signature": "@Override public void setShort(int parameterIndex, short x)",
"identifier": "setShort",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, short x)",
"return": "void",
"signature": "void setShort(int parameterIndex, short x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setString(int parameterIndex, String x)",
"constructor": false,
"full_signature": "@Override public void setString(int parameterIndex, String x)",
"identifier": "setString",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, String x)",
"return": "void",
"signature": "void setString(int parameterIndex, String x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setTime(int parameterIndex, Time x)",
"constructor": false,
"full_signature": "@Override public void setTime(int parameterIndex, Time x)",
"identifier": "setTime",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Time x)",
"return": "void",
"signature": "void setTime(int parameterIndex, Time x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setTime(int parameterIndex, Time x, Calendar cal)",
"constructor": false,
"full_signature": "@Override public void setTime(int parameterIndex, Time x, Calendar cal)",
"identifier": "setTime",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Time x, Calendar cal)",
"return": "void",
"signature": "void setTime(int parameterIndex, Time x, Calendar cal)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setTimestampParameter(int parameterIndex, Timestamp x, Calendar cal)",
"constructor": false,
"full_signature": "private void setTimestampParameter(int parameterIndex, Timestamp x, Calendar cal)",
"identifier": "setTimestampParameter",
"modifiers": "private",
"parameters": "(int parameterIndex, Timestamp x, Calendar cal)",
"return": "void",
"signature": "void setTimestampParameter(int parameterIndex, Timestamp x, Calendar cal)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setTimestamp(int parameterIndex, Timestamp x)",
"constructor": false,
"full_signature": "@Override public void setTimestamp(int parameterIndex, Timestamp x)",
"identifier": "setTimestamp",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Timestamp x)",
"return": "void",
"signature": "void setTimestamp(int parameterIndex, Timestamp x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setTimestamp(int parameterIndex, Timestamp x, Calendar cal)",
"constructor": false,
"full_signature": "@Override public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)",
"identifier": "setTimestamp",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, Timestamp x, Calendar cal)",
"return": "void",
"signature": "void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setURL(int parameterIndex, URL x)",
"constructor": false,
"full_signature": "@Override public void setURL(int parameterIndex, URL x)",
"identifier": "setURL",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, URL x)",
"return": "void",
"signature": "void setURL(int parameterIndex, URL x)",
"testcase": false
},
{
"class_method_signature": "PhoenixPreparedStatement.setUnicodeStream(int parameterIndex, InputStream x, int length)",
"constructor": false,
"full_signature": "@Override public void setUnicodeStream(int parameterIndex, InputStream x, int length)",
"identifier": "setUnicodeStream",
"modifiers": "@Override public",
"parameters": "(int parameterIndex, InputStream x, int length)",
"return": "void",
"signature": "void setUnicodeStream(int parameterIndex, InputStream x, int length)",
"testcase": false
}
],
"superclass": "extends PhoenixStatement"
} | {
"body": "@Override\n public int executeUpdate() throws SQLException {\n throwIfUnboundParameters();\n if (!statement.getOperation().isMutation()) {\n throw new ExecuteUpdateNotApplicableException(statement.getOperation());\n }\n if (!batch.isEmpty()) {\n throw new SQLExceptionInfo.Builder(SQLExceptionCode.EXECUTE_UPDATE_WITH_NON_EMPTY_BATCH)\n .build().buildException();\n }\n return executeMutation(statement);\n }",
"class_method_signature": "PhoenixPreparedStatement.executeUpdate()",
"constructor": false,
"full_signature": "@Override public int executeUpdate()",
"identifier": "executeUpdate",
"invocations": [
"throwIfUnboundParameters",
"isMutation",
"getOperation",
"getOperation",
"isEmpty",
"buildException",
"build",
"executeMutation"
],
"modifiers": "@Override public",
"parameters": "()",
"return": "int",
"signature": "int executeUpdate()",
"testcase": false
} | {
"created": "6/4/2014 7:00:08 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 20473418,
"size": null,
"stargazer_count": null,
"stars": 752,
"updates": "2020-01-27T08:20:53+00:00",
"url": "https://github.com/apache/phoenix"
} |
20473418_0 | {
"fields": [],
"file": "phoenix-pherf/src/test/java/org/apache/phoenix/pherf/util/ResourceListTest.java",
"identifier": "ResourceListTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMissingJarFileReturnsGracefully() {\n ResourceList rl = new ResourceList(\"foo\");\n File missingFile = new File(\"abracadabraphoenix.txt\");\n assertFalse(\"Did not expect a fake test file to actually exist\", missingFile.exists());\n assertEquals(Collections.emptyList(), rl.getResourcesFromJarFile(missingFile, Pattern.compile(\"pattern\")));\n }",
"class_method_signature": "ResourceListTest.testMissingJarFileReturnsGracefully()",
"constructor": false,
"full_signature": "@Test public void testMissingJarFileReturnsGracefully()",
"identifier": "testMissingJarFileReturnsGracefully",
"invocations": [
"assertFalse",
"exists",
"assertEquals",
"emptyList",
"getResourcesFromJarFile",
"compile"
],
"modifiers": "@Test public",
"parameters": "()",
"return": "void",
"signature": "void testMissingJarFileReturnsGracefully()",
"testcase": true
} | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ResourceList.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ResourceList.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declarator": "rootResourceDir",
"modifier": "private final",
"original_string": "private final String rootResourceDir;",
"type": "String",
"var_name": "rootResourceDir"
},
{
"declarator": "dirsToIgnore = Lists.newArrayList(\"sql_files\")",
"modifier": "private",
"original_string": "private List<String> dirsToIgnore = Lists.newArrayList(\"sql_files\");",
"type": "List<String>",
"var_name": "dirsToIgnore"
}
],
"file": "phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/ResourceList.java",
"identifier": "ResourceList",
"interfaces": "",
"methods": [
{
"class_method_signature": "ResourceList.ResourceList(String rootResourceDir)",
"constructor": true,
"full_signature": "public ResourceList(String rootResourceDir)",
"identifier": "ResourceList",
"modifiers": "public",
"parameters": "(String rootResourceDir)",
"return": "",
"signature": " ResourceList(String rootResourceDir)",
"testcase": false
},
{
"class_method_signature": "ResourceList.getResourceList(final String pattern)",
"constructor": false,
"full_signature": "public Collection<Path> getResourceList(final String pattern)",
"identifier": "getResourceList",
"modifiers": "public",
"parameters": "(final String pattern)",
"return": "Collection<Path>",
"signature": "Collection<Path> getResourceList(final String pattern)",
"testcase": false
},
{
"class_method_signature": "ResourceList.getResourcesPaths(\n final Pattern pattern)",
"constructor": false,
"full_signature": "private Collection<Path> getResourcesPaths(\n final Pattern pattern)",
"identifier": "getResourcesPaths",
"modifiers": "private",
"parameters": "(\n final Pattern pattern)",
"return": "Collection<Path>",
"signature": "Collection<Path> getResourcesPaths(\n final Pattern pattern)",
"testcase": false
},
{
"class_method_signature": "ResourceList.getResources(\n final String element,\n final Pattern pattern)",
"constructor": false,
"full_signature": "private Collection<String> getResources(\n final String element,\n final Pattern pattern)",
"identifier": "getResources",
"modifiers": "private",
"parameters": "(\n final String element,\n final Pattern pattern)",
"return": "Collection<String>",
"signature": "Collection<String> getResources(\n final String element,\n final Pattern pattern)",
"testcase": false
},
{
"class_method_signature": "ResourceList.getResourcesFromJarFile(\n final File file,\n final Pattern pattern)",
"constructor": false,
"full_signature": " Collection<String> getResourcesFromJarFile(\n final File file,\n final Pattern pattern)",
"identifier": "getResourcesFromJarFile",
"modifiers": "",
"parameters": "(\n final File file,\n final Pattern pattern)",
"return": "Collection<String>",
"signature": "Collection<String> getResourcesFromJarFile(\n final File file,\n final Pattern pattern)",
"testcase": false
},
{
"class_method_signature": "ResourceList.getResourcesFromDirectory(\n final File directory,\n final Pattern pattern)",
"constructor": false,
"full_signature": "private Collection<String> getResourcesFromDirectory(\n final File directory,\n final Pattern pattern)",
"identifier": "getResourcesFromDirectory",
"modifiers": "private",
"parameters": "(\n final File directory,\n final Pattern pattern)",
"return": "Collection<String>",
"signature": "Collection<String> getResourcesFromDirectory(\n final File directory,\n final Pattern pattern)",
"testcase": false
},
{
"class_method_signature": "ResourceList.isIgnoredDir(String path)",
"constructor": false,
"full_signature": "private boolean isIgnoredDir(String path)",
"identifier": "isIgnoredDir",
"modifiers": "private",
"parameters": "(String path)",
"return": "boolean",
"signature": "boolean isIgnoredDir(String path)",
"testcase": false
}
],
"superclass": ""
} | {
"body": "Collection<String> getResourcesFromJarFile(\n final File file,\n final Pattern pattern) {\n final List<String> retVal = new ArrayList<>();\n ZipFile zf;\n try {\n zf = new ZipFile(file);\n } catch (FileNotFoundException|NoSuchFileException e) {\n // Gracefully handle a jar listed on the classpath that doesn't actually exist.\n return Collections.emptyList();\n } catch (final ZipException e) {\n throw new Error(e);\n } catch (final IOException e) {\n throw new Error(e);\n }\n final Enumeration e = zf.entries();\n while (e.hasMoreElements()) {\n final ZipEntry ze = (ZipEntry) e.nextElement();\n final String fileName = ze.getName();\n final boolean accept = pattern.matcher(fileName).matches();\n LOGGER.trace(\"fileName:\" + fileName);\n LOGGER.trace(\"File:\" + file.toString());\n LOGGER.trace(\"Match:\" + accept);\n if (accept) {\n LOGGER.trace(\"Adding File from Jar: \" + fileName);\n retVal.add(\"/\" + fileName);\n }\n }\n try {\n zf.close();\n } catch (final IOException e1) {\n throw new Error(e1);\n }\n return retVal;\n }",
"class_method_signature": "ResourceList.getResourcesFromJarFile(\n final File file,\n final Pattern pattern)",
"constructor": false,
"full_signature": " Collection<String> getResourcesFromJarFile(\n final File file,\n final Pattern pattern)",
"identifier": "getResourcesFromJarFile",
"invocations": [
"emptyList",
"entries",
"hasMoreElements",
"nextElement",
"getName",
"matches",
"matcher",
"trace",
"trace",
"toString",
"trace",
"trace",
"add",
"close"
],
"modifiers": "",
"parameters": "(\n final File file,\n final Pattern pattern)",
"return": "Collection<String>",
"signature": "Collection<String> getResourcesFromJarFile(\n final File file,\n final Pattern pattern)",
"testcase": false
} | {
"created": "6/4/2014 7:00:08 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 20473418,
"size": null,
"stargazer_count": null,
"stars": 752,
"updates": "2020-01-27T08:20:53+00:00",
"url": "https://github.com/apache/phoenix"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.