id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
8582237_129 | {
"fields": [],
"file": "hbase_sql/src/test/java/com/splicemachine/orc/block/StringColumnBlockTest.java",
"identifier": "StringColumnBlockTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void setPartitionValueTest() {\n StringColumnBlock stringColumnBlock = new StringColumnBlock(null, DataTypes.StringType);\n stringColumnBlock.setPartitionValue(\"foobar\",1000);\n for (int i = 0; i< 1000; i++) {\n Assert.assertTrue(\"foobar\".equals(stringC... | {
"fields": [],
"file": "hbase_sql/src/main/java/com/splicemachine/orc/block/StringColumnBlock.java",
"identifier": "StringColumnBlock",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringColumnBlock.StringColumnBlock(ColumnVector columnVector, DataType type)",
"constructor": tr... | {
"body": "@Override\n public void setPartitionValue(String value, int size) {\n try {\n columnVector = ColumnVector.allocate(size, DataTypes.IntegerType, MemoryMode.ON_HEAP);\n SliceDictionary dictionary = new SliceDictionary(new Slice[]{Slices.wrappedBuffer(value.getBytes(\"UTF-8\"))... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_216 | {
"fields": [
{
"declarator": "numRandomValues=1",
"modifier": "private static final",
"original_string": "private static final int numRandomValues=1;",
"type": "int",
"var_name": "numRandomValues"
},
{
"declarator": "kryoPool = mock(KryoPool.class)",
"modifier": ... | {
"body": "@Test\n\t\tpublic void testCanEncodeAndDecodeProperly() throws Exception {\n\t\t\t\tExecRow execRow = new ValueRow(dataTypes.length);\n\t\t\t\tfor(int i=0;i<dataTypes.length;i++){\n\t\t\t\t\t\texecRow.setColumn(i + 1, row[i].cloneValue(true));\n\t\t\t\t}\n\n\n\t\t\t\tint[] keyColumns= new int[dataTypes.len... | {
"fields": [
{
"declarator": "keyColumns",
"modifier": "protected final",
"original_string": "protected final int[] keyColumns;",
"type": "int[]",
"var_name": "keyColumns"
},
{
"declarator": "keySortOrder",
"modifier": "protected final",
"original_string": ... | {
"body": "public static DataHash encoder(int[] keyColumns,boolean[] keySortOrder,DescriptorSerializer[] serializers){\n return encoder(keyColumns,keySortOrder,SpliceKryoRegistry.getInstance(),serializers);\n }",
"class_method_signature": "BareKeyHash.encoder(int[] keyColumns,boolean[] keySortOrder,Descri... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_241 | {
"fields": [
{
"declarator": "DF = new SimpleDateFormat(\"yyyy/MM/dd\")",
"modifier": "private static final",
"original_string": "private static final DateFormat DF = new SimpleDateFormat(\"yyyy/MM/dd\");",
"type": "DateFormat",
"var_name": "DF"
},
{
"declarator": "DFT... | {
"body": "@Test\n public void truncDate_Millennium() throws ParseException, SQLException {\n assertEquals(timeStampT(\"0000/01/01 00:00:00.000\"), TRUNC_DATE(timeStampT(\"955/12/31 12:13:14.123\"), \"millennium\"));\n assertEquals(timeStampT(\"1000/01/01 00:00:00.000\"), TRUNC_DATE(timeStampT(\"1955... | {
"fields": [
{
"declarator": "WEEK_DAY_MAP = new ImmutableMap.Builder<String, Integer>()\n .put(\"sunday\", 1).put(\"monday\", 2).put(\"tuesday\", 3).put(\"wednesday\", 4).put(\"thursday\", 5)\n .put(\"friday\", 6).put(\"saturday\", 7).build()",
"modifier": "private static final... | {
"body": "public static Timestamp TRUNC_DATE(Timestamp source, String field) throws SQLException {\n if (source == null || field == null) return null;\n DateTime dt = new DateTime(source);\n field = field.toLowerCase();\n String lowerCaseField = field.toLowerCase();\n if (\"microse... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_168 | {
"fields": [
{
"declarator": "watermark = 1000",
"modifier": "private",
"original_string": "private long watermark = 1000;",
"type": "long",
"var_name": "watermark"
},
{
"declarator": "cutNoPurge = new SICompactionStateMutate(\n new PurgeConfigBuilder().noPu... | {
"body": "@Test\n public void mutatePurgeKeepTombstonesOverriddenByFirstOccurrenceToken() throws IOException {\n inputCells.addAll(Arrays.asList(\n SITestUtils.getMockCommitCell(200, 210),\n SITestUtils.getMockCommitCell(100, 110),\n SITestUtils.getMockTombstone... | {
"fields": [
{
"declarator": "LOG = Logger.getLogger(SICompactionStateMutate.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Logger.getLogger(SICompactionStateMutate.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "public long mutate(List<Cell> rawList, List<TxnView> txns, List<Cell> results) throws IOException {\n handleSanityChecks(results, rawList, txns);\n long totalSize = 0;\n try {\n Iterator<TxnView> it = txns.iterator();\n for (Cell cell : rawList) {\n ... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_187 | {
"fields": [],
"file": "utilities/src/test/java/com/splicemachine/stream/StreamsTest.java",
"identifier": "StreamsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void of() throws StreamException {\n Stream<String> stream = Streams.of(\"111\", \"222\", \"333\");\n\n assertEquals(\"111\", stream.next());\n assertEquals(\"222\", stream.next());\n assertEquals(\"333\", stream.next());\n }",
"class_method_signature": "S... | {
"fields": [
{
"declarator": "EMPTY = new AbstractStream() {\n @Override public Object next() throws StreamException { return null; }\n @Override public void close() throws StreamException { }\n }",
"modifier": "private static final",
"original_string": "private static final ... | {
"body": "@SafeVarargs public static <T> Stream<T> of(T...elements){ return new ArrayStream<>(elements); }",
"class_method_signature": "Streams.of(T...elements)",
"constructor": false,
"full_signature": "@SafeVarargs public static Stream<T> of(T...elements)",
"identifier": "of",
"invocations": [],
"modif... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_169 | {
"fields": [
{
"declarator": "watermark = 1000",
"modifier": "private",
"original_string": "private long watermark = 1000;",
"type": "long",
"var_name": "watermark"
},
{
"declarator": "cutNoPurge = new SICompactionStateMutate(\n new PurgeConfigBuilder().noPu... | {
"body": "@Test\n public void mutatePurgeLatestTombstoneInMinorCompaction() throws IOException {\n inputCells.addAll(Arrays.asList(\n SITestUtils.getMockCommitCell(200, 210),\n SITestUtils.getMockCommitCell(100, 110),\n SITestUtils.getMockTombstoneCell(200),\n ... | {
"fields": [
{
"declarator": "LOG = Logger.getLogger(SICompactionStateMutate.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Logger.getLogger(SICompactionStateMutate.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "public long mutate(List<Cell> rawList, List<TxnView> txns, List<Cell> results) throws IOException {\n handleSanityChecks(results, rawList, txns);\n long totalSize = 0;\n try {\n Iterator<TxnView> it = txns.iterator();\n for (Cell cell : rawList) {\n ... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_186 | {
"fields": [
{
"declarator": "testColl = Arrays.asList(10, 20, 30, 40, 50, 60)",
"modifier": "public static",
"original_string": "public static List testColl = Arrays.asList(10, 20, 30, 40, 50, 60);",
"type": "List",
"var_name": "testColl"
}
],
"file": "utilities/src/test/ja... | {
"body": "@Test\n public void testPartitions() throws Exception {\n Assert.assertEquals(l(Iterables.toArray(Partition.partition(testColl, 2), Object.class)),\n l(l(10, 20),\n l(30, 40),\n l(50, 60)));\n\n Assert.assertEquals(l(Iterables.to... | {
"fields": [],
"file": "utilities/src/main/java/com/splicemachine/collections/Partition.java",
"identifier": "Partition",
"interfaces": "",
"methods": [
{
"class_method_signature": "Partition.needsPadding(int seqLength, int partitionSize, int stepSize)",
"constructor": false,
"full_sign... | {
"body": "public static <T> Iterable<List<T>> partition(Collection<T> coll,\n final int size,\n final int steps,\n final boolean pad){\n final List<T> c = new Arra... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_240 | {
"fields": [
{
"declarator": "DF = new SimpleDateFormat(\"yyyy/MM/dd\")",
"modifier": "private static final",
"original_string": "private static final DateFormat DF = new SimpleDateFormat(\"yyyy/MM/dd\");",
"type": "DateFormat",
"var_name": "DF"
},
{
"declarator": "DFT... | {
"body": "@Test\n public void truncDate() throws ParseException, SQLException {\n assertEquals(timeStampT(\"2014/07/15 12:12:12.234\"), TRUNC_DATE(timeStampT(\"2014/07/15 12:12:12.234\"), \"microseconds\"));\n assertEquals(timeStampT(\"2014/07/15 12:12:12.234\"), TRUNC_DATE(timeStampT(\"2014/07/15 1... | {
"fields": [
{
"declarator": "WEEK_DAY_MAP = new ImmutableMap.Builder<String, Integer>()\n .put(\"sunday\", 1).put(\"monday\", 2).put(\"tuesday\", 3).put(\"wednesday\", 4).put(\"thursday\", 5)\n .put(\"friday\", 6).put(\"saturday\", 7).build()",
"modifier": "private static final... | {
"body": "public static Timestamp TRUNC_DATE(Timestamp source, String field) throws SQLException {\n if (source == null || field == null) return null;\n DateTime dt = new DateTime(source);\n field = field.toLowerCase();\n String lowerCaseField = field.toLowerCase();\n if (\"microse... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_217 | {
"fields": [
{
"declarator": "numRandomValues=1",
"modifier": "private static final",
"original_string": "private static final int numRandomValues=1;",
"type": "int",
"var_name": "numRandomValues"
},
{
"declarator": "kryoPool = mock(KryoPool.class)",
"modifier": ... | {
"body": "@Test\n\t\tpublic void testCanEncodeAndDecodeProperlyOutOfOrderKeyCols() throws Exception {\n\t\t\t\tExecRow execRow = new ValueRow(dataTypes.length);\n\t\t\t\tfor(int i=0;i<dataTypes.length;i++){\n\t\t\t\t\t\texecRow.setColumn(i + 1, row[i].cloneValue(true));\n\t\t\t\t}\n\n\t\t\t\tint[] keyColumns= new in... | {
"fields": [
{
"declarator": "keyColumns",
"modifier": "protected final",
"original_string": "protected final int[] keyColumns;",
"type": "int[]",
"var_name": "keyColumns"
},
{
"declarator": "keySortOrder",
"modifier": "protected final",
"original_string": ... | {
"body": "public static DataHash encoder(int[] keyColumns,boolean[] keySortOrder,DescriptorSerializer[] serializers){\n return encoder(keyColumns,keySortOrder,SpliceKryoRegistry.getInstance(),serializers);\n }",
"class_method_signature": "BareKeyHash.encoder(int[] keyColumns,boolean[] keySortOrder,Descri... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_128 | {
"fields": [],
"file": "hbase_sql/src/test/java/com/splicemachine/orc/block/LongColumnBlockTest.java",
"identifier": "LongColumnBlockTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void setPartitionValueTest() {\n LongColumnBlock longColumnBlock = new LongColumnBlock(null, DataTypes.LongType);\n longColumnBlock.setPartitionValue(\"45\",1000);\n for (int i = 0; i< 1000; i++) {\n Assert.assertEquals(45l,longColumnBlock.getTestObject(i))... | {
"fields": [],
"file": "hbase_sql/src/main/java/com/splicemachine/orc/block/LongColumnBlock.java",
"identifier": "LongColumnBlock",
"interfaces": "",
"methods": [
{
"class_method_signature": "LongColumnBlock.LongColumnBlock(ColumnVector columnVector, DataType type)",
"constructor": true,
... | {
"body": "@Override\n public void setPartitionValue(String value, int size) {\n columnVector = ColumnVector.allocate(size, dataType, MemoryMode.ON_HEAP);\n columnVector.appendLongs(size,Long.parseLong(value));\n }",
"class_method_signature": "LongColumnBlock.setPartitionValue(String value, int ... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_201 | {
"fields": [],
"file": "utilities/src/test/java/com/splicemachine/uuid/SnowflakeTest.java",
"identifier": "SnowflakeTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNoDuplicateUUIDsInASingleThread() throws Exception {\n Set<Long> uuidSet = new TreeSet<Long>();\n Snowflake snowflake = new Snowflake((short)(1<<7));\n for(int i=0;i<100000;i++){\n long uuid = snowflake.nextUUID();\n Assert.assertFalse(\... | {
"fields": [
{
"declarator": "TIMESTAMP_MASK = 0x1ffffffffffl",
"modifier": "public static final",
"original_string": "public static final long TIMESTAMP_MASK = 0x1ffffffffffl;",
"type": "long",
"var_name": "TIMESTAMP_MASK"
},
{
"declarator": "TIMESTAMP_SHIFT = 12",
... | {
"body": "public long nextUUID(){\n long timestamp;\n /*\n * Get the timestamp to use.\n *\n * There are several reasons why we have to check against the latest timestamp:\n *\n * 1. Prevent duplicate UUIDs because we ask for too many UUID... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_49 | {
"fields": [],
"file": "db-engine/src/test/java/com/splicemachine/db/iapi/types/SQLLongIntTest.java",
"identifier": "SQLLongIntTest",
"interfaces": "",
"superclass": "extends SQLDataValueDescriptorTest"
} | {
"body": "@Test\n public void writeExternalNull() throws IOException {\n SQLLongint lint = new SQLLongint();\n MockObjectOutput moo = new MockObjectOutput();\n lint.writeExternal(moo);\n Assert.assertTrue(\"Should be null\", moo.isNull);\n }",... | {
"fields": [
{
"declarator": "BASE_MEMORY_USAGE = ClassSize.estimateBaseFromCatalog( SQLLongint.class)",
"modifier": "private static final",
"original_string": "private static final int BASE_MEMORY_USAGE = ClassSize.estimateBaseFromCatalog( SQLLongint.class);",
"type": "int",
"var_n... | {
"body": "public void writeExternal(ObjectOutput out) throws IOException {\n\t\tout.writeBoolean(isNull);\n\t\tout.writeLong(value);\n\t}",
"class_method_signature": "SQLLongint.writeExternal(ObjectOutput out)",
"constructor": false,
"full_signature": "public void writeExternal(ObjectOutput out)",
"identifie... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_190 | {
"fields": [],
"file": "utilities/src/test/java/com/splicemachine/stream/AbstractStreamTest.java",
"identifier": "AbstractStreamTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void forEach() throws StreamException {\n SumAccumulator accumulator = new SumAccumulator();\n new IntegerStream().forEach(accumulator);\n assertEquals(45, accumulator.sum);\n }",
"class_method_signature": "AbstractStreamTest.forEach()",
"constructor": false,
... | {
"fields": [],
"file": "utilities/src/main/java/com/splicemachine/stream/AbstractStream.java",
"identifier": "AbstractStream",
"interfaces": "implements Stream<T>",
"methods": [
{
"class_method_signature": "AbstractStream.transform(Transformer<T, V> transformer)",
"constructor": false,
... | {
"body": "@Override\n public void forEach(Accumulator<T> accumulator) throws StreamException {\n T n;\n while((n = next())!=null){\n accumulator.accumulate(n);\n }\n }",
"class_method_signature": "AbstractStream.forEach(Accumulator<T> accumulator)",
"constructor": false,
"... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_256 | {
"fields": [
{
"declarator": "config = new ConfigurationBuilder().build(new EmptyConfigurationDefaultsList().addConfig(new TestConfig()),\n new ReflectingConfigurationSource())",
"modifier": "private static final",
... | {
"body": "@Test(expected=StandardException.class)\n public void timesOutIfOneServerNeverResponds() throws Exception{\n final List<String> servers = Arrays.asList(\"server1\",\"server2\");\n final String changeId = \"change\";\n final TickingClock clock = new IncrementingClock(0);\n fin... | {
"fields": [
{
"declarator": "LOG = Logger.getLogger(AsynchronousDDLController.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Logger.getLogger(AsynchronousDDLController.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "@Override\n public String notifyMetadataChange(DDLChange change) throws StandardException {\n String changeId = communicator.createChangeNode(change);\n\n long availableTime =maximumWaitTime;\n long elapsedTime = 0;\n Collection<String> finishedServers =Collections.emptyList(... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_32 | {
"fields": [
{
"declarator": "bits24",
"modifier": "private",
"original_string": "private byte[] bits24;",
"type": "byte[]",
"var_name": "bits24"
},
{
"declarator": "bits24C",
"modifier": "private",
"original_string": "private byte[] bits24C;",
"type"... | {
"body": "@Test public void testAnySetBitBeyondBitNeg() {\n assertEquals(1, bitset18.anySetBit(0));\n assertEquals(0, bitset18.anySetBit(-1));\n try {\n bitset18.anySetBit(-2);\n fail();\n } catch (ArrayIndexOutOfBoundsException ignored) {\n }\n try {\n... | {
"fields": [
{
"declarator": "value",
"modifier": "private",
"original_string": "private byte[]\tvalue;",
"type": "byte[]",
"var_name": "value"
},
{
"declarator": "bitsInLastByte",
"modifier": "private",
"original_string": "private\tbyte\tbitsInLastByte;",
... | {
"body": "public int anySetBit() {\n\t\tif (SanityManager.DEBUG) {\n\t\t\tSanityManager.ASSERT(invariantHolds(), \"broken invariant\");\n\t\t}\n\t\tfinal int numbytes = getLengthInBytes();\n\t\tfor (int i = 0; i < numbytes; ++i) {\n\t\t\tfinal byte v = value[i];\n\t\t\tif (v == 0) continue;\n\t\t\treturn (umul8(i) +... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_104 | {
"fields": [],
"file": "splice_encoding/src/test/java/com/splicemachine/utils/ByteSliceTest.java",
"identifier": "ByteSliceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void byteSliceBufferTooSmall() {\n ByteSlice.wrap(new byte[]{0}, 0, 1);\n\n ByteSlice.wrap(new byte[]{0}, 1, 0);\n\n try {\n ByteSlice.wrap(new byte[] {0}, 1, 1);\n fail(\"Expected too small exception\");\n } catch (Throwable e) {\n ... | {
"fields": [
{
"declarator": "hashFunction = HashFunctions.murmur3(0)",
"modifier": "private static final",
"original_string": "private static final Hash32 hashFunction = HashFunctions.murmur3(0);",
"type": "Hash32",
"var_name": "hashFunction"
},
{
"declarator": "EMPTY... | {
"body": "public static ByteSlice wrap(ByteBuffer buffer){\n byte[] data = new byte[buffer.remaining()];\n buffer.get(data);\n return new ByteSlice(data,0,data.length);\n }",
"class_method_signature": "ByteSlice.wrap(ByteBuffer buffer)",
"constructor": false,
"full_signature": "public s... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_65 | {
"fields": [],
"file": "db-engine/src/test/java/com/splicemachine/db/iapi/stats/UniqueKeyStatisticsImplTest.java",
"identifier": "UniqueKeyStatisticsImplTest",
"interfaces": "",
"superclass": "extends AbstractKeyStatisticsImplTest"
} | {
"body": "@Test\n public void testNullBeginSelectivity() throws StandardException {\n Assert.assertEquals(6000.0d,(double) impl.rangeSelectivity(null,row6000,true,false),50.0d);\n }",
"class_method_signature": "UniqueKeyStatisticsImplTest.testNullBeginSelectivity()",
"constructor": false,
"full_si... | {
"fields": [
{
"declarator": "quantilesSketch",
"modifier": "private",
"original_string": "private ItemsSketch<ExecRow> quantilesSketch;",
"type": "ItemsSketch<ExecRow>",
"var_name": "quantilesSketch"
},
{
"declarator": "nullCount",
"modifier": "private",
"... | {
"body": "@Override\n public long rangeSelectivity(ExecRow start, ExecRow stop, boolean includeStart, boolean includeStop, boolean useExtrapolation) {\n double startSelectivity = start==null?0.0d:quantilesSketch.getCDF(new ExecRow[]{start})[0];\n double stopSelectivity = stop==null?1.0d:quantilesSke... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_153 | {
"fields": [
{
"declarator": "watermark = 1000",
"modifier": "private",
"original_string": "private long watermark = 1000;",
"type": "long",
"var_name": "watermark"
},
{
"declarator": "cutNoPurge = new SICompactionStateMutate(\n new PurgeConfigBuilder().noPu... | {
"body": "@Test\n public void mutateSimpleOneActiveTransaction() throws IOException {\n inputCells.addAll(Arrays.asList(\n SITestUtils.getMockValueCell(200),\n SITestUtils.getMockValueCell(100)));\n transactions.addAll(Arrays.asList(\n TxnTestUtils.getMoc... | {
"fields": [
{
"declarator": "LOG = Logger.getLogger(SICompactionStateMutate.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Logger.getLogger(SICompactionStateMutate.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "public long mutate(List<Cell> rawList, List<TxnView> txns, List<Cell> results) throws IOException {\n handleSanityChecks(results, rawList, txns);\n long totalSize = 0;\n try {\n Iterator<TxnView> it = txns.iterator();\n for (Cell cell : rawList) {\n ... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_73 | {
"fields": [],
"file": "db-engine/src/test/java/com/splicemachine/db/iapi/stats/PrimaryKeyStatisticsImplTest.java",
"identifier": "PrimaryKeyStatisticsImplTest",
"interfaces": "",
"superclass": "extends AbstractKeyStatisticsImplTest"
} | {
"body": "@Test\n public void testNullSelectivity() throws StandardException {\n Assert.assertEquals(1,impl.selectivity(null));\n }",
"class_method_signature": "PrimaryKeyStatisticsImplTest.testNullSelectivity()",
"constructor": false,
"full_signature": "@Test public void testNullSelectivity()",
... | {
"fields": [
{
"declarator": "quantilesSketch",
"modifier": "private",
"original_string": "private ItemsSketch<ExecRow> quantilesSketch;",
"type": "ItemsSketch<ExecRow>",
"var_name": "quantilesSketch"
},
{
"declarator": "nullCount",
"modifier": "private",
"... | {
"body": "@Override\n public long selectivity(ExecRow element) {\n return 1L;\n }",
"class_method_signature": "PrimaryKeyStatisticsImpl.selectivity(ExecRow element)",
"constructor": false,
"full_signature": "@Override public long selectivity(ExecRow element)",
"identifier": "selectivity",
"inv... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_145 | {
"fields": [
{
"declarator": "LOG = Logger.getLogger(StreamableRDDTest.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Logger.getLogger(StreamableRDDTest.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator":... | {
"body": "@Test\n public void testLimit() throws StandardException {\n StreamListener<ExecRow> sl = new StreamListener<>(400, 0);\n HostAndPort hostAndPort = server.getHostAndPort();\n server.register(sl);\n\n List<Tuple2<ExecRow,ExecRow>> manyRows = new ArrayList<>();\n for(int... | {
"fields": [
{
"declarator": "LOG = Logger.getLogger(StreamableRDD.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Logger.getLogger(StreamableRDD.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "DEFAUL... | {
"body": "public void submit() throws Exception {\n Exception error = null;\n try {\n final JavaRDD<String> streamed = rdd.mapPartitionsWithIndex(new ResultStreamer(context, uuid, host, port, rdd.getNumPartitions(), clientBatches, clientBatchSize), true);\n int numPartitions = str... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_283 | {
"fields": [
{
"declarator": "kp=new KryoPool(1)",
"modifier": "private static final",
"original_string": "private static final KryoPool kp=new KryoPool(1);",
"type": "KryoPool",
"var_name": "kp"
},
{
"declarator": "pef",
"modifier": "private",
"original_st... | {
"body": "@Test\n public void testCorrectlyRetriesWhenOneRegionStopsButReturnsResult() throws Exception{\n byte[] table=Bytes.toBytes(\"1424\");\n TxnView txn=new ActiveWriteTxn(1l,1l,Txn.ROOT_TRANSACTION,true,Txn.IsolationLevel.SNAPSHOT_ISOLATION);\n Collection<BulkWrite> bwList=new ArrayLis... | {
"fields": [
{
"declarator": "LOG=Logger.getLogger(BulkWriteAction.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG=Logger.getLogger(BulkWriteAction.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "RETRY_... | {
"body": "@Override\n public WriteStats call() throws Exception{\n statusReporter.numExecutingFlushes.incrementAndGet();\n reportSize();\n long start=System.currentTimeMillis();\n try{\n Timer totalTimer=metricFactory.newTimer();\n totalTimer.startTiming();\n ... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_24 | {
"fields": [
{
"declarator": "bits24",
"modifier": "private",
"original_string": "private byte[] bits24;",
"type": "byte[]",
"var_name": "bits24"
},
{
"declarator": "bits24C",
"modifier": "private",
"original_string": "private byte[] bits24C;",
"type"... | {
"body": "@Test public void testIsSet() {\n try {\n bitset18C.isSet(-8);\n fail();\n } catch (IllegalArgumentException ignored) {\n }\n\n try {\n bitset18C.isSet(-1);\n fail();\n } catch (IllegalArgumentException ignored) {\n }\n\n... | {
"fields": [
{
"declarator": "value",
"modifier": "private",
"original_string": "private byte[]\tvalue;",
"type": "byte[]",
"var_name": "value"
},
{
"declarator": "bitsInLastByte",
"modifier": "private",
"original_string": "private\tbyte\tbitsInLastByte;",
... | {
"body": "public final boolean isSet(int position)\n\t{\n\t\tcheckPosition(position);\n\t\tfinal int byteIndex = udiv8(position);\n\t\tfinal byte bitIndex = umod8(position);\n\t\treturn ((value[byteIndex] & (0x80>>bitIndex)) != 0);\n\t}",
"class_method_signature": "FormatableBitSet.isSet(int position)",
"constru... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_112 | {
"fields": [],
"file": "splice_encoding/src/test/java/com/splicemachine/utils/IntArraysTest.java",
"identifier": "IntArraysTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComplementMap6a() throws Exception {\n int[] expected = new int[] {0,1,2,3,5};\n int[] input = new int[] {4};\n int size = 6;\n\n int[] complement = IntArrays.complementMap(input,size);\n Assert.assertArrayEquals(printArrays(input,size,expected,... | {
"fields": [],
"file": "splice_encoding/src/main/java/com/splicemachine/utils/IntArrays.java",
"identifier": "IntArrays",
"interfaces": "",
"methods": [
{
"class_method_signature": "IntArrays.IntArrays()",
"constructor": true,
"full_signature": "private IntArrays()",
"identifier"... | {
"body": "public static int[] complementMap(int[] filterMap, int size) {\n // track columns we need to filter\n HashSet<Integer> columnsToFilter = new HashSet<Integer>(filterMap.length);\n // determine the number of columns to filter\n int numMissingFields = 0;\n for (int i=0; i<fi... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_4 | {
"fields": [
{
"declarator": "TYPENAME = \"VARCHAR\"",
"modifier": "private static final",
"original_string": "private static final String TYPENAME = \"VARCHAR\";",
"type": "String",
"var_name": "TYPENAME"
},
{
"declarator": "HEADER_LENGTH = 2",
"modifier": "priv... | {
"body": "@Test\n public void testSkipUntilEOFOnLongStreamCJK()\n throws IOException {\n final int charLength = 127019;\n InputStream in = new ReaderToUTF8Stream(\n new LoopingAlphabetReader(charLength, CharAlphabet.cjkSubset()),\n charLength, 0, TYPENAME, ne... | {
"fields": [],
"file": "db-engine/src/main/java/com/splicemachine/db/iapi/util/UTF8Util.java",
"identifier": "UTF8Util",
"interfaces": "",
"methods": [
{
"class_method_signature": "UTF8Util.UTF8Util()",
"constructor": true,
"full_signature": "private UTF8Util()",
"identifier": "U... | {
"body": "public static final long skipUntilEOF(InputStream in)\n throws IOException {\n // No need to do the skip in a loop, as Reader.read() returning -1\n // means EOF has been reached.\n // Note that a loop should be used if skip is used instead of read.\n return internalSk... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_165 | {
"fields": [
{
"declarator": "watermark = 1000",
"modifier": "private",
"original_string": "private long watermark = 1000;",
"type": "long",
"var_name": "watermark"
},
{
"declarator": "cutNoPurge = new SICompactionStateMutate(\n new PurgeConfigBuilder().noPu... | {
"body": "@Test\n public void mutatePurgeConsideringWatermark() throws IOException {\n inputCells.addAll(Arrays.asList(\n SITestUtils.getMockCommitCell(1100, 1110),\n SITestUtils.getMockCommitCell(300, 310),\n SITestUtils.getMockCommitCell(200, 210),\n ... | {
"fields": [
{
"declarator": "LOG = Logger.getLogger(SICompactionStateMutate.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Logger.getLogger(SICompactionStateMutate.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "public long mutate(List<Cell> rawList, List<TxnView> txns, List<Cell> results) throws IOException {\n handleSanityChecks(results, rawList, txns);\n long totalSize = 0;\n try {\n Iterator<TxnView> it = txns.iterator();\n for (Cell cell : rawList) {\n ... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_53 | {
"fields": [],
"file": "db-engine/src/test/java/com/splicemachine/db/iapi/types/SQLIntegerTest.java",
"identifier": "SQLIntegerTest",
"interfaces": "",
"superclass": "extends SQLDataValueDescriptorTest"
} | {
"body": "@Test\n public void addTwo() throws StandardException {\n SQLInteger integer1 = new SQLInteger(100);\n SQLInteger integer2 = new SQLInteger(100);\n Assert.assertEquals(\"Integer Add Fails\", 200, integer1.plus(integer1, integer2, null).getInt(),0);\n }",
"cl... | {
"fields": [
{
"declarator": "INTEGER_LENGTH\t\t= 4",
"modifier": "static final",
"original_string": "static final int INTEGER_LENGTH\t\t= 4;",
"type": "int",
"var_name": "INTEGER_LENGTH"
},
{
"declarator": "BASE_MEMORY_USAGE = ClassSize.estimateBaseFromCatalog( SQLInt... | {
"body": "public int\tgetInt()\n\t{\n\t\t/* This value is 0 if the SQLInteger is null */\n\t\treturn value;\n\t}",
"class_method_signature": "SQLInteger.getInt()",
"constructor": false,
"full_signature": "public int getInt()",
"identifier": "getInt",
"invocations": [],
"modifiers": "public",
"parameter... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_132 | {
"fields": [
{
"declarator": "REGION_NAME = \"NetherRegion\"",
"modifier": "private static final",
"original_string": "private static final String REGION_NAME = \"NetherRegion\";",
"type": "String",
"var_name": "REGION_NAME"
},
{
"declarator": "mockCtx",
"modifie... | {
"body": "@Test\n public void preStoreScannerOpen() throws Exception {\n MemstoreAwareObserver mao = new MemstoreAwareObserver();\n\n // create scan, call preStoreScannerOpen\n\n // env and scan share same start and end keys (partition hit)\n byte[] startKey = createByteArray(13);\n ... | {
"fields": [
{
"declarator": "LOG = Logger.getLogger(MemstoreAwareObserver.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Logger.getLogger(MemstoreAwareObserver.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"decl... | {
"body": "@Override\n public RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Scan scan, RegionScanner s) throws IOException {\n if (scan.getAttribute(MRConstants.SPLICE_SCAN_MEMSTORE_ONLY) != null &&\n Bytes.equals(scan.getAttribute(MRConstants.SPLICE_SCAN_MEMS... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_124 | {
"fields": [],
"file": "hbase_sql/src/test/java/com/splicemachine/orc/block/DoubleColumnBlockTest.java",
"identifier": "DoubleColumnBlockTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void setPartitionValueTest() {\n DoubleColumnBlock doubleColumnBlock = new DoubleColumnBlock(null, DataTypes.DoubleType);\n doubleColumnBlock.setPartitionValue(\"1.23\",1000);\n for (int i = 0; i< 1000; i++) {\n Assert.assertEquals(1.23d,doubleColumnBlock.g... | {
"fields": [],
"file": "hbase_sql/src/main/java/com/splicemachine/orc/block/DoubleColumnBlock.java",
"identifier": "DoubleColumnBlock",
"interfaces": "",
"methods": [
{
"class_method_signature": "DoubleColumnBlock.DoubleColumnBlock(ColumnVector columnVector, DataType type)",
"constructor": tr... | {
"body": "@Override\n public void setPartitionValue(String value, int size) {\n columnVector = ColumnVector.allocate(size, dataType, MemoryMode.ON_HEAP);\n columnVector.appendDoubles(size,Double.parseDouble(value));\n }",
"class_method_signature": "DoubleColumnBlock.setPartitionValue(String val... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_12 | {
"fields": [
{
"declarator": "TYPENAME = \"VARCHAR\"",
"modifier": "private static final",
"original_string": "private static final String TYPENAME = \"VARCHAR\";",
"type": "String",
"var_name": "TYPENAME"
},
{
"declarator": "HEADER_LENGTH = 2",
"modifier": "priv... | {
"body": "@Test\n public void testSkippingInvalidEncodingWorks()\n throws IOException {\n // The array contains three valid characters and one invalid three-byte\n // representation that only has two bytes present.\n // When skipping, this sequence is (incorrectly) taken as a seque... | {
"fields": [],
"file": "db-engine/src/main/java/com/splicemachine/db/iapi/util/UTF8Util.java",
"identifier": "UTF8Util",
"interfaces": "",
"methods": [
{
"class_method_signature": "UTF8Util.UTF8Util()",
"constructor": true,
"full_signature": "private UTF8Util()",
"identifier": "U... | {
"body": "public static final long skipFully(InputStream in, long charsToSkip)\n throws EOFException, IOException {\n SkipCount skipped = internalSkip(in, charsToSkip);\n if (skipped.charsSkipped() != charsToSkip) {\n throw new EOFException(\"Reached end-of-stream prematurely at \... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_173 | {
"fields": [
{
"declarator": "watermark = 1000",
"modifier": "private",
"original_string": "private long watermark = 1000;",
"type": "long",
"var_name": "watermark"
},
{
"declarator": "cutNoPurge = new SICompactionStateMutate(\n new PurgeConfigBuilder().noPu... | {
"body": "@Test\n public void mutatePurgeDuringMinorCompactionAntiTombstoneGhostsTombstone() throws IOException {\n inputCells.addAll(Arrays.asList(\n SITestUtils.getMockCommitCell(200, 210),\n SITestUtils.getMockCommitCell(100, 110),\n SITestUtils.getMockAntiTo... | {
"fields": [
{
"declarator": "LOG = Logger.getLogger(SICompactionStateMutate.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Logger.getLogger(SICompactionStateMutate.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "public long mutate(List<Cell> rawList, List<TxnView> txns, List<Cell> results) throws IOException {\n handleSanityChecks(results, rawList, txns);\n long totalSize = 0;\n try {\n Iterator<TxnView> it = txns.iterator();\n for (Cell cell : rawList) {\n ... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_45 | {
"fields": [],
"file": "db-engine/src/test/java/com/splicemachine/db/iapi/types/SQLLongIntTest.java",
"identifier": "SQLLongIntTest",
"interfaces": "",
"superclass": "extends SQLDataValueDescriptorTest"
} | {
"body": "@Test(expected = StandardException.class)\n public void testPositiveOverFlow() throws StandardException {\n SQLLongint long1 = new SQLLongint(Long.MAX_VALUE);\n SQLLongint long2 = new SQLLongint(1);\n long1.plus(long1,long2,null);\n }",
"class_method_signatu... | {
"fields": [
{
"declarator": "BASE_MEMORY_USAGE = ClassSize.estimateBaseFromCatalog( SQLLongint.class)",
"modifier": "private static final",
"original_string": "private static final int BASE_MEMORY_USAGE = ClassSize.estimateBaseFromCatalog( SQLLongint.class);",
"type": "int",
"var_n... | {
"body": "public NumberDataValue plus(NumberDataValue addend1,\n\t\t\t\t\t\t\tNumberDataValue addend2,\n\t\t\t\t\t\t\tNumberDataValue result)\n\t\t\t\tthrows StandardException\n\t{\n\t\tif (result == null)\n\t\t{\n\t\t\tresult = new SQLLongint();\n\t\t}\n\n\t\tif (addend1.isNull() || addend2.isNull())\n\t\t{\n\t\t\t... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_221 | {
"fields": [
{
"declarator": "DF = new SimpleDateFormat(\"yyyy/MM/dd\")",
"modifier": "private static final",
"original_string": "private static final DateFormat DF = new SimpleDateFormat(\"yyyy/MM/dd\");",
"type": "DateFormat",
"var_name": "DF"
},
{
"declarator": "DFT... | {
"body": "@Test\n public void testAddDays() {\n Calendar c = Calendar.getInstance();\n Date t = new Date(c.getTime().getTime());\n c.add(Calendar.DAY_OF_MONTH, 2);\n Date s = new Date(c.getTime().getTime());\n assertEquals(SpliceDateFunctions.ADD_DAYS(t, 2), s);\n }",
"clas... | {
"fields": [
{
"declarator": "WEEK_DAY_MAP = new ImmutableMap.Builder<String, Integer>()\n .put(\"sunday\", 1).put(\"monday\", 2).put(\"tuesday\", 3).put(\"wednesday\", 4).put(\"thursday\", 5)\n .put(\"friday\", 6).put(\"saturday\", 7).build()",
"modifier": "private static final... | {
"body": "public static Date ADD_DAYS(Date source, Integer numOfDays) {\n if (source == null || numOfDays == null) return null;\n DateTime dt = new DateTime(source);\n return new Date(dt.plusDays(numOfDays).getMillis());\n }",
"class_method_signature": "SpliceDateFunctions.ADD_DAYS(Date sou... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_108 | {
"fields": [],
"file": "splice_encoding/src/test/java/com/splicemachine/utils/IntArraysTest.java",
"identifier": "IntArraysTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComplementMap3() throws Exception {\n int[] expected = new int[] {};\n int[] input = new int[] {0,1,2,3,4,5};\n int size = expected.length + input.length;\n\n int[] complement = IntArrays.complementMap(input,size);\n Assert.assertArrayEquals(pri... | {
"fields": [],
"file": "splice_encoding/src/main/java/com/splicemachine/utils/IntArrays.java",
"identifier": "IntArrays",
"interfaces": "",
"methods": [
{
"class_method_signature": "IntArrays.IntArrays()",
"constructor": true,
"full_signature": "private IntArrays()",
"identifier"... | {
"body": "public static int[] complementMap(int[] filterMap, int size) {\n // track columns we need to filter\n HashSet<Integer> columnsToFilter = new HashSet<Integer>(filterMap.length);\n // determine the number of columns to filter\n int numMissingFields = 0;\n for (int i=0; i<fi... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_276 | {
"fields": [],
"file": "pipeline_api/src/test/java/com/splicemachine/pipeline/constraint/ConstraintContextTest.java",
"identifier": "ConstraintContextTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void withInsertedMessage() {\n // given\n ConstraintContext context1 = new ConstraintContext(\"aa\", \"bb\", \"cc\");\n // when\n ConstraintContext context2 = context1.withInsertedMessage(0, \"ZZ\");\n ConstraintContext context3 = context1.withInsertedMe... | {
"fields": [
{
"declarator": "messageArgs",
"modifier": "private",
"original_string": "private String[] messageArgs;",
"type": "String[]",
"var_name": "messageArgs"
}
],
"file": "pipeline_api/src/main/java/com/splicemachine/pipeline/constraint/ConstraintContext.java",
"ide... | {
"body": "public ConstraintContext withInsertedMessage(int index, String newMessage) {\n return new ConstraintContext((String[]) ArrayUtils.add(messageArgs,index,newMessage));\n }",
"class_method_signature": "ConstraintContext.withInsertedMessage(int index, String newMessage)",
"constructor": false,
... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_69 | {
"fields": [],
"file": "db-engine/src/test/java/com/splicemachine/db/iapi/stats/PrimaryKeyStatisticsImplTest.java",
"identifier": "PrimaryKeyStatisticsImplTest",
"interfaces": "",
"superclass": "extends AbstractKeyStatisticsImplTest"
} | {
"body": "@Test\n public void testNotNullCount() throws StandardException {\n Assert.assertEquals(10000,impl.notNullCount());\n }",
"class_method_signature": "PrimaryKeyStatisticsImplTest.testNotNullCount()",
"constructor": false,
"full_signature": "@Test public void testNotNullCount()",
"identi... | {
"fields": [
{
"declarator": "quantilesSketch",
"modifier": "private",
"original_string": "private ItemsSketch<ExecRow> quantilesSketch;",
"type": "ItemsSketch<ExecRow>",
"var_name": "quantilesSketch"
},
{
"declarator": "nullCount",
"modifier": "private",
"... | {
"body": "@Override\n public long notNullCount() {\n return quantilesSketch.getN();\n }",
"class_method_signature": "PrimaryKeyStatisticsImpl.notNullCount()",
"constructor": false,
"full_signature": "@Override public long notNullCount()",
"identifier": "notNullCount",
"invocations": [
"get... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_86 | {
"fields": [],
"file": "db-engine/src/test/java/com/splicemachine/db/iapi/stats/NonUniqueKeyStatisticsImplTest.java",
"identifier": "NonUniqueKeyStatisticsImplTest",
"interfaces": "",
"superclass": "extends AbstractKeyStatisticsImplTest"
} | {
"body": "@Test\n public void testEmptySelectivity() throws StandardException {\n Assert.assertEquals(1,impl.selectivity(new ValueRow(3)));\n }",
"class_method_signature": "NonUniqueKeyStatisticsImplTest.testEmptySelectivity()",
"constructor": false,
"full_signature": "@Test public void testEmptyS... | {
"fields": [
{
"declarator": "quantilesSketch",
"modifier": "private",
"original_string": "private ItemsSketch<ExecRow> quantilesSketch;",
"type": "ItemsSketch<ExecRow>",
"var_name": "quantilesSketch"
},
{
"declarator": "frequenciesSketch",
"modifier": "private",... | {
"body": "@Override\n public long selectivity(ExecRow element) {\n // Frequent Items\n long count = frequenciesSketch.getEstimate(element);\n if (count>0)\n return count;\n // Return Cardinality\n return (long) (quantilesSketch.getN()/thetaSketch.getEstimate()); // Sh... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_260 | {
"fields": [],
"file": "splice_machine/src/test/java/com/splicemachine/derby/impl/sql/execute/sequence/AbstractSequenceTest.java",
"identifier": "AbstractSequenceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void singleThreaded100BlockSingleIncrementTestWithRollover() throws Exception {\n\t\tSequence sequence = new SpliceTestSequence(100,1,0);\n\t\tfor (long i = 0; i< 1000; i++) {\n\t\t\tlong next = sequence.getNext();\n\t\t\tAssert.assertTrue(i==next);\n\t\t}\n\t}",
"class_method_signature":... | {
"fields": [
{
"declarator": "remaining=new AtomicLong(0l)",
"modifier": "protected final",
"original_string": "protected final AtomicLong remaining=new AtomicLong(0l);",
"type": "AtomicLong",
"var_name": "remaining"
},
{
"declarator": "currPosition=new AtomicLong(0l)"... | {
"body": "public long getNext() throws StandardException{\n if(remaining.getAndDecrement()<=0)\n allocateBlock(false);\n return currPosition.getAndAdd(incrementSteps);\n }",
"class_method_signature": "AbstractSequence.getNext()",
"constructor": false,
"full_signature": "public long ... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_90 | {
"fields": [],
"file": "db-engine/src/test/java/com/splicemachine/db/iapi/stats/NonUniqueKeyStatisticsImplTest.java",
"identifier": "NonUniqueKeyStatisticsImplTest",
"interfaces": "",
"superclass": "extends AbstractKeyStatisticsImplTest"
} | {
"body": "@Test\n public void testNullEndSelectivity() throws StandardException {\n Assert.assertEquals(8000.0d,(double) impl.rangeSelectivity(row2000,null,true,false),50.0d);\n }",
"class_method_signature": "NonUniqueKeyStatisticsImplTest.testNullEndSelectivity()",
"constructor": false,
"full_sig... | {
"fields": [
{
"declarator": "quantilesSketch",
"modifier": "private",
"original_string": "private ItemsSketch<ExecRow> quantilesSketch;",
"type": "ItemsSketch<ExecRow>",
"var_name": "quantilesSketch"
},
{
"declarator": "frequenciesSketch",
"modifier": "private",... | {
"body": "@Override\n public long rangeSelectivity(ExecRow start, ExecRow stop, boolean includeStart, boolean includeStop, boolean useExtrapolation) {\n double startSelectivity = start==null?0.0d:quantilesSketch.getCDF(new ExecRow[]{start})[0];\n double stopSelectivity = stop==null?1.0d:quantilesSke... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_149 | {
"fields": [],
"file": "hbase_storage/src/test/java/com/splicemachine/access/client/MemstoreKeyValueScannerTest.java",
"identifier": "MemstoreKeyValueScannerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExistingResultsAreOrdered() throws IOException {\n ResultScanner rs = generateResultScanner(SITestUtils.getMockTombstoneCell(10));\n\n MemstoreKeyValueScanner mkvs = new MemstoreKeyValueScanner(rs);\n\n List<Cell> results = new ArrayList<>();\n results... | {
"fields": [
{
"declarator": "LOG=Logger.getLogger(MemstoreKeyValueScanner.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOG=Logger.getLogger(MemstoreKeyValueScanner.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "@Override\n public KeyValue next() throws IOException{\n KeyValue returnValue=peakKeyValue;\n if(currentResult!=null && advance())\n peakKeyValue=(KeyValue)current();\n else{\n nextResult();\n returnValue=peakKeyValue;\n }\n return retu... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_237 | {
"fields": [
{
"declarator": "DF = new SimpleDateFormat(\"yyyy/MM/dd\")",
"modifier": "private static final",
"original_string": "private static final DateFormat DF = new SimpleDateFormat(\"yyyy/MM/dd\");",
"type": "DateFormat",
"var_name": "DF"
},
{
"declarator": "DFT... | {
"body": "@Test\n public void toTimestampISO8601Pattern() throws Exception {\n String format = \"yyyy-MM-dd'T'HH:mm:ssz\";\n String source = \"2011-09-17T23:40:53EDT\";\n DateFormat formatter = new SimpleDateFormat(format);\n Timestamp date = new Timestamp(formatter.parse(source).getTi... | {
"fields": [
{
"declarator": "WEEK_DAY_MAP = new ImmutableMap.Builder<String, Integer>()\n .put(\"sunday\", 1).put(\"monday\", 2).put(\"tuesday\", 3).put(\"wednesday\", 4).put(\"thursday\", 5)\n .put(\"friday\", 6).put(\"saturday\", 7).build()",
"modifier": "private static final... | {
"body": "public static Timestamp TO_TIMESTAMP(String source) throws SQLException {\n return TO_TIMESTAMP(source,null);\n }",
"class_method_signature": "SpliceDateFunctions.TO_TIMESTAMP(String source)",
"constructor": false,
"full_signature": "public static Timestamp TO_TIMESTAMP(String source)",
"... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_8 | {
"fields": [
{
"declarator": "TYPENAME = \"VARCHAR\"",
"modifier": "private static final",
"original_string": "private static final String TYPENAME = \"VARCHAR\";",
"type": "String",
"var_name": "TYPENAME"
},
{
"declarator": "HEADER_LENGTH = 2",
"modifier": "priv... | {
"body": "@Test\n public void testMissingSecondByteOfTwo()\n throws IOException {\n // 0xdf = 11011111\n byte[] data = {'a', (byte)0xdf};\n InputStream is = new ByteArrayInputStream(data);\n try {\n UTF8Util.skipFully(is, 2);\n TestCase.fail(\"Reading i... | {
"fields": [],
"file": "db-engine/src/main/java/com/splicemachine/db/iapi/util/UTF8Util.java",
"identifier": "UTF8Util",
"interfaces": "",
"methods": [
{
"class_method_signature": "UTF8Util.UTF8Util()",
"constructor": true,
"full_signature": "private UTF8Util()",
"identifier": "U... | {
"body": "public static final long skipFully(InputStream in, long charsToSkip)\n throws EOFException, IOException {\n SkipCount skipped = internalSkip(in, charsToSkip);\n if (skipped.charsSkipped() != charsToSkip) {\n throw new EOFException(\"Reached end-of-stream prematurely at \... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
8582237_28 | {
"fields": [
{
"declarator": "bits24",
"modifier": "private",
"original_string": "private byte[] bits24;",
"type": "byte[]",
"var_name": "bits24"
},
{
"declarator": "bits24C",
"modifier": "private",
"original_string": "private byte[] bits24C;",
"type"... | {
"body": "@Test public void testClear() {\n try {\n bitset18.clear(-8);\n fail();\n } catch (IllegalArgumentException ignored) {\n }\n try {\n bitset18.clear(-1);\n fail();\n } catch (IllegalArgumentException ignored) {\n }\n ... | {
"fields": [
{
"declarator": "value",
"modifier": "private",
"original_string": "private byte[]\tvalue;",
"type": "byte[]",
"var_name": "value"
},
{
"declarator": "bitsInLastByte",
"modifier": "private",
"original_string": "private\tbyte\tbitsInLastByte;",
... | {
"body": "public void clear(int position)\n\t{\n\t\tcheckPosition(position);\n\t\tfinal int byteIndex = udiv8(position);\n\t\tfinal byte bitIndex = umod8(position);\n\t\tvalue[byteIndex] &= ~(0x80>>bitIndex);\n\t}",
"class_method_signature": "FormatableBitSet.clear(int position)",
"constructor": false,
"full_s... | {
"created": "3/5/2013 3:07:56 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 8582237,
"size": null,
"stargazer_count": null,
"stars": 128,
"updates": "2020-01-23T21:06:43+00:00",
"url": "https://github.com/splicemachine/spli... |
832679_68 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/command/RunScriptCommandTest.java",
"identifier": "RunScriptCommandTest",
"interfaces": "",
"superclass": "extends BaseCommandTest"
} | {
"body": "@Test\n public void testScriptPathIsMandatory() throws Exception {\n RunScriptCommand command = new RunScriptCommand();\n\n int rc = command.run(null, out, err, Lists.<String>newArrayList());\n assertThat(rc, is(-1));\n\n assertThat(errBytes.toString(),\n containsString(\"Please specify a... | {
"fields": [
{
"declarator": "rolesOption = parser\n .accepts(\"roles\", \"List of comma separated role names. \" +\n \"E.g. zookeeper,hadoop-namenode\")\n .withRequiredArg()\n .ofType(String.class)",
"modifier": "private",
"original_string": "private OptionSpec<String> rolesOptio... | {
"body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n\n OptionSet optionSet = parser.parse(args.toArray(new String[0]));\n if (!optionSet.has(scriptOption)) {\n err.println(\"Please specify a script file to be exec... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_29 | {
"fields": [
{
"declarator": "NGINX_JSON = \"{\\\"run_list\\\":[\\\"recipe[nginx]\\\"]}\"",
"modifier": "private static final",
"original_string": "private static final String NGINX_JSON = \"{\\\"run_list\\\":[\\\"recipe[nginx]\\\"]}\";",
"type": "String",
"var_name": "NGINX_JSON"
... | {
"body": "@Test\n public void testJSONConversionWithSpecificRecipe() {\n\n Recipe postgresql = new Recipe(\"postgresql\", \"server\");\n\n assertEquals(\"JSON representation is incorrect.\", POSTGRES_JSON,\n postgresql.toJSON());\n\n }",
"class_method_signature": "RecipeTest.testJSONConversionWithSp... | {
"fields": [
{
"declarator": "cookbook",
"modifier": "public final",
"original_string": "public final String cookbook;",
"type": "String",
"var_name": "cookbook"
},
{
"declarator": "recipe",
"modifier": "public final",
"original_string": "public final Strin... | {
"body": "public String toJSON() {\n Gson gson = new Gson();\n JsonObject recipeAsJSON = new JsonObject();\n\n if (!attribs.isEmpty()) {\n JsonObject jsonAttribs = new JsonObject();\n for (Map.Entry<String, Object> entry : attribs.entrySet()) {\n jsonAttribs.add(entry.getKey(), gson.toJsonT... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_1 | {
"fields": [
{
"declarator": "NGINX_PUPPET = \"class { 'nginx':\\n}\"",
"modifier": "private static final",
"original_string": "private static final String NGINX_PUPPET = \"class { 'nginx':\\n}\";",
"type": "String",
"var_name": "NGINX_PUPPET"
},
{
"declarator": "POSTG... | {
"body": "@Test\n public void testPuppetConversionWithSpecificClass() {\n\n Manifest postgresql = new Manifest(\"postgresql\", \"server\");\n\n assertEquals(\"PUPPET representation is incorrect.\", POSTGRES_PUPPET,\n postgresql.toString());\n\n }",
"class_method_signature": "ManifestTest.testPuppetConve... | {
"fields": [
{
"declarator": "module",
"modifier": "public final",
"original_string": "public final String module;",
"type": "String",
"var_name": "module"
},
{
"declarator": "className",
"modifier": "public final",
"original_string": "public final String c... | {
"body": "public String toString() {\n StringBuilder resource = new StringBuilder();\n for (String s : toStringList()) {\n if (resource.length() > 0)\n resource.append(\"\\n\");\n resource.append(s);\n }\n return resource.toString();\n }",
"class_method_signature": "Manifest.toString(... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_52 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/command/AbstractClusterCommandTest.java",
"identifier": "AbstractClusterCommandTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateServerWithInvalidClusterControllerName() throws Exception {\n AbstractClusterCommand clusterCommand = new AbstractClusterCommand(\"name\",\n \"description\", new ClusterControllerFactory()) {\n @Override\n public int run(InputStream in, PrintStream out, Pr... | {
"fields": [
{
"declarator": "LOG =\n LoggerFactory.getLogger(AbstractClusterCommand.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(AbstractClusterCommand.class);",
"type": "Logger",
"var_name": "LOG... | {
"body": "protected ClusterController createClusterController(String serviceName) {\n ClusterController controller = factory.create(serviceName);\n if (controller == null) {\n LOG.warn(\"Unable to find service {}, using default.\", serviceName);\n controller = factory.create(null);\n }\n return... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_44 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/ClusterSpecTest.java",
"identifier": "ClusterSpecTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testFailIfRunningAsRootOrClusterUserIsRoot() throws ConfigurationException {\n PropertiesConfiguration conf = new PropertiesConfiguration(\"whirr-core-test.properties\");\n conf.setProperty(\"whirr.cluster-user\", \"root\");\n\n Clust... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ClusterSpec.class)",
"modifier": "static final",
"original_string": "static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "DEFAULT_PROP... | {
"body": "@VisibleForTesting\n public static ClusterSpec withNoDefaults() throws ConfigurationException {\n return withNoDefaults(new PropertiesConfiguration());\n }",
"class_method_signature": "ClusterSpec.withNoDefaults()",
"constructor": false,
"full_signature": "@VisibleForTesting public static Cluste... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_13 | {
"fields": [],
"file": "services/puppet/src/test/java/org/apache/whirr/service/puppet/PuppetClusterActionHandlerFactoryTest.java",
"identifier": "PuppetClusterActionHandlerFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPuppetFactoryIsRegisteredAndWorksWithModules() {\n assertEquals(new HandlerMapFactory().create().getUnchecked(\"puppet:nginx\"), new PuppetClusterActionHandler(\"nginx\"));\n }",
"class_method_signature": "PuppetClusterActionHandlerFactoryTest.testPuppetFactoryIsRegisteredAnd... | {
"fields": [],
"file": "services/puppet/src/main/java/org/apache/whirr/service/puppet/PuppetClusterActionHandlerFactory.java",
"identifier": "PuppetClusterActionHandlerFactory",
"interfaces": "",
"methods": [
{
"class_method_signature": "PuppetClusterActionHandlerFactory.getRolePrefix()",
"co... | {
"body": "@Override\n public ClusterActionHandler create(String roleName) {\n return new PuppetClusterActionHandler(checkNotNull(roleName, \"roleName\"));\n }",
"class_method_signature": "PuppetClusterActionHandlerFactory.create(String roleName)",
"constructor": false,
"full_signature": "@Override public ... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_64 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/command/LaunchClusterCommandTest.java",
"identifier": "LaunchClusterCommandTest",
"interfaces": "",
"superclass": "extends BaseCommandTest"
} | {
"body": "@Test\n public void testInsufficientArgs() throws Exception {\n LaunchClusterCommand command = new LaunchClusterCommand();\n Map<String, File> keys = KeyPair.generateTemporaryFiles();\n int rc = command.run(null, null, err, Lists.<String>newArrayList(\n \"--private-key-file\", keys.get(\"p... | {
"fields": [],
"file": "cli/src/main/java/org/apache/whirr/cli/command/LaunchClusterCommand.java",
"identifier": "LaunchClusterCommand",
"interfaces": "",
"methods": [
{
"class_method_signature": "LaunchClusterCommand.LaunchClusterCommand()",
"constructor": true,
"full_signature": "publ... | {
"body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n OptionSet optionSet = parser.parse(args.toArray(new String[args.size()]));\n\n if (!optionSet.nonOptionArguments().isEmpty()) {\n printUsage(err);\n return... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_33 | {
"fields": [
{
"declarator": "EXPECTED_SSH_COMMAND = \"\\nYou can log into instances using the following ssh commands:\\n\"\n + \"[test-role]: ssh -i /test/key/path -o \\\"UserKnownHostsFile /dev/null\\\" -o StrictHostKeyChecking=no test-identity@test-public-ip\\n\"",
"modifier": "public static ... | {
"body": "@Test\n public void testPrintAccess() {\n final Instance instance = mock(Instance.class);\n\n when(instance.getPublicIp()).thenReturn(\"test-public-ip\");\n when(instance.getRoles()).thenReturn(ImmutableSet.of(\"test-role\"));\n\n Cluster cluster = mock(Cluster.class);\n\n when(cluster.getI... | {
"fields": [],
"file": "core/src/main/java/org/apache/whirr/util/Utils.java",
"identifier": "Utils",
"interfaces": "",
"methods": [
{
"class_method_signature": "Utils.convertMapToLoadingCache(Map<K, V> in)",
"constructor": false,
"full_signature": "public static LoadingCache<K, V> conve... | {
"body": "public static void printSSHConnectionDetails(PrintStream out, ClusterSpec clusterSpec,\n Cluster cluster, int maxPrint) {\n out.println(\"\\nYou can log into instances using the following ssh commands:\");\n\n String user = clusterSpec.getClusterUser() != null ? clusterSpec\n .getClusterUse... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_25 | {
"fields": [
{
"declarator": "defaults",
"modifier": "private",
"original_string": "private Configuration defaults;",
"type": "Configuration",
"var_name": "defaults"
},
{
"declarator": "clusterSpec",
"modifier": "private",
"original_string": "private Cluste... | {
"body": "@Test\n public void testOverridesNumberOfReducers() throws Exception {\n Configuration overrides = new PropertiesConfiguration();\n overrides.addProperty(\"hadoop-mapreduce.mapred.reduce.tasks\", \"7\");\n clusterSpec = ClusterSpec.withNoDefaults(overrides);\n Configuration conf = HadoopConfig... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class);",
"type": "Logger",
"var_name": "LOG"
... | {
"body": "@VisibleForTesting\n static Configuration buildMapReduceConfiguration(ClusterSpec clusterSpec,\n Cluster cluster, Configuration defaults, Set<String> dataDirectories) throws ConfigurationException, IOException {\n Configuration config = build(clusterSpec, cluster, defaults,\n \"hadoop-mapre... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_72 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/command/DestroyClusterCommandTest.java",
"identifier": "DestroyClusterCommandTest",
"interfaces": "",
"superclass": "extends BaseCommandTest"
} | {
"body": "@Test\n public void testAllOptions() throws Exception {\n \n ClusterControllerFactory factory = mock(ClusterControllerFactory.class);\n ClusterController controller = mock(ClusterController.class);\n when(factory.create((String) any())).thenReturn(controller);\n \n DestroyClusterCommand ... | {
"fields": [],
"file": "cli/src/main/java/org/apache/whirr/cli/command/DestroyClusterCommand.java",
"identifier": "DestroyClusterCommand",
"interfaces": "",
"methods": [
{
"class_method_signature": "DestroyClusterCommand.DestroyClusterCommand()",
"constructor": true,
"full_signature": "... | {
"body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n\n OptionSet optionSet = parser.parse(args.toArray(new String[args.size()]));\n\n if (!optionSet.nonOptionArguments().isEmpty()) {\n printUsage(err);\n retu... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_48 | {
"fields": [
{
"declarator": "NL = System.getProperty(\"line.separator\")",
"modifier": "private static final",
"original_string": "private static final String NL = System.getProperty(\"line.separator\");",
"type": "String",
"var_name": "NL"
}
],
"file": "core/src/test/java/... | {
"body": "@Test\n public void testAbsolutePath() throws IOException {\n assertThat(\n new RunUrlStatement(false, \"http://example.org/\", \"http://example2.org/a/b\")\n .render(OsFamily.UNIX),\n is(\"runurl http://example2.org/a/b\" + NL));\n }",
"class_method_signature": "RunUrlStateme... | {
"fields": [
{
"declarator": "LOG =\n LoggerFactory.getLogger(RunUrlStatement.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(RunUrlStatement.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "@Override\n public String render(OsFamily family) {\n StringBuilder command = new StringBuilder(\"runurl \");\n command.append(runUrl);\n if (!args.isEmpty()) {\n command.append(' ');\n command.append(Joiner.on(' ').join(args));\n }\n return Statements.exec(command.toString()).ren... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_49 | {
"fields": [
{
"declarator": "NL = System.getProperty(\"line.separator\")",
"modifier": "private static final",
"original_string": "private static final String NL = System.getProperty(\"line.separator\");",
"type": "String",
"var_name": "NL"
}
],
"file": "core/src/test/java/... | {
"body": "@Test\n public void testCheckUrlExists() throws IOException {\n RunUrlStatement.checkUrlExists(new URL(\"http://whirr.apache.org/\"),\n \"Exists\");\n }",
"class_method_signature": "RunUrlStatementTest.testCheckUrlExists()",
"constructor": false,
"full_signature": "@Test public void testC... | {
"fields": [
{
"declarator": "LOG =\n LoggerFactory.getLogger(RunUrlStatement.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(RunUrlStatement.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "public static void checkUrlExists(URL url, String errorMessageTemplate,\n Object... errorMessageArgs)\n throws IOException {\n if (!urlExists(url)) {\n throw new IllegalArgumentException(\n String.format(errorMessageTemplate, errorMessageArgs));\n }\n }",
"class_method_sign... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_73 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/command/VersionCommandTest.java",
"identifier": "VersionCommandTest",
"interfaces": "",
"superclass": "extends BaseCommandTest"
} | {
"body": "@Test\n public void testOverrides() throws Exception {\n VersionCommand command = new VersionCommand();\n int rc = command.run(null, out, null, Collections.<String>emptyList());\n assertThat(rc, is(0));\n assertThat(outBytes.toString(), startsWith(\"Apache Whirr \"));\n assertThat(outBytes.... | {
"fields": [],
"file": "cli/src/main/java/org/apache/whirr/cli/command/VersionCommand.java",
"identifier": "VersionCommand",
"interfaces": "",
"methods": [
{
"class_method_signature": "VersionCommand.VersionCommand()",
"constructor": true,
"full_signature": "public VersionCommand()",
... | {
"body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n InputStream input = getClass().getResourceAsStream(\"/version-banner.txt\");\n if (input == null) {\n err.printf(\"Cannot determine version number\\n\");\n return -1;... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_24 | {
"fields": [
{
"declarator": "defaults",
"modifier": "private",
"original_string": "private Configuration defaults;",
"type": "Configuration",
"var_name": "defaults"
},
{
"declarator": "clusterSpec",
"modifier": "private",
"original_string": "private Cluste... | {
"body": "@Test\n public void testOverridesNumberOfMappers() throws Exception {\n Configuration overrides = new PropertiesConfiguration();\n overrides.addProperty(\"hadoop-mapreduce.mapred.tasktracker.map.tasks.maximum\", \"70\");\n clusterSpec = ClusterSpec.withNoDefaults(overrides);\n Configuration co... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class);",
"type": "Logger",
"var_name": "LOG"
... | {
"body": "@VisibleForTesting\n static Configuration buildMapReduceConfiguration(ClusterSpec clusterSpec,\n Cluster cluster, Configuration defaults, Set<String> dataDirectories) throws ConfigurationException, IOException {\n Configuration config = build(clusterSpec, cluster, defaults,\n \"hadoop-mapre... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_32 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/util/KeyPairTest.java",
"identifier": "KeyPairTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGenerate() throws JSchException {\n Map<String, String> pair = generate();\n assertThat(pair.get(\"public\"),\n containsString(\"ssh-rsa \"));\n assertThat(pair.get(\"private\"),\n containsString(\"-----BEGIN RSA PRIVATE KEY-----\\n\"));\n }",
"class_met... | {
"fields": [
{
"declarator": "LOG =\n LoggerFactory.getLogger(KeyPair.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(KeyPair.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "core/s... | {
"body": "public static Map<String, String> generate() throws JSchException {\n return generate(null);\n }",
"class_method_signature": "KeyPair.generate()",
"constructor": false,
"full_signature": "public static Map<String, String> generate()",
"identifier": "generate",
"invocations": [
"generate... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_65 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/command/LaunchClusterCommandTest.java",
"identifier": "LaunchClusterCommandTest",
"interfaces": "",
"superclass": "extends BaseCommandTest"
} | {
"body": "@Test\n public void testAllOptions() throws Exception {\n \n ClusterControllerFactory factory = mock(ClusterControllerFactory.class);\n ClusterController controller = mock(ClusterController.class);\n Cluster cluster = mock(Cluster.class);\n when(factory.create((String) any())).thenReturn(co... | {
"fields": [],
"file": "cli/src/main/java/org/apache/whirr/cli/command/LaunchClusterCommand.java",
"identifier": "LaunchClusterCommand",
"interfaces": "",
"methods": [
{
"class_method_signature": "LaunchClusterCommand.LaunchClusterCommand()",
"constructor": true,
"full_signature": "publ... | {
"body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n OptionSet optionSet = parser.parse(args.toArray(new String[args.size()]));\n\n if (!optionSet.nonOptionArguments().isEmpty()) {\n printUsage(err);\n return... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_12 | {
"fields": [
{
"declarator": "getStatement = new InstallAllModulesStatementFromProperties(\n new StatementToInstallModule(new PrepareRemoteFileUrl() {\n\n @Override\n public String apply(String rawUrl) throws IOException {\n return rawUrl;\n }\n\n }))",
... | {
"body": "@Test\n public void testWhenMultiple() {\n\n assertEquals(\"git clone git://github.com/puppetlabs/puppetlabs-nginx.git /etc/puppet/modules/nginx\\n\"\n + \"git clone git://github.com/puppetlabs/puppetlabs-http.git /etc/puppet/modules/http\\n\", getStatement\n .apply(\n ... | {
"fields": [
{
"declarator": "statementMaker",
"modifier": "private final",
"original_string": "private final StatementToInstallModule statementMaker;",
"type": "StatementToInstallModule",
"var_name": "statementMaker"
}
],
"file": "services/puppet/src/main/java/org/apache/wh... | {
"body": "@Override\n public Statement apply(Map<String, String> moduleProps) {\n Set<String> allModules = ImmutableSet.copyOf(transform(\n filter(moduleProps.keySet(), contains(MODULE_KEY_PATTERN)), KeyToModuleNameOrNull.INSTANCE));\n\n Builder<Statement> statements = ImmutableSet.<Stateme... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_45 | {
"fields": [
{
"declarator": "NL = System.getProperty(\"line.separator\")",
"modifier": "private static final",
"original_string": "private static final String NL = System.getProperty(\"line.separator\");",
"type": "String",
"var_name": "NL"
}
],
"file": "core/src/test/java/... | {
"body": "@Test\n public void testBaseWithTrailingSlash() throws IOException {\n assertThat(\n new RunUrlStatement(false, \"http://example.org/\", \"a/b\").render(OsFamily.UNIX),\n is(\"runurl http://example.org/a/b\" + NL));\n }",
"class_method_signature": "RunUrlStatementTest.testBaseWithTrail... | {
"fields": [
{
"declarator": "LOG =\n LoggerFactory.getLogger(RunUrlStatement.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG =\n LoggerFactory.getLogger(RunUrlStatement.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "@Override\n public String render(OsFamily family) {\n StringBuilder command = new StringBuilder(\"runurl \");\n command.append(runUrl);\n if (!args.isEmpty()) {\n command.append(' ');\n command.append(Joiner.on(' ').join(args));\n }\n return Statements.exec(command.toString()).ren... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_53 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private",
"original_string": "private Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "NUMBER_OF_INSTANCES = 5",
"modifier": "private static final",
"original_string": "priv... | {
"body": "@Test\n public void getInstanceById() {\n Cluster.Instance instance = cluster.getInstanceMatching(withIds(\"id-0\"));\n assertThat(instance.getRoles().contains(\"role-0\"), is(true));\n }",
"class_method_signature": "ClusterTest.getInstanceById()",
"constructor": false,
"full_signature": "@Te... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(Cluster.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(Cluster.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "inst... | {
"body": "public Instance getInstanceMatching(Predicate<Instance> predicate) {\n return Iterables.getOnlyElement(Sets.filter(instances, predicate));\n }",
"class_method_signature": "Cluster.getInstanceMatching(Predicate<Instance> predicate)",
"constructor": false,
"full_signature": "public Instance getInst... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_0 | {
"fields": [
{
"declarator": "NGINX_PUPPET = \"class { 'nginx':\\n}\"",
"modifier": "private static final",
"original_string": "private static final String NGINX_PUPPET = \"class { 'nginx':\\n}\";",
"type": "String",
"var_name": "NGINX_PUPPET"
},
{
"declarator": "POSTG... | {
"body": "@Test\n public void testPuppetConversion() {\n\n Manifest nginx = new Manifest(\"nginx\", null);\n\n assertEquals(\"Puppet representation is incorrect.\", NGINX_PUPPET,\n nginx.toString());\n }",
"class_method_signature": "ManifestTest.testPuppetConversion()",
"constructor": false,
"full_s... | {
"fields": [
{
"declarator": "module",
"modifier": "public final",
"original_string": "public final String module;",
"type": "String",
"var_name": "module"
},
{
"declarator": "className",
"modifier": "public final",
"original_string": "public final String c... | {
"body": "public String toString() {\n StringBuilder resource = new StringBuilder();\n for (String s : toStringList()) {\n if (resource.length() > 0)\n resource.append(\"\\n\");\n resource.append(s);\n }\n return resource.toString();\n }",
"class_method_signature": "Manifest.toString(... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_28 | {
"fields": [
{
"declarator": "NGINX_JSON = \"{\\\"run_list\\\":[\\\"recipe[nginx]\\\"]}\"",
"modifier": "private static final",
"original_string": "private static final String NGINX_JSON = \"{\\\"run_list\\\":[\\\"recipe[nginx]\\\"]}\";",
"type": "String",
"var_name": "NGINX_JSON"
... | {
"body": "@Test\n public void testJSONConversion() {\n\n Recipe nginx = new Recipe(\"nginx\");\n\n assertEquals(\"JSON representation is incorrect.\", NGINX_JSON,\n nginx.toJSON());\n }",
"class_method_signature": "RecipeTest.testJSONConversion()",
"constructor": false,
"full_signature": "@Test ... | {
"fields": [
{
"declarator": "cookbook",
"modifier": "public final",
"original_string": "public final String cookbook;",
"type": "String",
"var_name": "cookbook"
},
{
"declarator": "recipe",
"modifier": "public final",
"original_string": "public final Strin... | {
"body": "public String toJSON() {\n Gson gson = new Gson();\n JsonObject recipeAsJSON = new JsonObject();\n\n if (!attribs.isEmpty()) {\n JsonObject jsonAttribs = new JsonObject();\n for (Map.Entry<String, Object> entry : attribs.entrySet()) {\n jsonAttribs.add(entry.getKey(), gson.toJsonT... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_69 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/command/RunScriptCommandTest.java",
"identifier": "RunScriptCommandTest",
"interfaces": "",
"superclass": "extends BaseCommandTest"
} | {
"body": "@Test\n public void testRunScriptByInstanceId() throws Exception {\n ClusterControllerFactory factory = mock(ClusterControllerFactory.class);\n ClusterController controller = mock(ClusterController.class);\n\n when(factory.create((String)any())).thenReturn(controller);\n\n RunScriptCommand com... | {
"fields": [
{
"declarator": "rolesOption = parser\n .accepts(\"roles\", \"List of comma separated role names. \" +\n \"E.g. zookeeper,hadoop-namenode\")\n .withRequiredArg()\n .ofType(String.class)",
"modifier": "private",
"original_string": "private OptionSpec<String> rolesOptio... | {
"body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n\n OptionSet optionSet = parser.parse(args.toArray(new String[0]));\n if (!optionSet.has(scriptOption)) {\n err.println(\"Please specify a script file to be exec... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_62 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/ClusterControllerFactoryTest.java",
"identifier": "ClusterControllerFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testServiceFactoryWithNullServiceName() throws IOException {\n ClusterControllerFactory factory = new ClusterControllerFactory();\n ClusterController controller = factory.create(null);\n assertThat(controller, instanceOf(ClusterController.class));\n }",
"class_method_signat... | {
"fields": [
{
"declarator": "serviceLoader =\n ServiceLoader.load(ClusterController.class)",
"modifier": "private",
"original_string": "private ServiceLoader<ClusterController> serviceLoader =\n ServiceLoader.load(ClusterController.class);",
"type": "ServiceLoader<ClusterController... | {
"body": "public ClusterController create(String serviceName) {\n if (serviceName == null) {\n return new ClusterController();\n }\n for (ClusterController controller : serviceLoader) {\n if (controller.getName().equals(serviceName)) {\n return controller;\n }\n }\n return null;\... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_35 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/ClusterSpecTest.java",
"identifier": "ClusterSpecTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEnvVariableInterpolation() {\n Map<String, String> envMap = System.getenv();\n assertThat(envMap.isEmpty(), is(false));\n\n String undefinedEnvVar = \"UNDEFINED_ENV_VAR\";\n assertThat(envMap.containsKey(undefinedEnvVar), is(false));\n\n Entry<String, String> firstEn... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ClusterSpec.class)",
"modifier": "static final",
"original_string": "static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "DEFAULT_PROP... | {
"body": "private String getString(Property key) {\n return config.getString(key.getConfigName(), null);\n }",
"class_method_signature": "ClusterSpec.getString(Property key)",
"constructor": false,
"full_signature": "private String getString(Property key)",
"identifier": "getString",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_23 | {
"fields": [
{
"declarator": "defaults",
"modifier": "private",
"original_string": "private Configuration defaults;",
"type": "Configuration",
"var_name": "defaults"
},
{
"declarator": "clusterSpec",
"modifier": "private",
"original_string": "private Cluste... | {
"body": "@Test\n public void testMapReduce() throws Exception {\n Cluster cluster = newCluster(5);\n Configuration conf = HadoopConfigurationBuilder\n .buildMapReduceConfiguration(clusterSpec, cluster, defaults,\n Sets.newLinkedHashSet(Lists.newArrayList(\"/data0\", \"/data1\")));\n assertTh... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class);",
"type": "Logger",
"var_name": "LOG"
... | {
"body": "@VisibleForTesting\n static Configuration buildMapReduceConfiguration(ClusterSpec clusterSpec,\n Cluster cluster, Configuration defaults, Set<String> dataDirectories) throws ConfigurationException, IOException {\n Configuration config = build(clusterSpec, cluster, defaults,\n \"hadoop-mapre... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_74 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/command/ListClusterCommandTest.java",
"identifier": "ListClusterCommandTest",
"interfaces": "",
"superclass": "extends BaseCommandTest"
} | {
"body": "@Test\n public void testInsufficientOptions() throws Exception {\n ListClusterCommand command = new ListClusterCommand();\n Map<String, File> keys = KeyPair.generateTemporaryFiles();\n int rc = command.run(null, null, err, Lists.<String>newArrayList(\n \"--private-key-file\", keys.get(\"pr... | {
"fields": [],
"file": "cli/src/main/java/org/apache/whirr/cli/command/ListClusterCommand.java",
"identifier": "ListClusterCommand",
"interfaces": "",
"methods": [
{
"class_method_signature": "ListClusterCommand.ListClusterCommand()",
"constructor": true,
"full_signature": "public List... | {
"body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n\n OptionSet optionSet = parser.parse(args.toArray(new String[args.size()]));\n\n if (!optionSet.nonOptionArguments().isEmpty()) {\n printUsage(err);\n retu... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_58 | {
"fields": [
{
"declarator": "HANDLER_MAP_FACTORY = new HandlerMapFactory()",
"modifier": "private final static",
"original_string": "private final static HandlerMapFactory HANDLER_MAP_FACTORY = new HandlerMapFactory();",
"type": "HandlerMapFactory",
"var_name": "HANDLER_MAP_FACTORY... | {
"body": "@Test\n public void testFilterScriptExecutionByInstanceId() throws Exception {\n String instanceId = getInstaceForRole(cluster, \"noop3\").getId();\n T action = newClusterActionInstance(EMPTYSET, newHashSet(instanceId));\n DryRun dryRun = getDryRunForAction(action).reset();\n\n action.execute(... | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class);",
"type": "Logger",
"var_n... | {
"body": "public Cluster execute(ClusterSpec clusterSpec, Cluster cluster)\n throws IOException, InterruptedException {\n\n if (clusterSpec.getInstanceTemplates().size() == 0) {\n throw new IllegalArgumentException(\"No instance templates specified.\");\n }\n \n Map<InstanceTemplate, ClusterA... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_19 | {
"fields": [],
"file": "services/cassandra/src/test/java/org/apache/whirr/service/cassandra/CassandraClusterActionHandlerTest.java",
"identifier": "CassandraClusterActionHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testComputeInitialTokens() {\n List<String> result = new CassandraClusterActionHandler().computeInitialTokens(5);\n\n assertEquals(result, ImmutableList.of(\n \"0\",\n \"34028236692093846346337460743176821145\",\n \"68056473384187692692674921486353642290\",\n ... | {
"fields": [
{
"declarator": "CASSANDRA_ROLE = \"cassandra\"",
"modifier": "public static final",
"original_string": "public static final String CASSANDRA_ROLE = \"cassandra\";",
"type": "String",
"var_name": "CASSANDRA_ROLE"
},
{
"declarator": "CLIENT_PORT = 9160",
... | {
"body": "protected List<String> computeInitialTokens(int numberOfNodes) {\n List<String> tokens = Lists.newArrayList();\n\n BigInteger step = new BigInteger(\"2\")\n .pow(127).divide(BigInteger.valueOf(numberOfNodes));\n\n for (int i = 0; i < numberOfNodes; i++) {\n tokens.add(step.multiply(BigIn... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_39 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/ClusterSpecTest.java",
"identifier": "ClusterSpecTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ConfigurationException.class)\n public void testMissingPublicKey() throws JSchException, IOException, ConfigurationException {\n File privateKey = KeyPair.generateTemporaryFiles().get(\"private\");\n\n Configuration conf = new PropertiesConfiguration();\n conf.setProperty(\"whirr... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ClusterSpec.class)",
"modifier": "static final",
"original_string": "static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "DEFAULT_PROP... | {
"body": "@VisibleForTesting\n public static ClusterSpec withNoDefaults() throws ConfigurationException {\n return withNoDefaults(new PropertiesConfiguration());\n }",
"class_method_signature": "ClusterSpec.withNoDefaults()",
"constructor": false,
"full_signature": "@VisibleForTesting public static Cluste... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_7 | {
"fields": [],
"file": "services/puppet/src/test/java/org/apache/whirr/service/puppet/statements/InstallModuleFromGitTest.java",
"identifier": "InstallModuleFromGitTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWhenModuleAndURIAndBranchValid() {\n\n InstallModuleFromGit nginx = new InstallModuleFromGit(\"nginx\", URI\n .create(\"git://github.com/puppetlabs/puppetlabs-nginx.git\"), \"WHIRR-385\");\n\n assertEquals(\"git clone -b WHIRR-385 git://github.com/puppetlabs/puppetla... | {
"fields": [
{
"declarator": "module",
"modifier": "private final",
"original_string": "private final String module;",
"type": "String",
"var_name": "module"
},
{
"declarator": "url",
"modifier": "private final",
"original_string": "private final URI url;",... | {
"body": "@Override\n public String render(OsFamily arg0) {\n return exec(\n \"git clone \" + (vcsBranch != null ? \"-b \" + vcsBranch + \" \" : \"\") + url + \" \" + MODULES_DIR\n + module).render(arg0);\n }",
"class_method_signature": "InstallModuleFromGit.render(OsFamily arg0)",
"... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_78 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/MainTest.java",
"identifier": "MainTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNoArgs() throws Exception {\n Main main = new Main(new TestCommand());\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n PrintStream out = new PrintStream(bytes);\n int rc = main.run(null, out, null, Collections.<String>emptyList());\n assertThat(rc, is(... | {
"fields": [
{
"declarator": "commandMap = Maps.newLinkedHashMap()",
"modifier": "private",
"original_string": "private Map<String, Command> commandMap = Maps.newLinkedHashMap();",
"type": "Map<String, Command>",
"var_name": "commandMap"
},
{
"declarator": "maxLen = 0"... | {
"body": "int run(InputStream in, PrintStream out, PrintStream err,\n List<String> list) throws Exception {\n if (list.isEmpty()) {\n printUsage(out);\n return -1;\n }\n Command command = commandMap.get(list.get(0));\n if (command == null) {\n err.printf(\"Unrecognized command '%s'\\n... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_54 | {
"fields": [
{
"declarator": "cluster",
"modifier": "private",
"original_string": "private Cluster cluster;",
"type": "Cluster",
"var_name": "cluster"
},
{
"declarator": "NUMBER_OF_INSTANCES = 5",
"modifier": "private static final",
"original_string": "priv... | {
"body": "@Test\n public void getInstanceByRole() {\n Cluster.Instance instance = cluster.getInstanceMatching(role(\"role-0\"));\n assertThat(instance.getId(), is(\"id-0\"));\n }",
"class_method_signature": "ClusterTest.getInstanceByRole()",
"constructor": false,
"full_signature": "@Test public void ge... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(Cluster.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(Cluster.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "inst... | {
"body": "public Instance getInstanceMatching(Predicate<Instance> predicate) {\n return Iterables.getOnlyElement(Sets.filter(instances, predicate));\n }",
"class_method_signature": "Cluster.getInstanceMatching(Predicate<Instance> predicate)",
"constructor": false,
"full_signature": "public Instance getInst... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_42 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/ClusterSpecTest.java",
"identifier": "ClusterSpecTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testMissingCommaInInstanceTemplates() throws Exception {\n Configuration conf = new PropertiesConfiguration();\n conf.setProperty(ClusterSpec.Property.INSTANCE_TEMPLATES.getConfigName(),\n \"1 a+b 2 c+d\"); // missing comma\n Clu... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ClusterSpec.class)",
"modifier": "static final",
"original_string": "static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "DEFAULT_PROP... | {
"body": "@VisibleForTesting\n public static ClusterSpec withTemporaryKeys()\n throws ConfigurationException, JSchException, IOException {\n return withTemporaryKeys(new PropertiesConfiguration());\n }",
"class_method_signature": "ClusterSpec.withTemporaryKeys()",
"constructor": false,
"full_signature": ... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_15 | {
"fields": [],
"file": "services/elasticsearch/src/test/java/org/apache/whirr/service/elasticsearch/ElasticSearchConfigurationBuilderTest.java",
"identifier": "ElasticSearchConfigurationBuilderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGenerateYamlConfig() {\n Configuration defaults = new PropertiesConfiguration();\n\n defaults.addProperty(\"cloud.aws.id\", \"a\");\n defaults.addProperty(\"cloud.aws.key\", \"b\");\n defaults.addProperty(\"index.store.type\", \"memory\");\n\n String content = String... | {
"fields": [
{
"declarator": "LOG =\n LoggerFactory.getLogger(ElasticSearchConfigurationBuilder.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger LOG =\n LoggerFactory.getLogger(ElasticSearchConfigurationBuilder.class);",
"type": ... | {
"body": "@VisibleForTesting\n public static List<String> asYamlLines(Configuration config) {\n return asYamlLines(config, 0);\n }",
"class_method_signature": "ElasticSearchConfigurationBuilder.asYamlLines(Configuration config)",
"constructor": false,
"full_signature": "@VisibleForTesting public static Li... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_14 | {
"fields": [],
"file": "services/puppet/src/test/java/org/apache/whirr/service/puppet/PuppetClusterActionHandlerFactoryTest.java",
"identifier": "PuppetClusterActionHandlerFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testPuppetFactoryIsRegisteredAndWorksWithManifests() {\n assertEquals(new HandlerMapFactory().create().getUnchecked(\"puppet:postgresql::server\"), new PuppetClusterActionHandler(\n \"postgresql::server\"));\n }",
"class_method_signature": "PuppetClusterActionHandlerFact... | {
"fields": [],
"file": "services/puppet/src/main/java/org/apache/whirr/service/puppet/PuppetClusterActionHandlerFactory.java",
"identifier": "PuppetClusterActionHandlerFactory",
"interfaces": "",
"methods": [
{
"class_method_signature": "PuppetClusterActionHandlerFactory.getRolePrefix()",
"co... | {
"body": "@Override\n public ClusterActionHandler create(String roleName) {\n return new PuppetClusterActionHandler(checkNotNull(roleName, \"roleName\"));\n }",
"class_method_signature": "PuppetClusterActionHandlerFactory.create(String roleName)",
"constructor": false,
"full_signature": "@Override public ... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_43 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/ClusterSpecTest.java",
"identifier": "ClusterSpecTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ConfigurationException.class)\n public void testInstanceTemplateNotFoundForHardwareId() throws Exception {\n PropertiesConfiguration conf = new PropertiesConfiguration(\"whirr-core-test.properties\");\n conf.setProperty(\"whirr.instance-templates\", \"1 role1+role2\");\n conf.set... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ClusterSpec.class)",
"modifier": "static final",
"original_string": "static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "DEFAULT_PROP... | {
"body": "@VisibleForTesting\n public static ClusterSpec withTemporaryKeys()\n throws ConfigurationException, JSchException, IOException {\n return withTemporaryKeys(new PropertiesConfiguration());\n }",
"class_method_signature": "ClusterSpec.withTemporaryKeys()",
"constructor": false,
"full_signature": ... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_55 | {
"fields": [
{
"declarator": "HANDLER_MAP_FACTORY = new HandlerMapFactory()",
"modifier": "private final static",
"original_string": "private final static HandlerMapFactory HANDLER_MAP_FACTORY = new HandlerMapFactory();",
"type": "HandlerMapFactory",
"var_name": "HANDLER_MAP_FACTORY... | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testEmptyInstanceTemplates() throws Exception {\n T action = newClusterActionInstance(EMPTYSET, EMPTYSET);\n DryRun dryRun = getDryRunForAction(action).reset();\n\n ClusterSpec tempSpec = ClusterSpec.withTemporaryKeys();\n\n tempSp... | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class);",
"type": "Logger",
"var_n... | {
"body": "public Cluster execute(ClusterSpec clusterSpec, Cluster cluster)\n throws IOException, InterruptedException {\n\n if (clusterSpec.getInstanceTemplates().size() == 0) {\n throw new IllegalArgumentException(\"No instance templates specified.\");\n }\n \n Map<InstanceTemplate, ClusterA... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_6 | {
"fields": [],
"file": "services/puppet/src/test/java/org/apache/whirr/service/puppet/statements/InstallModuleFromGitTest.java",
"identifier": "InstallModuleFromGitTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWhenModuleAndURIValid() {\n\n InstallModuleFromGit nginx = new InstallModuleFromGit(\"nginx\", URI\n .create(\"git://github.com/puppetlabs/puppetlabs-nginx.git\"));\n\n assertEquals(\"git clone git://github.com/puppetlabs/puppetlabs-nginx.git /etc/puppet/modules/ngin... | {
"fields": [
{
"declarator": "module",
"modifier": "private final",
"original_string": "private final String module;",
"type": "String",
"var_name": "module"
},
{
"declarator": "url",
"modifier": "private final",
"original_string": "private final URI url;",... | {
"body": "@Override\n public String render(OsFamily arg0) {\n return exec(\n \"git clone \" + (vcsBranch != null ? \"-b \" + vcsBranch + \" \" : \"\") + url + \" \" + MODULES_DIR\n + module).render(arg0);\n }",
"class_method_signature": "InstallModuleFromGit.render(OsFamily arg0)",
"... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_79 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/MainTest.java",
"identifier": "MainTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUnrecognizedCommand() throws Exception {\n Main main = new Main(new TestCommand());\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n PrintStream err = new PrintStream(bytes);\n int rc = main.run(null, null, err, Lists.newArrayList(\"bogus-command\"));\n ... | {
"fields": [
{
"declarator": "commandMap = Maps.newLinkedHashMap()",
"modifier": "private",
"original_string": "private Map<String, Command> commandMap = Maps.newLinkedHashMap();",
"type": "Map<String, Command>",
"var_name": "commandMap"
},
{
"declarator": "maxLen = 0"... | {
"body": "int run(InputStream in, PrintStream out, PrintStream err,\n List<String> list) throws Exception {\n if (list.isEmpty()) {\n printUsage(out);\n return -1;\n }\n Command command = commandMap.get(list.get(0));\n if (command == null) {\n err.printf(\"Unrecognized command '%s'\\n... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_38 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/ClusterSpecTest.java",
"identifier": "ClusterSpecTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ConfigurationException.class)\n public void testMissingPrivateKey() throws ConfigurationException {\n Configuration conf = new PropertiesConfiguration();\n conf.setProperty(\"whirr.private-key-file\", \"/dummy/path/that/does/not/exists\");\n\n ClusterSpec.withNoDefaults(conf);\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ClusterSpec.class)",
"modifier": "static final",
"original_string": "static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "DEFAULT_PROP... | {
"body": "@VisibleForTesting\n public static ClusterSpec withNoDefaults() throws ConfigurationException {\n return withNoDefaults(new PropertiesConfiguration());\n }",
"class_method_signature": "ClusterSpec.withNoDefaults()",
"constructor": false,
"full_signature": "@VisibleForTesting public static Cluste... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_80 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/MainTest.java",
"identifier": "MainTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCommand() throws Exception {\n Command command = mock(Command.class);\n when(command.getName()).thenReturn(\"mock-command\");\n Main main = new Main(command);\n main.run(null, null, null, Lists.newArrayList(\"mock-command\", \"arg1\", \"arg2\"));\n verify(command).ru... | {
"fields": [
{
"declarator": "commandMap = Maps.newLinkedHashMap()",
"modifier": "private",
"original_string": "private Map<String, Command> commandMap = Maps.newLinkedHashMap();",
"type": "Map<String, Command>",
"var_name": "commandMap"
},
{
"declarator": "maxLen = 0"... | {
"body": "int run(InputStream in, PrintStream out, PrintStream err,\n List<String> list) throws Exception {\n if (list.isEmpty()) {\n printUsage(out);\n return -1;\n }\n Command command = commandMap.get(list.get(0));\n if (command == null) {\n err.printf(\"Unrecognized command '%s'\\n... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_18 | {
"fields": [],
"file": "services/cassandra/src/test/java/org/apache/whirr/service/cassandra/CassandraClusterActionHandlerTest.java",
"identifier": "CassandraClusterActionHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test()\n public void testGetSeeds() throws UnknownHostException {\n Instance one = getInstance(\"1\");\n Instance two = getInstance(\"2\");\n \n Set<Instance> instances = Sets.newLinkedHashSet();\n instances.add(one);\n \n CassandraClusterActionHandler handler = new CassandraClusterA... | {
"fields": [
{
"declarator": "CASSANDRA_ROLE = \"cassandra\"",
"modifier": "public static final",
"original_string": "public static final String CASSANDRA_ROLE = \"cassandra\";",
"type": "String",
"var_name": "CASSANDRA_ROLE"
},
{
"declarator": "CLIENT_PORT = 9160",
... | {
"body": "protected List<Instance> getSeeds(Set<Instance> instances) {\n List<Instance> nodes = Lists.newArrayList(instances);\n int seeds = (int) Math.ceil(Math.max(1, instances.size() * 0.2));\n List<Instance> rv = Lists.newArrayList();\n for (int i = 0; i < seeds; i++) {\n rv.add(nodes.get(i));\n... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_59 | {
"fields": [
{
"declarator": "HANDLER_MAP_FACTORY = new HandlerMapFactory()",
"modifier": "private final static",
"original_string": "private final static HandlerMapFactory HANDLER_MAP_FACTORY = new HandlerMapFactory();",
"type": "HandlerMapFactory",
"var_name": "HANDLER_MAP_FACTORY... | {
"body": "@Test\n public void testFilterScriptExecutionByRoleAndInstanceId() throws Exception {\n String instanceId = getInstaceForRole(cluster, \"noop1\").getId();\n T action = newClusterActionInstance(newHashSet(\"noop1\"), newHashSet(instanceId));\n DryRun dryRun = getDryRunForAction(action).reset();\n\... | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class);",
"type": "Logger",
"var_n... | {
"body": "public Cluster execute(ClusterSpec clusterSpec, Cluster cluster)\n throws IOException, InterruptedException {\n\n if (clusterSpec.getInstanceTemplates().size() == 0) {\n throw new IllegalArgumentException(\"No instance templates specified.\");\n }\n \n Map<InstanceTemplate, ClusterA... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_75 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/command/ListClusterCommandTest.java",
"identifier": "ListClusterCommandTest",
"interfaces": "",
"superclass": "extends BaseCommandTest"
} | {
"body": "@Test\n public void testAllOptions() throws Exception {\n\n ClusterControllerFactory factory = mock(ClusterControllerFactory.class);\n ClusterController controller = mock(ClusterController.class);\n when(factory.create((String) any())).thenReturn(controller);\n\n NodeMetadata node1 = new NodeM... | {
"fields": [],
"file": "cli/src/main/java/org/apache/whirr/cli/command/ListClusterCommand.java",
"identifier": "ListClusterCommand",
"interfaces": "",
"methods": [
{
"class_method_signature": "ListClusterCommand.ListClusterCommand()",
"constructor": true,
"full_signature": "public List... | {
"body": "@Override\n public int run(InputStream in, PrintStream out, PrintStream err,\n List<String> args) throws Exception {\n\n OptionSet optionSet = parser.parse(args.toArray(new String[args.size()]));\n\n if (!optionSet.nonOptionArguments().isEmpty()) {\n printUsage(err);\n retu... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_22 | {
"fields": [
{
"declarator": "defaults",
"modifier": "private",
"original_string": "private Configuration defaults;",
"type": "Configuration",
"var_name": "defaults"
},
{
"declarator": "clusterSpec",
"modifier": "private",
"original_string": "private Cluste... | {
"body": "@Test\n public void testHdfs() throws Exception {\n Configuration conf = HadoopConfigurationBuilder.buildHdfsConfiguration(\n clusterSpec, cluster, defaults,\n Sets.newLinkedHashSet(Lists.newArrayList(\"/data0\", \"/data1\")));\n assertThat(Iterators.size(conf.getKeys()), is(4));\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class);",
"type": "Logger",
"var_name": "LOG"
... | {
"body": "@VisibleForTesting\n static Configuration buildHdfsConfiguration(ClusterSpec clusterSpec,\n Cluster cluster, Configuration defaults, Set<String> dataDirectories) throws ConfigurationException {\n Configuration config = build(clusterSpec, cluster, defaults, \"hadoop-hdfs\");\n \n setIfAbsent(... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_34 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/ClusterSpecTest.java",
"identifier": "ClusterSpecTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetConfigurationForKeysWithPrefix()\n throws ConfigurationException, JSchException, IOException {\n Configuration conf = new PropertiesConfiguration();\n conf.setProperty(\"a.b\", 1);\n conf.setProperty(\"b.a\", 2);\n conf.setProperty(\"a.c\", 3);\n\n ClusterSpec ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ClusterSpec.class)",
"modifier": "static final",
"original_string": "static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "DEFAULT_PROP... | {
"body": "public Configuration getConfigurationForKeysWithPrefix(String prefix) {\n Configuration c = new PropertiesConfiguration();\n for (@SuppressWarnings(\"unchecked\")\n Iterator<String> it = config.getKeys(prefix); it.hasNext(); ) {\n String key = it.next();\n c.setProperty(key, config.g... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_63 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/template/TemplateUtilsTest.java",
"identifier": "TemplateUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testProcessTemplate() throws Exception {\n Credentials credentials = new Credentials(\"dummy\", \"dummy\");\n Cluster.Instance instance = new Cluster.Instance(credentials,\n Sets.newHashSet(\"foo\"), \"127.0.0.1\", \"127.0.0.1\", \"id-0\", null);\n\n ClusterSpec cluster... | {
"fields": [],
"file": "core/src/main/java/org/apache/whirr/template/TemplateUtils.java",
"identifier": "TemplateUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "TemplateUtils.createFileFromTemplate(String path, VelocityEngine engine, String templateName, ClusterSpec clusterSpec,... | {
"body": "public static String processTemplate(VelocityEngine engine, String templateName, ClusterSpec clusterSpec, Cluster cluster) {\n VelocityContext context = new VelocityContext();\n context.put(\"clusterSpec\", clusterSpec);\n context.put(\"cluster\", cluster);\n context.put(\"RolePredicates\", Rol... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_76 | {
"fields": [],
"file": "cli/src/test/java/org/apache/whirr/cli/command/DestroyInstanceCommandTest.java",
"identifier": "DestroyInstanceCommandTest",
"interfaces": "",
"superclass": "extends BaseCommandTest"
} | {
"body": "@Test\n public void testInstanceIdMandatory() throws Exception {\n DestroyInstanceCommand command = new DestroyInstanceCommand();\n int rc = command.run(null, out, err, Collections.<String>emptyList());\n assertThat(rc, is(-1));\n\n String errOutput = errBytes.toString();\n assertThat(errOu... | {
"fields": [
{
"declarator": "instanceOption = parser\n .accepts(\"instance-id\", \"Cluster instance ID\")\n .withRequiredArg()\n .ofType(String.class)",
"modifier": "private",
"original_string": "private OptionSpec<String> instanceOption = parser\n .accepts(\"instance-id\", \"Clust... | {
"body": "@Override\n public int run(InputStream in, PrintStream out,\n PrintStream err, List<String> args) throws Exception {\n\n OptionSet optionSet = parser.parse(args.toArray(new String[args.size()]));\n if (!optionSet.nonOptionArguments().isEmpty()) {\n printUsage(err);\n return... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_9 | {
"fields": [
{
"declarator": "getStatement = new StatementToInstallModule(new PrepareRemoteFileUrl() {\n\n @Override\n public String apply(String rawUrl) throws IOException {\n return rawUrl;\n }\n\n })",
"modifier": "",
"original_string": "StatementToInstallModule getStatement =... | {
"body": "@Test\n public void testWhenFile() {\n\n assertEquals(\"install_tarball file://path/to/tgz /etc/puppet/modules/nginx || return 1\\n\", getStatement.apply(\n ImmutableMap.of(\"puppet.nginx.module\", \"file://path/to/tgz\"))\n .render(OsFamily.UNIX));\n }",
"class_method_signature": "... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(StatementToInstallModule.class)",
"modifier": "static final",
"original_string": "static final Logger LOG = LoggerFactory.getLogger(StatementToInstallModule.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "@Override\n public Statement apply(Map<String, String> props) {\n try {\n return installModuleFromRemoteFileOrGit(find(props.keySet(), contains(MODULE_KEY_PATTERN)), props);\n } catch (NoSuchElementException e) {\n throw new IllegalArgumentException(format(\"couldn't find pattern: %s in pr... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_21 | {
"fields": [
{
"declarator": "defaults",
"modifier": "private",
"original_string": "private Configuration defaults;",
"type": "Configuration",
"var_name": "defaults"
},
{
"declarator": "clusterSpec",
"modifier": "private",
"original_string": "private Cluste... | {
"body": "@Test\n public void testOverrides() throws Exception {\n Configuration overrides = new PropertiesConfiguration();\n overrides.addProperty(\"hadoop-common.p1\", \"overridden1\");\n overrides.addProperty(\"hadoop-common.p2\", \"overridden2\");\n overrides.addProperty(\"hadoop-common.fs.default.n... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(HadoopConfigurationBuilder.class);",
"type": "Logger",
"var_name": "LOG"
... | {
"body": "@VisibleForTesting\n static Configuration buildCommonConfiguration(ClusterSpec clusterSpec,\n Cluster cluster, Configuration defaults) throws ConfigurationException, IOException {\n Configuration config = build(clusterSpec, cluster, defaults,\n \"hadoop-common\");\n\n Instance namenode =... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_37 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/ClusterSpecTest.java",
"identifier": "ClusterSpecTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ConfigurationException.class)\n public void testEncryptedPrivateKey()\n throws JSchException, IOException, ConfigurationException {\n File privateKey = KeyPair.generateTemporaryFiles(\"dummy\").get(\"private\");\n\n Configuration conf = new PropertiesConfiguration();\n conf.se... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ClusterSpec.class)",
"modifier": "static final",
"original_string": "static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "DEFAULT_PROP... | {
"body": "@VisibleForTesting\n public static ClusterSpec withNoDefaults() throws ConfigurationException {\n return withNoDefaults(new PropertiesConfiguration());\n }",
"class_method_signature": "ClusterSpec.withNoDefaults()",
"constructor": false,
"full_signature": "@VisibleForTesting public static Cluste... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_60 | {
"fields": [
{
"declarator": "HANDLER_MAP_FACTORY = new HandlerMapFactory()",
"modifier": "private final static",
"original_string": "private final static HandlerMapFactory HANDLER_MAP_FACTORY = new HandlerMapFactory();",
"type": "HandlerMapFactory",
"var_name": "HANDLER_MAP_FACTORY... | {
"body": "@Test\n public void testNoScriptExecutionsForNoop() throws Exception {\n T action = newClusterActionInstance(ImmutableSet.of(\"noop\"), EMPTYSET);\n DryRun dryRun = getDryRunForAction(action).reset();\n \n action.execute(clusterSpec, cluster);\n\n List<StatementOnNode> executions = dryRun.g... | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class);",
"type": "Logger",
"var_n... | {
"body": "public Cluster execute(ClusterSpec clusterSpec, Cluster cluster)\n throws IOException, InterruptedException {\n\n if (clusterSpec.getInstanceTemplates().size() == 0) {\n throw new IllegalArgumentException(\"No instance templates specified.\");\n }\n \n Map<InstanceTemplate, ClusterA... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_17 | {
"fields": [],
"file": "services/elasticsearch/src/test/java/org/apache/whirr/service/elasticsearch/ElasticSearchConfigurationBuilderTest.java",
"identifier": "ElasticSearchConfigurationBuilderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testOverrideDefaults() throws Exception {\n Configuration baseConfig = new PropertiesConfiguration();\n baseConfig.addProperty(\"whirr.provider\", \"aws-ec2\");\n baseConfig.addProperty(\"es.index.store.type\", \"fs\");\n\n ClusterSpec spec = ClusterSpec.withTemporaryKeys(b... | {
"fields": [
{
"declarator": "LOG =\n LoggerFactory.getLogger(ElasticSearchConfigurationBuilder.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger LOG =\n LoggerFactory.getLogger(ElasticSearchConfigurationBuilder.class);",
"type": ... | {
"body": "public static Configuration buildConfig(ClusterSpec spec, Cluster cluster) {\n CompositeConfiguration config = new CompositeConfiguration();\n\n config.addConfiguration(spec.getConfiguration());\n try {\n config.addConfiguration(\n new PropertiesConfiguration(ElasticSearchConfiguration... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_40 | {
"fields": [],
"file": "core/src/test/java/org/apache/whirr/ClusterSpecTest.java",
"identifier": "ClusterSpecTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = ConfigurationException.class)\n public void testBrokenPublicKey() throws IOException, JSchException, ConfigurationException {\n File privateKey = KeyPair.generateTemporaryFiles().get(\"private\");\n\n File publicKey = File.createTempFile(\"public\", \"key\");\n publicKey.deleteOn... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ClusterSpec.class)",
"modifier": "static final",
"original_string": "static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator": "DEFAULT_PROP... | {
"body": "@VisibleForTesting\n public static ClusterSpec withNoDefaults() throws ConfigurationException {\n return withNoDefaults(new PropertiesConfiguration());\n }",
"class_method_signature": "ClusterSpec.withNoDefaults()",
"constructor": false,
"full_signature": "@VisibleForTesting public static Cluste... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_56 | {
"fields": [
{
"declarator": "HANDLER_MAP_FACTORY = new HandlerMapFactory()",
"modifier": "private final static",
"original_string": "private final static HandlerMapFactory HANDLER_MAP_FACTORY = new HandlerMapFactory();",
"type": "HandlerMapFactory",
"var_name": "HANDLER_MAP_FACTORY... | {
"body": "@Test\n public void testActionIsExecutedOnAllRelevantNodes() throws Exception {\n T action = newClusterActionInstance(EMPTYSET, EMPTYSET);\n DryRun dryRun = getDryRunForAction(action).reset();\n \n action.execute(clusterSpec, cluster);\n \n List<StatementOnNode> executions = dryRun.getTo... | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class);",
"type": "Logger",
"var_n... | {
"body": "public Cluster execute(ClusterSpec clusterSpec, Cluster cluster)\n throws IOException, InterruptedException {\n\n if (clusterSpec.getInstanceTemplates().size() == 0) {\n throw new IllegalArgumentException(\"No instance templates specified.\");\n }\n \n Map<InstanceTemplate, ClusterA... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_5 | {
"fields": [],
"file": "services/puppet/src/test/java/org/apache/whirr/service/puppet/statements/CreateSitePpAndApplyRolesTest.java",
"identifier": "CreateSitePpAndApplyRolesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWithAttribs() throws IOException {\n Configuration conf = new PropertiesConfiguration();\n conf.setProperty(\"puppet.nginx.module\", \"git://github.com/puppetlabs/puppetlabs-nginx.git\");\n conf.setProperty(\"nginx.server.hostname\", \"foohost\");\n\n CreateSitePpAndApp... | {
"fields": [
{
"declarator": "roles",
"modifier": "private",
"original_string": "private Iterable<String> roles;",
"type": "Iterable<String>",
"var_name": "roles"
},
{
"declarator": "instances",
"modifier": "private",
"original_string": "private Iterable<Cl... | {
"body": "@Override\n public String render(OsFamily arg0) {\n Boolean isHiera = config.getBoolean(PUPPET_HIERA_CLASSES, false);\n\n // when we get to the last role, let's cat all the manifests we made together inside a\n // node default site.pp\n Builder<Statement> statements = ImmutableList.<Statement>... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_4 | {
"fields": [
{
"declarator": "NGINX_PUPPET = \"class { 'nginx':\\n}\"",
"modifier": "private static final",
"original_string": "private static final String NGINX_PUPPET = \"class { 'nginx':\\n}\";",
"type": "String",
"var_name": "NGINX_PUPPET"
},
{
"declarator": "POSTG... | {
"body": "@Test\n public void testPuppetConversionHiera() {\n\n Manifest postgress = new Manifest(\"postgresql\", \"server\");\n\n assertEquals(\"Puppet/Name representation is incorrect.\", POSTGRES_PUPPET_NAME,\n postgress.getName());\n }",
"class_method_signature": "ManifestTest.testPuppet... | {
"fields": [
{
"declarator": "module",
"modifier": "public final",
"original_string": "public final String module;",
"type": "String",
"var_name": "module"
},
{
"declarator": "className",
"modifier": "public final",
"original_string": "public final String c... | {
"body": "public String getName() {\n return module + (className != null ? \"::\" + className : \"\");\n }",
"class_method_signature": "Manifest.getName()",
"constructor": false,
"full_signature": "public String getName()",
"identifier": "getName",
"invocations": [],
"modifiers": "public",
"paramet... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
832679_57 | {
"fields": [
{
"declarator": "HANDLER_MAP_FACTORY = new HandlerMapFactory()",
"modifier": "private final static",
"original_string": "private final static HandlerMapFactory HANDLER_MAP_FACTORY = new HandlerMapFactory();",
"type": "HandlerMapFactory",
"var_name": "HANDLER_MAP_FACTORY... | {
"body": "@Test\n public void testFilterScriptExecutionByRole() throws Exception {\n String instanceId = getInstaceForRole(cluster, \"noop2\").getId();\n T action = newClusterActionInstance(ImmutableSet.of(\"noop2\"), EMPTYSET);\n DryRun dryRun = getDryRunForAction(action).reset();\n \n action.execut... | {
"fields": [
{
"declarator": "LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory\n .getLogger(ScriptBasedClusterAction.class);",
"type": "Logger",
"var_n... | {
"body": "public Cluster execute(ClusterSpec clusterSpec, Cluster cluster)\n throws IOException, InterruptedException {\n\n if (clusterSpec.getInstanceTemplates().size() == 0) {\n throw new IllegalArgumentException(\"No instance templates specified.\");\n }\n \n Map<InstanceTemplate, ClusterA... | {
"created": null,
"fork": null,
"fork_count": 60,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 832679,
"size": 9902,
"stargazer_count": 96,
"stars": null,
"updates": null,
"url": "https://github.com/apache/attic-whirr"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.