id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
20473418_143
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/mapreduce/CsvBulkImportUtilTest.java", "identifier": "CsvBulkImportUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testInitCsvImportJob() throws IOException {\n Configuration conf = new Configuration();\n\n char delimiter = '\\001';\n char quote = '\\002';\n char escape = '!';\n\n CsvBulkImportUtil.initCsvImportJob(conf, delimiter, quote, escape, null, null);\n\...
{ "fields": [], "file": "phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkImportUtil.java", "identifier": "CsvBulkImportUtil", "interfaces": "", "methods": [ { "class_method_signature": "CsvBulkImportUtil.initCsvImportJob(Configuration conf, char fieldDelimiter, char quoteChar,\n ...
{ "body": "public static void initCsvImportJob(Configuration conf, char fieldDelimiter, char quoteChar,\n char escapeChar, String arrayDelimiter, String binaryEncoding) {\n setChar(conf, CsvToKeyValueMapper.FIELD_DELIMITER_CONFKEY, fieldDelimiter);\n setChar(conf, CsvToKeyValueMapper.QUOTE_CH...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_56
{ "fields": [ { "declarator": "ID_COLUMN = new ColumnInfo(\"ID\", Types.BIGINT)", "modifier": "private static final", "original_string": "private static final ColumnInfo ID_COLUMN = new ColumnInfo(\"ID\", Types.BIGINT);", "type": "ColumnInfo", "var_name": "ID_COLUMN" }, { ...
{ "body": "@Test(expected=IllegalArgumentException.class)\n public void testConstructUpsertStatement_ColumnInfos_NoColumns() {\n QueryUtil.constructUpsertStatement(\"MYTAB\", ImmutableList.<ColumnInfo>of());\n }", "class_method_signature": "QueryUtilTest.testConstructUpsertStatement_ColumnInfos_NoColum...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(QueryUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(QueryUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { "decla...
{ "body": "public static String constructUpsertStatement(String tableName, List<ColumnInfo> columnInfos) {\n\n if (columnInfos.isEmpty()) {\n throw new IllegalArgumentException(\"At least one column must be provided for upserts\");\n }\n\n final List<String> columnNames = Lists.transfo...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_40
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/JDBCUtilTest.java", "identifier": "JDBCUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRemoveProperty() {\n assertEquals(\"localhost;\", JDBCUtil.removeProperty(\"localhost;TenantId=abc;\", TENANT_ID_ATTRIB));\n assertEquals(\"localhost;foo=bar\", JDBCUtil.removeProperty(\"localhost;TenantId=abc;foo=bar\", TENANT_ID_ATTRIB));\n assertEquals(\"l...
{ "fields": [], "file": "phoenix-core/src/main/java/org/apache/phoenix/util/JDBCUtil.java", "identifier": "JDBCUtil", "interfaces": "", "methods": [ { "class_method_signature": "JDBCUtil.JDBCUtil()", "constructor": true, "full_signature": "private JDBCUtil()", "identifier": "JDBCU...
{ "body": "public static String removeProperty(String url, String propName) {\n String urlPropName = PhoenixRuntime.JDBC_PROTOCOL_TERMINATOR + propName.toUpperCase() + \"=\";\n String upperCaseURL = url.toUpperCase();\n int begIndex = upperCaseURL.indexOf(urlPropName);\n if (begIndex >= 0)...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_155
{ "fields": [ { "declarator": "TABLE_NAME = TableName.create(null,\"TABLE1\")", "modifier": "private static", "original_string": "private static TableName TABLE_NAME = TableName.create(null,\"TABLE1\");", "type": "TableName", "var_name": "TABLE_NAME" }, { "declarator": ...
{ "body": "@Test\n public void buildListOfColumnParseNodesTestIndex() throws Exception {\n List<ParseNode> children = new ArrayList<>();\n ColumnParseNode col1 = new ColumnParseNode(TABLE_NAME,\"col1\");\n ColumnParseNode col2 = new ColumnParseNode(TABLE_NAME,\"col2\");\n\n ParseNodeFac...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(RVCOffsetCompiler.class)", "modifier": "private final static", "original_string": "private final static Logger LOGGER = LoggerFactory.getLogger(RVCOffsetCompiler.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@VisibleForTesting List<ColumnParseNode> buildListOfColumnParseNodes(\n RowValueConstructorParseNode rvcColumnsParseNode, boolean isIndex)\n throws RowValueConstructorOffsetNotCoercibleException {\n List<ColumnParseNode> nodes = new ArrayList<ColumnParseNode>();\n for (P...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_17
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/PhoenixRuntimeTest.java", "identifier": "PhoenixRuntimeTest", "interfaces": "", "superclass": "extends BaseConnectionlessQueryTest" }
{ "body": "@Test\n public void testGetWallClockTimeFromCellTimeStamp() {\n long ts = System.currentTimeMillis();\n assertEquals(ts, PhoenixRuntime.getWallClockTimeFromCellTimeStamp(ts));\n long nanoTs = TransactionUtil.convertToNanoseconds(ts);\n assertEquals(ts, PhoenixRuntime.getWallC...
{ "fields": [ { "declarator": "JDBC_PROTOCOL = \"jdbc:phoenix\"", "modifier": "public final static", "original_string": "public final static String JDBC_PROTOCOL = \"jdbc:phoenix\";", "type": "String", "var_name": "JDBC_PROTOCOL" }, { "declarator": "JDBC_THIN_PROTOCOL =...
{ "body": "public static long getWallClockTimeFromCellTimeStamp(long tsOfCell) {\n return TransactionUtil.isTransactionalTimestamp(tsOfCell) ? TransactionUtil.convertToMilliseconds(tsOfCell) : tsOfCell;\n }", "class_method_signature": "PhoenixRuntime.getWallClockTimeFromCellTimeStamp(long tsOfCell)", "c...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_102
{ "fields": [ { "declarator": "bytesA = Bytes.toBytes(\"a\")", "modifier": "", "original_string": "byte[] bytesA = Bytes.toBytes(\"a\");", "type": "byte[]", "var_name": "bytesA" }, { "declarator": "bytesB = Bytes.toBytes(\"b\")", "modifier": "", "original_st...
{ "body": "@Test\n public void testComputeBuckets() {\n EquiDepthStreamHistogram histo = new EquiDepthStreamHistogram(3);\n histo.addValue(bytesA);\n histo.addValue(bytesB);\n histo.addValue(bytesC);\n histo.addValue(bytesD);\n histo.addValue(bytesE);\n List<Bucket>...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(EquiDepthStreamHistogram.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(EquiDepthStreamHistogram.class);", "type": "Logger", "var_name": "LOG...
{ "body": "public List<Bucket> computeBuckets() {\n Preconditions.checkState(bars.size() >= numBuckets, \"Not enough data points to compute buckets\");\n List<Bucket> buckets = new ArrayList<>();\n long idealBuckSize = (long) Math.ceil(totalCount / (double) numBuckets);\n long currCount = ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_60
{ "fields": [ { "declarator": "ID_COLUMN = new ColumnInfo(\"ID\", Types.BIGINT)", "modifier": "private static final", "original_string": "private static final ColumnInfo ID_COLUMN = new ColumnInfo(\"ID\", Types.BIGINT);", "type": "ColumnInfo", "var_name": "ID_COLUMN" }, { ...
{ "body": "@Test\n public void testConstructSelectStatementWithSchema() {\n assertEquals(\n \"SELECT \\\"ID\\\" , \\\"NAME\\\" FROM A.MYTAB\",\n QueryUtil.constructSelectStatement(\"A.MYTAB\", ImmutableList.of(ID_COLUMN,NAME_COLUMN),null));\n }", "class_method_signature": ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(QueryUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(QueryUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { "decla...
{ "body": "public static String constructSelectStatement(String fullTableName, List<ColumnInfo> columnInfos,final String conditions) {\n List<String> columns = Lists.transform(columnInfos, new Function<ColumnInfo, String>(){\n @Override\n public String apply(ColumnInfo input) {\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_175
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/schema/SaltingUtilTest.java", "identifier": "SaltingUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetSaltingByte_EdgeCaseHashCode() {\n // This array has a hashCode of Integer.MIN_VALUE based on the hashing in SaltingUtil\n byte[] rowKey = new byte[] { -106, 0, -10, 0, 19, -2 };\n byte saltingByte = SaltingUtil.getSaltingByte(rowKey, 0, rowKey.length, 3);...
{ "fields": [ { "declarator": "NUM_SALTING_BYTES = 1", "modifier": "public static final", "original_string": "public static final int NUM_SALTING_BYTES = 1;", "type": "int", "var_name": "NUM_SALTING_BYTES" }, { "declarator": "MAX_BUCKET_NUM = 256", "modifier": "pu...
{ "body": "public static byte getSaltingByte(byte[] value, int offset, int length, int bucketNum) {\n int hash = calculateHashCode(value, offset, length);\n return (byte) Math.abs(hash % bucketNum);\n }", "class_method_signature": "SaltingUtil.getSaltingByte(byte[] value, int offset, int length, in...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_37
{ "fields": [ { "declarator": "SOME_TENANT_ID = \"00Dxx0000001234\"", "modifier": "private static final", "original_string": "private static final String SOME_TENANT_ID = \"00Dxx0000001234\";", "type": "String", "var_name": "SOME_TENANT_ID" }, { "declarator": "SOME_OTHE...
{ "body": "@Test\n public void testPropertyOverrideRespected() throws Exception {\n final Configuration conf = HBaseConfiguration.create();\n final Properties props = new Properties();\n props.setProperty(HConstants.HBASE_RPC_TIMEOUT_KEY,\n Long.toString(HConstants.DEFAULT_HBASE_RPC...
{ "fields": [], "file": "phoenix-core/src/main/java/org/apache/phoenix/util/PropertiesUtil.java", "identifier": "PropertiesUtil", "interfaces": "", "methods": [ { "class_method_signature": "PropertiesUtil.PropertiesUtil()", "constructor": true, "full_signature": "private PropertiesUtil(...
{ "body": "public static Properties combineProperties(Properties props, final Configuration conf) {\n return combineProperties(props, conf, Collections.<String>emptySet());\n }", "class_method_signature": "PropertiesUtil.combineProperties(Properties props, final Configuration conf)", "constructor": fals...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_122
{ "fields": [ { "declarator": "row = new byte[] { 'a' }", "modifier": "", "original_string": "byte[] row = new byte[] { 'a' };", "type": "byte[]", "var_name": "row" }, { "declarator": "fam = Bytes.toBytes(\"family\")", "modifier": "", "original_string": "byt...
{ "body": "@Test\n public void testOnlyAllowsOlderTimestamps() {\n long ts = 100;\n NewerTimestampFilter filter = new NewerTimestampFilter(ts);\n\n KeyValue kv = new KeyValue(row, fam, qual, ts, val);\n assertEquals(\"Didn't accept kv with matching ts\", ReturnCode.INCLUDE, filter.filterKeyValue(kv));\n\...
{ "fields": [ { "declarator": "timestamp", "modifier": "private", "original_string": "private long timestamp;", "type": "long", "var_name": "timestamp" } ], "file": "phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/filter/NewerTimestampFilter.java", "identi...
{ "body": "@Override\n public ReturnCode filterKeyValue(Cell ignored) {\n return ignored.getTimestamp() > timestamp ? ReturnCode.SKIP : ReturnCode.INCLUDE;\n }", "class_method_signature": "NewerTimestampFilter.filterKeyValue(Cell ignored)", "constructor": false, "full_signature": "@Override public ReturnCo...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_134
{ "fields": [ { "declarator": "overAllQueryMetrics", "modifier": "private", "original_string": "private OverAllQueryMetrics overAllQueryMetrics;", "type": "OverAllQueryMetrics", "var_name": "overAllQueryMetrics" }, { "declarator": "numParallelScans = 10L", "modifi...
{ "body": "@Test\n public void testNoOpRequestMetricsIfRequestMetricsDisabled() {\n OverAllQueryMetrics noOpMetrics = new OverAllQueryMetrics(false, LogLevel.OFF);\n populateMetrics(noOpMetrics, numParallelScans, queryTimeouts, queryFailures,\n cacheRefreshesDueToSplits);\n Map<...
{ "fields": [ { "declarator": "queryWatch", "modifier": "private final", "original_string": "private final MetricsStopWatch queryWatch;", "type": "MetricsStopWatch", "var_name": "queryWatch" }, { "declarator": "resultSetWatch", "modifier": "private final", "...
{ "body": "public Map<MetricType, Long> publish() {\n Map<MetricType, Long> metricsForPublish = new HashMap<>();\n metricsForPublish.put(numParallelScans.getMetricType(), numParallelScans.getValue());\n metricsForPublish.put(wallClockTimeMS.getMetricType(), wallClockTimeMS.getValue());\n m...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_21
{ "fields": [ { "declarator": "MIN_VALUE = 1", "modifier": "private static", "original_string": "private static long MIN_VALUE = 1;", "type": "long", "var_name": "MIN_VALUE" }, { "declarator": "MAX_VALUE = 10", "modifier": "private static", "original_string"...
{ "body": "@Test\n public void testAscendingOverflow() throws SQLException {\n assertTrue(SequenceUtil.checkIfLimitReached(Long.MAX_VALUE, 0, Long.MAX_VALUE, 1/* incrementBy */, CACHE_SIZE));\n }", "class_method_signature": "SequenceUtilTest.testAscendingOverflow()", "constructor": false, "full_sig...
{ "fields": [ { "declarator": "DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L", "modifier": "public static final", "original_string": "public static final long DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L;", "type": "long", "var_name": "DEFAULT_NUM_SLOTS_TO_ALLOCATE" } ], "file": "phoenix-core/src...
{ "body": "public static boolean checkIfLimitReached(long currentValue, long minValue, long maxValue,\n long incrementBy, long cacheSize, long numToAllocate) {\n long nextValue = 0;\n boolean increasingSeq = incrementBy > 0 ? true : false;\n // advance currentValue while checking for o...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_4
{ "fields": [ { "declarator": "mockParser", "modifier": "@Mock\n private static", "original_string": "@Mock\n private static XMLConfigParser mockParser;", "type": "XMLConfigParser", "var_name": "mockParser" }, { "declarator": "mockDMR", "modifier": "@Mock\n ...
{ "body": "@Test\n public void testFinishWithoutTimeout() throws Exception {\n DefaultEnvironmentEdge myClock = Mockito.mock(DefaultEnvironmentEdge.class);\n Mockito.when(myClock.currentTime()).thenReturn(0L);\n EnvironmentEdgeManager.injectEdge(myClock);\n try {\n Mockito.wh...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MultiThreadedRunner.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MultiThreadedRunner.class);", "type": "Logger", "var_name": "LOGGER" }...
{ "body": "@VisibleForTesting\n /**\n * @return a Pair whose first value is the resultRowCount, and whose second value is whether the query timed out.\n */\n Pair<Long, Long> getResults(ResultSet rs, String queryIteration, boolean isSelectCountStatement, Long queryStartTime) throws Exception {\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_163
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/cache/JodaTimezoneCacheTest.java", "identifier": "JodaTimezoneCacheTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetInstanceString() {\n DateTimeZone instance = JodaTimezoneCache.getInstance(\"America/St_Vincent\");\n assertNotNull(instance);\n }", "class_method_signature": "JodaTimezoneCacheTest.testGetInstanceString()", "constructor": false, "full_signature": "@Test...
{ "fields": [ { "declarator": "CACHE_EXPRIRE_TIME_MINUTES = 10", "modifier": "public static final", "original_string": "public static final int CACHE_EXPRIRE_TIME_MINUTES = 10;", "type": "int", "var_name": "CACHE_EXPRIRE_TIME_MINUTES" }, { "declarator": "cachedJodaTimeZ...
{ "body": "public static DateTimeZone getInstance(ByteBuffer timezoneId) {\n try {\n return cachedJodaTimeZones.get(timezoneId);\n } catch (ExecutionException ex) {\n throw new IllegalDataException(ex);\n } catch (UncheckedExecutionException e) {\n throw new Illeg...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_76
{ "fields": [ { "declarator": "ONE_HOUR_IN_MILLIS = 1000L * 60L * 60L", "modifier": "private static final", "original_string": "private static final long ONE_HOUR_IN_MILLIS = 1000L * 60L * 60L;", "type": "long", "var_name": "ONE_HOUR_IN_MILLIS" } ], "file": "phoenix-core/src/...
{ "body": "@Test(expected = IllegalDataException.class)\n public void testParseDate_InvalidDate() {\n DateUtil.parseDate(\"not-a-date\");\n }", "class_method_signature": "DateUtilTest.testParseDate_InvalidDate()", "constructor": false, "full_signature": "@Test(expected = IllegalDataException.class)...
{ "fields": [ { "declarator": "DEFAULT_TIME_ZONE_ID = \"GMT\"", "modifier": "public static final", "original_string": "public static final String DEFAULT_TIME_ZONE_ID = \"GMT\";", "type": "String", "var_name": "DEFAULT_TIME_ZONE_ID" }, { "declarator": "LOCAL_TIME_ZONE_I...
{ "body": "public static Date parseDate(String dateValue) {\n return new Date(parseDateTime(dateValue));\n }", "class_method_signature": "DateUtil.parseDate(String dateValue)", "constructor": false, "full_signature": "public static Date parseDate(String dateValue)", "identifier": "parseDate", "inv...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_99
{ "fields": [ { "declarator": "bytesA = Bytes.toBytes(\"a\")", "modifier": "", "original_string": "byte[] bytesA = Bytes.toBytes(\"a\");", "type": "byte[]", "var_name": "bytesA" }, { "declarator": "bytesB = Bytes.toBytes(\"b\")", "modifier": "", "original_st...
{ "body": "@Test\n public void testMergeBars() {\n EquiDepthStreamHistogram histo = new EquiDepthStreamHistogram(2, 1);\n // test merge of two bars\n histo.bars.add(a_b);\n histo.bars.add(b_c);\n histo.bars.add(c_d);\n histo.bars.add(d_e);\n histo.totalCount = 20; /...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(EquiDepthStreamHistogram.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(EquiDepthStreamHistogram.class);", "type": "Logger", "var_name": "LOG...
{ "body": "@VisibleForTesting\n boolean mergeBars() {\n Preconditions.checkState(bars.size() > 1, \"Need at least two bars to merge\");\n // pairwise search for the two bars with the smallest summed count\n int currIdx = 0;\n Bar currBar = bars.get(currIdx);\n Bar nextBar = bars....
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_118
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/hbase/index/util/TestIndexManagementUtil.java", "identifier": "TestIndexManagementUtil", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalStateException.class)\n public void testCompressedWALWithHLogReader() throws Exception {\n Configuration conf = new Configuration(false);\n conf.setBoolean(HConstants.ENABLE_WAL_COMPRESSION, true);\n // works with WALEditcodec\n conf.set(IndexManagementUtil.HLOG_READER_...
{ "fields": [ { "declarator": "INDEX_WAL_EDIT_CODEC_CLASS_NAME = \"org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec\"", "modifier": "public static final", "original_string": "public static final String INDEX_WAL_EDIT_CODEC_CLASS_NAME = \"org.apache.hadoop.hbase.regionserver.wal.Index...
{ "body": "public static void ensureMutableIndexingCorrectlyConfigured(Configuration conf) throws IllegalStateException {\n\n // check to see if the WALEditCodec is installed\n if (isWALEditCodecSet(conf)) { return; }\n\n // otherwise, we have to install the indexedhlogreader, but it cannot have ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_159
{ "fields": [ { "declarator": "TABLE_NAME = TableName.create(null,\"TABLE1\")", "modifier": "private static", "original_string": "private static TableName TABLE_NAME = TableName.create(null,\"TABLE1\");", "type": "TableName", "var_name": "TABLE_NAME" }, { "declarator": ...
{ "body": "@Test\n public void buildListOfRowKeyColumnExpressionsSingleNodeIsNullTest() throws Exception {\n List<Expression> expressions = new ArrayList<>();\n\n RowKeyColumnExpression rvc = new RowKeyColumnExpression();\n\n IsNullExpression expression = mock(IsNullExpression.class);\n\n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(RVCOffsetCompiler.class)", "modifier": "private final static", "original_string": "private final static Logger LOGGER = LoggerFactory.getLogger(RVCOffsetCompiler.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@VisibleForTesting\n RowKeyColumnExpressionOutput buildListOfRowKeyColumnExpressions (\n Expression whereExpression, boolean isIndex)\n throws RowValueConstructorOffsetNotCoercibleException, RowValueConstructorOffsetInternalErrorException {\n\n boolean trailingNull = false;\...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_158
{ "fields": [ { "declarator": "TABLE_NAME = TableName.create(null,\"TABLE1\")", "modifier": "private static", "original_string": "private static TableName TABLE_NAME = TableName.create(null,\"TABLE1\");", "type": "TableName", "var_name": "TABLE_NAME" }, { "declarator": ...
{ "body": "@Test\n public void buildListOfRowKeyColumnExpressionsSingleNodeComparisonTest() throws Exception {\n List<Expression> expressions = new ArrayList<>();\n\n RowKeyColumnExpression rvc = new RowKeyColumnExpression();\n\n ComparisonExpression expression = mock(ComparisonExpression.clas...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(RVCOffsetCompiler.class)", "modifier": "private final static", "original_string": "private final static Logger LOGGER = LoggerFactory.getLogger(RVCOffsetCompiler.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@VisibleForTesting\n RowKeyColumnExpressionOutput buildListOfRowKeyColumnExpressions (\n Expression whereExpression, boolean isIndex)\n throws RowValueConstructorOffsetNotCoercibleException, RowValueConstructorOffsetInternalErrorException {\n\n boolean trailingNull = false;\...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_119
{ "fields": [ { "declarator": "TEST_TABLE_STRING = \"TEST_TABLE\"", "modifier": "private static final", "original_string": "private static final String TEST_TABLE_STRING = \"TEST_TABLE\";", "type": "String", "var_name": "TEST_TABLE_STRING" }, { "declarator": "TEST_TABLE...
{ "body": "@Test\n public void testGetMutableIndexUpdate() throws IOException {\n setCurrentRowState(FAM, INDEXED_QUALIFIER, 1, VALUE_1);\n\n // update ts and value\n Put put = new Put(ROW);\n put.addImmutable(FAM, INDEXED_QUALIFIER, 2, VALUE_2);\n MultiMutation mutation = new Mu...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(NonTxIndexBuilder.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(NonTxIndexBuilder.class);", "type": "Logger", "var_name": "LOGGER" } ]...
{ "body": "@Override\n public Collection<Pair<Mutation, byte[]>> getIndexUpdate(Mutation mutation, IndexMetaData indexMetaData, LocalHBaseState localHBaseState) throws IOException {\n \t// create a state manager, so we can manage each batch\n LocalTableState state = new LocalTableState(localHBaseState, m...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_162
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/cache/JodaTimezoneCacheTest.java", "identifier": "JodaTimezoneCacheTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetInstanceByteBufferUTC() {\n DateTimeZone instance = JodaTimezoneCache.getInstance(ByteBuffer.wrap(Bytes.toBytes(\"UTC\")));\n assertNotNull(instance);\n }", "class_method_signature": "JodaTimezoneCacheTest.testGetInstanceByteBufferUTC()", "constructor": fa...
{ "fields": [ { "declarator": "CACHE_EXPRIRE_TIME_MINUTES = 10", "modifier": "public static final", "original_string": "public static final int CACHE_EXPRIRE_TIME_MINUTES = 10;", "type": "int", "var_name": "CACHE_EXPRIRE_TIME_MINUTES" }, { "declarator": "cachedJodaTimeZ...
{ "body": "public static DateTimeZone getInstance(ByteBuffer timezoneId) {\n try {\n return cachedJodaTimeZones.get(timezoneId);\n } catch (ExecutionException ex) {\n throw new IllegalDataException(ex);\n } catch (UncheckedExecutionException e) {\n throw new Illeg...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_77
{ "fields": [ { "declarator": "ONE_HOUR_IN_MILLIS = 1000L * 60L * 60L", "modifier": "private static final", "original_string": "private static final long ONE_HOUR_IN_MILLIS = 1000L * 60L * 60L;", "type": "long", "var_name": "ONE_HOUR_IN_MILLIS" } ], "file": "phoenix-core/src/...
{ "body": "@Test\n public void testParseTime() {\n assertEquals(10000L, DateUtil.parseTime(\"1970-01-01 00:00:10\").getTime());\n }", "class_method_signature": "DateUtilTest.testParseTime()", "constructor": false, "full_signature": "@Test public void testParseTime()", "identifier": "testParseTime...
{ "fields": [ { "declarator": "DEFAULT_TIME_ZONE_ID = \"GMT\"", "modifier": "public static final", "original_string": "public static final String DEFAULT_TIME_ZONE_ID = \"GMT\";", "type": "String", "var_name": "DEFAULT_TIME_ZONE_ID" }, { "declarator": "LOCAL_TIME_ZONE_I...
{ "body": "public static Time parseTime(String timeValue) {\n return new Time(parseDateTime(timeValue));\n }", "class_method_signature": "DateUtil.parseTime(String timeValue)", "constructor": false, "full_signature": "public static Time parseTime(String timeValue)", "identifier": "parseTime", "inv...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_98
{ "fields": [ { "declarator": "bytesA = Bytes.toBytes(\"a\")", "modifier": "", "original_string": "byte[] bytesA = Bytes.toBytes(\"a\");", "type": "byte[]", "var_name": "bytesA" }, { "declarator": "bytesB = Bytes.toBytes(\"b\")", "modifier": "", "original_st...
{ "body": "@Test\n public void testGetBar() {\n EquiDepthStreamHistogram histo = new EquiDepthStreamHistogram(10);\n Bar bar = histo.getBar(bytesB);\n assertTrue(Arrays.equals(bytesB, bar.getLeftBoundInclusive()));\n assertEquals(1, histo.bars.size());\n assertTrue(bar == histo.g...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(EquiDepthStreamHistogram.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(EquiDepthStreamHistogram.class);", "type": "Logger", "var_name": "LOG...
{ "body": "@VisibleForTesting\n Bar getBar(byte[] value) {\n Bar searchKey = new Bar(value, value);\n int searchIdx = Collections.binarySearch(this.bars, searchKey);\n if (searchIdx < 0) {\n // copy value so later changes by caller don't affect histogram results\n byte[] ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_135
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/monitoring/MetricUtilTest.java", "identifier": "MetricUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetMetricsStopWatchWithMetricsTrue() throws Exception {\n MetricsStopWatch metricsStopWatch = MetricUtil.getMetricsStopWatch(true,\n LogLevel.OFF, WALL_CLOCK_TIME_MS);\n assertTrue(metricsStopWatch.getMetricsEnabled());\n metricsStopWatch.start...
{ "fields": [], "file": "phoenix-core/src/main/java/org/apache/phoenix/monitoring/MetricUtil.java", "identifier": "MetricUtil", "interfaces": "", "methods": [ { "class_method_signature": "MetricUtil.getCombinableMetric(boolean isRequestMetricsEnabled,\n ...
{ "body": "public static MetricsStopWatch getMetricsStopWatch(boolean isRequestMetricsEnabled,\n LogLevel connectionLogLevel,\n MetricType type) {\n if(!type.isLoggingEnabled(connectionLogLevel) && !isRe...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_20
{ "fields": [ { "declarator": "MIN_VALUE = 1", "modifier": "private static", "original_string": "private static long MIN_VALUE = 1;", "type": "long", "var_name": "MIN_VALUE" }, { "declarator": "MAX_VALUE = 10", "modifier": "private static", "original_string"...
{ "body": "@Test\n public void testAscendingNextValueGreaterThanMaxValue() throws SQLException {\n assertTrue(SequenceUtil.checkIfLimitReached(MAX_VALUE, MIN_VALUE, MAX_VALUE, 2/* incrementBy */, CACHE_SIZE));\n }", "class_method_signature": "SequenceUtilTest.testAscendingNextValueGreaterThanMaxValue()...
{ "fields": [ { "declarator": "DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L", "modifier": "public static final", "original_string": "public static final long DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L;", "type": "long", "var_name": "DEFAULT_NUM_SLOTS_TO_ALLOCATE" } ], "file": "phoenix-core/src...
{ "body": "public static boolean checkIfLimitReached(long currentValue, long minValue, long maxValue,\n long incrementBy, long cacheSize, long numToAllocate) {\n long nextValue = 0;\n boolean increasingSeq = incrementBy > 0 ? true : false;\n // advance currentValue while checking for o...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_5
{ "fields": [ { "declarator": "generator", "modifier": "", "original_string": "SequentialIntegerDataGenerator generator;", "type": "SequentialIntegerDataGenerator", "var_name": "generator" } ], "file": "phoenix-pherf/src/test/java/org/apache/phoenix/pherf/rules/SequentialInte...
{ "body": "@Test\n public void testGetDataValue() {\n Column columnA = new Column();\n columnA.setType(INTEGER);\n columnA.setDataSequence(DataSequence.SEQUENTIAL);\n columnA.setMinValue(1);\n columnA.setMaxValue(3);\n\n generator = new SequentialIntegerDataGenerator(colum...
{ "fields": [ { "declarator": "columnRule", "modifier": "private final", "original_string": "private final Column columnRule;", "type": "Column", "var_name": "columnRule" }, { "declarator": "counter", "modifier": "private final", "original_string": "private ...
{ "body": "@Override\n public DataValue getDataValue() {\n return new DataValue(columnRule.getType(), String.valueOf((counter.getAndIncrement() % (maxValue - minValue + 1)) + minValue));\n }", "class_method_signature": "SequentialIntegerDataGenerator.getDataValue()", "constructor": false, "full_sig...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_36
{ "fields": [ { "declarator": "SOME_TENANT_ID = \"00Dxx0000001234\"", "modifier": "private static final", "original_string": "private static final String SOME_TENANT_ID = \"00Dxx0000001234\";", "type": "String", "var_name": "SOME_TENANT_ID" }, { "declarator": "SOME_OTHE...
{ "body": "@Test\n public void testCopyFromConfiguration() throws Exception{\n //make sure that we don't only copy the ZK quorum, but all\n //properties\n final Configuration conf = HBaseConfiguration.create();\n final Properties props = new Properties();\n \n conf.set(HCo...
{ "fields": [], "file": "phoenix-core/src/main/java/org/apache/phoenix/util/PropertiesUtil.java", "identifier": "PropertiesUtil", "interfaces": "", "methods": [ { "class_method_signature": "PropertiesUtil.PropertiesUtil()", "constructor": true, "full_signature": "private PropertiesUtil(...
{ "body": "public static Properties combineProperties(Properties props, final Configuration conf) {\n return combineProperties(props, conf, Collections.<String>emptySet());\n }", "class_method_signature": "PropertiesUtil.combineProperties(Properties props, final Configuration conf)", "constructor": fals...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_123
{ "fields": [ { "declarator": "EMPTY_SET = Collections\n .<ImmutableBytesPtr> emptySet()", "modifier": "private static final", "original_string": "private static final Set<ImmutableBytesPtr> EMPTY_SET = Collections\n .<ImmutableBytesPtr> emptySet();", "type": "Set<ImmutableBytesP...
{ "body": "@Test\n public void testCoveringPointDelete() {\n // start with doing a family delete, so we will seek to the next column\n KeyValue kv = createKvForType(Type.Delete);\n ApplyAndFilterDeletesFilter filter = new ApplyAndFilterDeletesFilter(EMPTY_SET);\n filter.filterKeyValue(kv);\n KeyValue ...
{ "fields": [ { "declarator": "families", "modifier": "", "original_string": "List<ImmutableBytesPtr> families;", "type": "List<ImmutableBytesPtr>", "var_name": "families" }, { "declarator": "coveringDelete = new DeleteTracker()", "modifier": "private final", ...
{ "body": "@Override\n public ReturnCode filterKeyValue(Cell next) {\n KeyValue nextKV = PhoenixKeyValueUtil.maybeCopyCell(next);\n switch (KeyValue.Type.codeToType(next.getTypeByte())) {\n /*\n * DeleteFamily will always sort first because those KVs (we assume) don't have qualifiers (or\n * rather ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_61
{ "fields": [ { "declarator": "ID_COLUMN = new ColumnInfo(\"ID\", Types.BIGINT)", "modifier": "private static final", "original_string": "private static final ColumnInfo ID_COLUMN = new ColumnInfo(\"ID\", Types.BIGINT);", "type": "ColumnInfo", "var_name": "ID_COLUMN" }, { ...
{ "body": "@Test\n public void testConstructSelectStatementWithCaseSensitiveSchema() {\n final String tableName = \"MYTAB\";\n final String schemaName = SchemaUtil.getEscapedArgument(\"a\");\n final String fullTableName = SchemaUtil.getTableName(schemaName, tableName);\n assertEquals(\n...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(QueryUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(QueryUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { "decla...
{ "body": "public static String constructSelectStatement(String fullTableName, List<ColumnInfo> columnInfos,final String conditions) {\n List<String> columns = Lists.transform(columnInfos, new Function<ColumnInfo, String>(){\n @Override\n public String apply(ColumnInfo input) {\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_174
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/schema/SaltingUtilTest.java", "identifier": "SaltingUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetSaltingByte() {\n Set<Byte> saltBytes = Sets.newHashSet();\n for (int i = 0; i < 100; i++) {\n saltBytes.add(SaltingUtil.getSaltingByte(Bytes.toBytes(i), 0, Bytes.SIZEOF_INT, 3));\n }\n assertEquals(ImmutableSet.of((byte)0, (byte)1, (byte...
{ "fields": [ { "declarator": "NUM_SALTING_BYTES = 1", "modifier": "public static final", "original_string": "public static final int NUM_SALTING_BYTES = 1;", "type": "int", "var_name": "NUM_SALTING_BYTES" }, { "declarator": "MAX_BUCKET_NUM = 256", "modifier": "pu...
{ "body": "public static byte getSaltingByte(byte[] value, int offset, int length, int bucketNum) {\n int hash = calculateHashCode(value, offset, length);\n return (byte) Math.abs(hash % bucketNum);\n }", "class_method_signature": "SaltingUtil.getSaltingByte(byte[] value, int offset, int length, in...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_16
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/PhoenixRuntimeTest.java", "identifier": "PhoenixRuntimeTest", "interfaces": "", "superclass": "extends BaseConnectionlessQueryTest" }
{ "body": "@Test\n public void testGetTenantIdExpression() throws Exception {\n Connection conn = DriverManager.getConnection(getUrl());\n Expression e1 = PhoenixRuntime.getTenantIdExpression(conn, PhoenixDatabaseMetaData.SYSTEM_STATS_NAME);\n assertNull(e1);\n Expression e2 = PhoenixRu...
{ "fields": [ { "declarator": "JDBC_PROTOCOL = \"jdbc:phoenix\"", "modifier": "public final static", "original_string": "public final static String JDBC_PROTOCOL = \"jdbc:phoenix\";", "type": "String", "var_name": "JDBC_PROTOCOL" }, { "declarator": "JDBC_THIN_PROTOCOL =...
{ "body": "public static Expression getTenantIdExpression(Connection conn, String fullTableName) throws SQLException {\n PTable table = getTable(conn, fullTableName);\n // TODO: consider setting MULTI_TENANT = true for SYSTEM.CATALOG and SYSTEM.SEQUENCE\n if (!SchemaUtil.isMetaTable(table) && !Sc...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_41
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/JDBCUtilTest.java", "identifier": "JDBCUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetAutoCommit_NotSpecified_DefaultTrue() {\n assertTrue(JDBCUtil.getAutoCommit(\"localhost\", new Properties(), true));\n }", "class_method_signature": "JDBCUtilTest.testGetAutoCommit_NotSpecified_DefaultTrue()", "constructor": false, "full_signature": "@Test publ...
{ "fields": [], "file": "phoenix-core/src/main/java/org/apache/phoenix/util/JDBCUtil.java", "identifier": "JDBCUtil", "interfaces": "", "methods": [ { "class_method_signature": "JDBCUtil.JDBCUtil()", "constructor": true, "full_signature": "private JDBCUtil()", "identifier": "JDBCU...
{ "body": "public static boolean getAutoCommit(String url, Properties info, boolean defaultValue) {\n String autoCommit = findProperty(url, info, PhoenixRuntime.AUTO_COMMIT_ATTRIB);\n if (autoCommit == null) {\n return defaultValue;\n }\n return Boolean.valueOf(autoCommit);\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_154
{ "fields": [ { "declarator": "TABLE_NAME = TableName.create(null,\"TABLE1\")", "modifier": "private static", "original_string": "private static TableName TABLE_NAME = TableName.create(null,\"TABLE1\");", "type": "TableName", "var_name": "TABLE_NAME" }, { "declarator": ...
{ "body": "@Test\n public void buildListOfColumnParseNodesTest() throws Exception {\n List<ParseNode> children = new ArrayList<>();\n ColumnParseNode col1 = new ColumnParseNode(TABLE_NAME,\"col1\");\n ColumnParseNode col2 = new ColumnParseNode(TABLE_NAME,\"col2\");\n\n children.add(col1...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(RVCOffsetCompiler.class)", "modifier": "private final static", "original_string": "private final static Logger LOGGER = LoggerFactory.getLogger(RVCOffsetCompiler.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@VisibleForTesting List<ColumnParseNode> buildListOfColumnParseNodes(\n RowValueConstructorParseNode rvcColumnsParseNode, boolean isIndex)\n throws RowValueConstructorOffsetNotCoercibleException {\n List<ColumnParseNode> nodes = new ArrayList<ColumnParseNode>();\n for (P...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_142
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/mapreduce/FormatToBytesWritableMapperTest.java", "identifier": "FormatToBytesWritableMapperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testBuildColumnInfoList() {\n List<ColumnInfo> columnInfoList = ImmutableList.of(\n new ColumnInfo(\"idCol\", PInteger.INSTANCE.getSqlType()),\n new ColumnInfo(\"unsignedIntCol\", PUnsignedInt.INSTANCE.getSqlType()),\n new ColumnInf...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(FormatToBytesWritableMapper.class)", "modifier": "protected static final", "original_string": "protected static final Logger LOGGER = LoggerFactory.getLogger(FormatToBytesWritableMapper.class);", "type": "Logger", "var_n...
{ "body": "@VisibleForTesting\n static List<ColumnInfo> buildColumnInfoList(Configuration conf) {\n\n return Lists.newArrayList(\n Iterables.transform(\n Splitter.on(\"|\").split(conf.get(COLUMN_INFO_CONFKEY)),\n new Function<String, ColumnInfo>()...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_57
{ "fields": [ { "declarator": "ID_COLUMN = new ColumnInfo(\"ID\", Types.BIGINT)", "modifier": "private static final", "original_string": "private static final ColumnInfo ID_COLUMN = new ColumnInfo(\"ID\", Types.BIGINT);", "type": "ColumnInfo", "var_name": "ID_COLUMN" }, { ...
{ "body": "@Test\n public void testConstructGenericUpsertStatement() {\n assertEquals(\n \"UPSERT INTO MYTAB VALUES (?, ?)\",\n QueryUtil.constructGenericUpsertStatement(\"MYTAB\", 2));\n }", "class_method_signature": "QueryUtilTest.testConstructGenericUpsertStatement()", ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(QueryUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(QueryUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { "decla...
{ "body": "public static String constructGenericUpsertStatement(String tableName, int numColumns) {\n\n\n if (numColumns == 0) {\n throw new IllegalArgumentException(\"At least one column must be provided for upserts\");\n }\n\n List<String> parameterList = Lists.newArrayListWithCapaci...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_115
{ "fields": [ { "declarator": "testCache = null", "modifier": "static", "original_string": "static GuidePostsCache testCache = null;", "type": "GuidePostsCache", "var_name": "testCache" }, { "declarator": "phoenixStatsLoader = null", "modifier": "static", "o...
{ "body": "@Test\n public void getGuidePostsCacheWrapper(){\n testCache = Mockito.mock(GuidePostsCache.class);\n ConnectionQueryServices mockQueryServices = Mockito.mock(ConnectionQueryServices.class);\n Configuration mockConfiguration = Mockito.mock(Configuration.class);\n GuidePostsCa...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(GuidePostsCacheProvider.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(GuidePostsCacheProvider.class);", "type": "Logger", "var_name": "LOGGE...
{ "body": "public GuidePostsCacheWrapper getGuidePostsCache(String classStr, ConnectionQueryServices queryServices,\n Configuration config) {\n ReadOnlyProps props = null;\n if (queryServices != null) {\n props = queryServices.getProps();\n }\n GuidePostsCacheFactory ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_181
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/schema/types/PDataTypeTest.java", "identifier": "PDataTypeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIntVersusLong() {\n long l = -1L;\n int i = -1;\n assertTrue(PLong.INSTANCE.compareTo(l, i, PInteger.INSTANCE)==0);\n assertTrue(PInteger.INSTANCE.compareTo(i, l, PLong.INSTANCE)==0);\n }", "class_method_signature": "PDataTypeTest.testIntVersusLon...
{ "fields": [ { "declarator": "sqlTypeName", "modifier": "private final", "original_string": "private final String sqlTypeName;", "type": "String", "var_name": "sqlTypeName" }, { "declarator": "sqlType", "modifier": "private final", "original_string": "priva...
{ "body": "public final int compareTo(byte[] lhs, int lhsOffset, int lhsLength, SortOrder lhsSortOrder, byte[] rhs,\n int rhsOffset, int rhsLength, SortOrder rhsSortOrder, PDataType rhsType) {\n Preconditions.checkNotNull(lhsSortOrder);\n Preconditions.checkNotNull(rhsSortOrder);\n if ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_94
{ "fields": [ { "declarator": "ROW = Bytes.toBytes(\"row\")", "modifier": "private static final", "original_string": "private static final byte[] ROW = Bytes.toBytes(\"row\");", "type": "byte[]", "var_name": "ROW" }, { "declarator": "QUALIFIER = Bytes.toBytes(\"qual\")"...
{ "body": "@Test\n public void testConditionallyAddTagsToPutCells( ) {\n List<Tag> tags = TagUtil.asList(VIEW_MODIFIED_PROPERTY_BYTES, 0, VIEW_MODIFIED_PROPERTY_BYTES.length);\n assertEquals(tags.size(), 1);\n Tag expectedTag = tags.get(0);\n\n String version = VersionInfo.getVersion();...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MetaDataUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MetaDataUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public static void conditionallyAddTagsToPutCells(Put somePut, byte[] family, byte[] qualifier,\n ExtendedCellBuilder cellBuilder, byte[] valueArray, byte[] tagArray) {\n NavigableMap<byte[], List<Cell>> familyCellMap = somePut.getFamilyCellMap();\n List<Cell> cells = familyCellMap...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_139
{ "fields": [ { "declarator": "exceptionRule = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException exceptionRule = ExpectedException.none();", "type": "ExpectedException", "var_name": "exceptionRule" } ], "file":...
{ "body": "@Test\n public void testJoinIntArrays() {\n // simple case\n int[] a = new int[] {1};\n int[] b = new int[] {2};\n int[] result = joinSortedIntArrays(a, b);\n \n assertEquals(2, result.length);\n assertArrayEquals(new int[] {1,2}, result);\n \n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MutationState.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MutationState.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public static int[] joinSortedIntArrays(int[] a, int[] b) {\n int[] result = new int[a.length + b.length];\n int i = 0, j = 0, k = 0, current;\n while (i < a.length && j < b.length) {\n current = a[i] < b[j] ? a[i++] : b[j++];\n for (; i < a.length && a[i] == curr...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_9
{ "fields": [ { "declarator": "exit = ExpectedSystemExit.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedSystemExit exit = ExpectedSystemExit.none();", "type": "ExpectedSystemExit", "var_name": "exit" } ], "file": "phoenix-p...
{ "body": "@Test\n public void testCustomizedLogPerNRowsArgument() throws Exception {\n Long customizedPerNRows = 15l;\n String[] args = {\"-listFiles\", \"-log_per_nrows\", customizedPerNRows.toString()};\n assertEquals(customizedPerNRows,\n getLogPerNRowsValue(new Pherf(args)....
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(Pherf.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Pherf.class);", "type": "Logger", "var_name": "LOGGER" }, { "declarator": ...
{ "body": "public Properties getProperties() {\n return this.properties;\n }", "class_method_signature": "Pherf.getProperties()", "constructor": false, "full_signature": "public Properties getProperties()", "identifier": "getProperties", "invocations": [], "modifiers": "public", "parameters": ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_178
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/schema/types/PDataTypeTest.java", "identifier": "PDataTypeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIllegalUnsignedDateTime() {\n Date date1 = new Date(-1000);\n try {\n PUnsignedDate.INSTANCE.toBytes(date1);\n fail();\n } catch (RuntimeException e) {\n assertTrue(e.getCause() instanceof SQLException);\n SQLExcept...
{ "fields": [ { "declarator": "sqlTypeName", "modifier": "private final", "original_string": "private final String sqlTypeName;", "type": "String", "var_name": "sqlTypeName" }, { "declarator": "sqlType", "modifier": "private final", "original_string": "priva...
{ "body": "protected static int toBytes(BigDecimal v, byte[] result, final int offset, int length) {\n // From scale to exponent byte (if BigDecimal is positive): (-(scale+(scale % 2 == 0 : 0 : 1)) / 2 + 65) | 0x80\n // If scale % 2 is 1 (i.e. it's odd), then multiple last base-100 digit by 10\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_82
{ "fields": [ { "declarator": "ONE_HOUR_IN_MILLIS = 1000L * 60L * 60L", "modifier": "private static final", "original_string": "private static final long ONE_HOUR_IN_MILLIS = 1000L * 60L * 60L;", "type": "long", "var_name": "ONE_HOUR_IN_MILLIS" } ], "file": "phoenix-core/src/...
{ "body": "@Test(expected=IllegalDataException.class)\n public void testParseTimestamp_tooLargeNanos() {\n DateUtil.parseTimestamp(\"1970-01-01 00:00:10.9999999999\");\n }", "class_method_signature": "DateUtilTest.testParseTimestamp_tooLargeNanos()", "constructor": false, "full_signature": "@Test(e...
{ "fields": [ { "declarator": "DEFAULT_TIME_ZONE_ID = \"GMT\"", "modifier": "public static final", "original_string": "public static final String DEFAULT_TIME_ZONE_ID = \"GMT\";", "type": "String", "var_name": "DEFAULT_TIME_ZONE_ID" }, { "declarator": "LOCAL_TIME_ZONE_I...
{ "body": "public static Timestamp parseTimestamp(String timestampValue) {\n Timestamp timestamp = new Timestamp(parseDateTime(timestampValue));\n int period = timestampValue.indexOf('.');\n if (period > 0) {\n String nanosStr = timestampValue.substring(period + 1);\n if (na...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_197
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/expression/rewrite/RowValueConstructorExpressionRewriterTest.java", "identifier": "RowValueConstructorExpressionRewriterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRewriteAllChildrenAsc() throws SQLException {\n\n\n Expression ascChild = Mockito.mock(Expression.class);\n Mockito.when(ascChild.getSortOrder()).thenReturn(SortOrder.ASC);\n Mockito.when(ascChild.getDataType()).thenReturn(PFloat.INSTANCE);\n Mockito.w...
{ "fields": [ { "declarator": "singleton = null", "modifier": "static", "original_string": "static RowValueConstructorExpressionRewriter singleton = null;", "type": "RowValueConstructorExpressionRewriter", "var_name": "singleton" } ], "file": "phoenix-core/src/main/java/org/a...
{ "body": "public RowValueConstructorExpression rewriteAllChildrenAsc(\n RowValueConstructorExpression rvcExpression) throws SQLException {\n List<Expression> replacementChildren = new ArrayList<>(rvcExpression.getChildren().size());\n for (int i = 0; i < rvcExpression.getChildren().size(); i...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_66
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/StringUtilTest.java", "identifier": "StringUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCalculateUTF8Offset() throws Exception {\n String tmp, padding = \"padding\", data = \"零一二三四五六七八九\", trailing = \"trailing\";\n byte[] bytes = (padding + data + trailing).getBytes();\n int ret, offset = padding.getBytes().length, length = data.getBytes().leng...
{ "fields": [ { "declarator": "EMPTY_STRING = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY_STRING = \"\";", "type": "String", "var_name": "EMPTY_STRING" }, { "declarator": "SPACE_UTF8 = 0x20", "modifier": "public s...
{ "body": "public static int calculateUTF8Offset(byte[] bytes, int offset, int length,\n SortOrder sortOrder, int offsetInStr) {\n if (offsetInStr == 0) return offset;\n int ret, range = offset + length;\n if (offsetInStr > 0) {\n ret = offset;\n while (offsetInSt...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_173
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/schema/SequenceAllocationTest.java", "identifier": "SequenceAllocationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n /**\n * Validates that sorting a List of SequenceAllocation instances\n * results in the same sort order as sorting SequenceKey instances.\n */\n public void testSortingSequenceAllocation() {\n \n // Arrange\n SequenceKey sequenceKey1 = new SequenceKey(null, \...
{ "fields": [ { "declarator": "sequenceKey", "modifier": "private final", "original_string": "private final SequenceKey sequenceKey;", "type": "SequenceKey", "var_name": "sequenceKey" }, { "declarator": "numAllocations", "modifier": "private final", "origina...
{ "body": "public SequenceKey getSequenceKey() {\n return sequenceKey;\n }", "class_method_signature": "SequenceAllocation.getSequenceKey()", "constructor": false, "full_signature": "public SequenceKey getSequenceKey()", "identifier": "getSequenceKey", "invocations": [], "modifiers": "public", ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_89
{ "fields": [ { "declarator": "ROW = Bytes.toBytes(\"row\")", "modifier": "private static final", "original_string": "private static final byte[] ROW = Bytes.toBytes(\"row\");", "type": "byte[]", "var_name": "ROW" }, { "declarator": "QUALIFIER = Bytes.toBytes(\"qual\")"...
{ "body": "@Test\n public void testTaggingAPutWrongQualifier() throws Exception {\n Put put = generateOriginalPut();\n Cell initialCell = put.get(TABLE_FAMILY_BYTES, QUALIFIER).get(0);\n\n // Different qualifier, so no tags should be set\n MetaDataUtil.conditionallyAddTagsToPutCells(put...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MetaDataUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MetaDataUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public static void conditionallyAddTagsToPutCells(Put somePut, byte[] family, byte[] qualifier,\n ExtendedCellBuilder cellBuilder, byte[] valueArray, byte[] tagArray) {\n NavigableMap<byte[], List<Cell>> familyCellMap = somePut.getFamilyCellMap();\n List<Cell> cells = familyCellMap...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_31
{ "fields": [ { "declarator": "MIN_VALUE = 1", "modifier": "private static", "original_string": "private static long MIN_VALUE = 1;", "type": "long", "var_name": "MIN_VALUE" }, { "declarator": "MAX_VALUE = 10", "modifier": "private static", "original_string"...
{ "body": "@Test\n public void testBulkAllocationDescendingNextValueReachLimit() throws SQLException {\n assertFalse(SequenceUtil.checkIfLimitReached(7, MIN_VALUE, MAX_VALUE, -2/* incrementBy */, CACHE_SIZE, 3));\n }", "class_method_signature": "SequenceUtilTest.testBulkAllocationDescendingNextValueRe...
{ "fields": [ { "declarator": "DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L", "modifier": "public static final", "original_string": "public static final long DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L;", "type": "long", "var_name": "DEFAULT_NUM_SLOTS_TO_ALLOCATE" } ], "file": "phoenix-core/src...
{ "body": "public static boolean checkIfLimitReached(long currentValue, long minValue, long maxValue,\n long incrementBy, long cacheSize, long numToAllocate) {\n long nextValue = 0;\n boolean increasingSeq = incrementBy > 0 ? true : false;\n // advance currentValue while checking for o...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_124
{ "fields": [ { "declarator": "EMPTY_SET = Collections\n .<ImmutableBytesPtr> emptySet()", "modifier": "private static final", "original_string": "private static final Set<ImmutableBytesPtr> EMPTY_SET = Collections\n .<ImmutableBytesPtr> emptySet();", "type": "Set<ImmutableBytesP...
{ "body": "@Test\n public void testDeleteColumnCorrectlyCoversColumns() {\n ApplyAndFilterDeletesFilter filter = new ApplyAndFilterDeletesFilter(EMPTY_SET);\n KeyValue d = createKvForType(Type.DeleteColumn, 12);\n byte[] qual2 = Bytes.add(qualifier, Bytes.toBytes(\"-other\"));\n KeyValue put = new KeyVal...
{ "fields": [ { "declarator": "families", "modifier": "", "original_string": "List<ImmutableBytesPtr> families;", "type": "List<ImmutableBytesPtr>", "var_name": "families" }, { "declarator": "coveringDelete = new DeleteTracker()", "modifier": "private final", ...
{ "body": "@Override\n public ReturnCode filterKeyValue(Cell next) {\n KeyValue nextKV = PhoenixKeyValueUtil.maybeCopyCell(next);\n switch (KeyValue.Type.codeToType(next.getTypeByte())) {\n /*\n * DeleteFamily will always sort first because those KVs (we assume) don't have qualifiers (or\n * rather ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_132
{ "fields": [ { "declarator": "overAllQueryMetrics", "modifier": "private", "original_string": "private OverAllQueryMetrics overAllQueryMetrics;", "type": "OverAllQueryMetrics", "var_name": "overAllQueryMetrics" }, { "declarator": "numParallelScans = 10L", "modifi...
{ "body": "@Test\n public void testReset() {\n assertPublishedMetrics(overAllQueryMetrics.publish(), numParallelScans, queryTimeouts,\n queryFailures, cacheRefreshesDueToSplits, 0L);\n overAllQueryMetrics.reset();\n assertPublishedMetrics(overAllQueryMetrics.publish(), 0L, 0L, 0...
{ "fields": [ { "declarator": "queryWatch", "modifier": "private final", "original_string": "private final MetricsStopWatch queryWatch;", "type": "MetricsStopWatch", "var_name": "queryWatch" }, { "declarator": "resultSetWatch", "modifier": "private final", "...
{ "body": "public void reset() {\n numParallelScans.reset();\n wallClockTimeMS.reset();\n resultSetTimeMS.reset();\n queryTimedOut.reset();\n queryFailed.reset();\n cacheRefreshedDueToSplits.reset();\n queryWatch.stop();\n resultSetWatch.stop();\n }", "clas...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_27
{ "fields": [ { "declarator": "MIN_VALUE = 1", "modifier": "private static", "original_string": "private static long MIN_VALUE = 1;", "type": "long", "var_name": "MIN_VALUE" }, { "declarator": "MAX_VALUE = 10", "modifier": "private static", "original_string"...
{ "body": "@Test\n public void testBulkAllocationAscendingNextValueReachLimit() throws SQLException {\n assertFalse(SequenceUtil.checkIfLimitReached(6, MIN_VALUE, MAX_VALUE, 2/* incrementBy */, CACHE_SIZE, 2));\n }", "class_method_signature": "SequenceUtilTest.testBulkAllocationAscendingNextValueReach...
{ "fields": [ { "declarator": "DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L", "modifier": "public static final", "original_string": "public static final long DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L;", "type": "long", "var_name": "DEFAULT_NUM_SLOTS_TO_ALLOCATE" } ], "file": "phoenix-core/src...
{ "body": "public static boolean checkIfLimitReached(long currentValue, long minValue, long maxValue,\n long incrementBy, long cacheSize, long numToAllocate) {\n long nextValue = 0;\n boolean increasingSeq = incrementBy > 0 ? true : false;\n // advance currentValue while checking for o...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_2
{ "fields": [ { "declarator": "mockParser", "modifier": "@Mock\n private static", "original_string": "@Mock\n private static XMLConfigParser mockParser;", "type": "XMLConfigParser", "var_name": "mockParser" }, { "declarator": "mockDMR", "modifier": "@Mock\n ...
{ "body": "@Test\n public void testExpectedRowsMismatch() throws Exception {\n Mockito.when(mockQuery.getExpectedAggregateRowCount()).thenReturn(1L);\n MultiThreadedRunner mtr = new MultiThreadedRunner(\"test\",\n mockQuery, mockDMR, mockTT,\n 10L, 1000L,\n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MultiThreadedRunner.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MultiThreadedRunner.class);", "type": "Logger", "var_name": "LOGGER" }...
{ "body": "@VisibleForTesting\n /**\n * @return a Pair whose first value is the resultRowCount, and whose second value is whether the query timed out.\n */\n Pair<Long, Long> getResults(ResultSet rs, String queryIteration, boolean isSelectCountStatement, Long queryStartTime) throws Exception {\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_165
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/cache/JodaTimezoneCacheTest.java", "identifier": "JodaTimezoneCacheTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetInstanceImmutableBytesWritable() {\n ImmutableBytesWritable ptr = new ImmutableBytesWritable(Bytes.toBytes(\"Europe/Isle_of_Man\"));\n DateTimeZone instance = JodaTimezoneCache.getInstance(ptr);\n assertNotNull(instance);\n }", "class_method_signature...
{ "fields": [ { "declarator": "CACHE_EXPRIRE_TIME_MINUTES = 10", "modifier": "public static final", "original_string": "public static final int CACHE_EXPRIRE_TIME_MINUTES = 10;", "type": "int", "var_name": "CACHE_EXPRIRE_TIME_MINUTES" }, { "declarator": "cachedJodaTimeZ...
{ "body": "public static DateTimeZone getInstance(ByteBuffer timezoneId) {\n try {\n return cachedJodaTimeZones.get(timezoneId);\n } catch (ExecutionException ex) {\n throw new IllegalDataException(ex);\n } catch (UncheckedExecutionException e) {\n throw new Illeg...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_70
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/PhoenixMRJobUtilTest.java", "identifier": "PhoenixMRJobUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetRMHostName(){\n Configuration config = HBaseConfiguration.create();\n String testRMAddress = \"testRMhostName:portnumber\";\n\n String address = PhoenixMRJobUtil.getRMWebAddress(config);\n assertEquals(YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS, ad...
{ "fields": [ { "declarator": "YARN_LEADER_ELECTION = \"/yarn-leader-election\"", "modifier": "private static final", "original_string": "private static final String YARN_LEADER_ELECTION = \"/yarn-leader-election\";", "type": "String", "var_name": "YARN_LEADER_ELECTION" }, { ...
{ "body": "public static String getRMWebAddress(Configuration config){\n return config.get(YarnConfiguration.RM_WEBAPP_ADDRESS,\n YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS);\n }", "class_method_signature": "PhoenixMRJobUtil.getRMWebAddress(Configuration config)", "constructor": false, ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_149
{ "fields": [ { "declarator": "SCRUTINY_TIME_MILLIS = 1502908914193L", "modifier": "private static final", "original_string": "private static final long SCRUTINY_TIME_MILLIS = 1502908914193L;", "type": "long", "var_name": "SCRUTINY_TIME_MILLIS" } ], "file": "phoenix-core/src/...
{ "body": "@Test\n public void testGetSqlQueryBadCoveredColVal() throws SQLException {\n SourceTargetColumnNames columnNames =\n new SourceTargetColumnNames.DataSourceColNames(pDataTable, pIndexTable);\n String query =\n IndexScrutinyTableOutput.getSqlQueryBadCoveredColVal(conn,...
{ "fields": [ { "declarator": "OUTPUT_TABLE_NAME = \"PHOENIX_INDEX_SCRUTINY\"", "modifier": "public static", "original_string": "public static String OUTPUT_TABLE_NAME = \"PHOENIX_INDEX_SCRUTINY\";", "type": "String", "var_name": "OUTPUT_TABLE_NAME" }, { "declarator": "...
{ "body": "public static String getSqlQueryBadCoveredColVal(Connection conn,\n SourceTargetColumnNames columnNames, long scrutinyTimeMillis) throws SQLException {\n String paramQuery = getHasTargetRowQuery(conn, columnNames, scrutinyTimeMillis);\n return paramQuery.replaceFirst(\"\\\\?\", \"t...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_108
{ "fields": [ { "declarator": "cache", "modifier": "@Mock", "original_string": "@Mock\n GuidePostsCache cache;", "type": "GuidePostsCache", "var_name": "cache" }, { "declarator": "wrapper", "modifier": "", "original_string": "GuidePostsCacheWrapper wrappe...
{ "body": "@Test(expected = NullPointerException.class)\n public void invalidateAllPTableNull(){\n PTable ptable = null;\n wrapper.invalidateAll(ptable);\n }", "class_method_signature": "GuidePostsCacheWrapperTest.invalidateAllPTableNull()", "constructor": false, "full_signature": "@Test(exp...
{ "fields": [ { "declarator": "guidePostsCache", "modifier": "private final", "original_string": "private final GuidePostsCache guidePostsCache;", "type": "GuidePostsCache", "var_name": "guidePostsCache" } ], "file": "phoenix-core/src/main/java/org/apache/phoenix/query/GuideP...
{ "body": "void invalidateAll(){\n guidePostsCache.invalidateAll();\n }", "class_method_signature": "GuidePostsCacheWrapper.invalidateAll()", "constructor": false, "full_signature": " void invalidateAll()", "identifier": "invalidateAll", "invocations": [ "invalidateAll" ], "modifiers": "",...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_85
{ "fields": [ { "declarator": "ONE_HOUR_IN_MILLIS = 1000L * 60L * 60L", "modifier": "private static final", "original_string": "private static final long ONE_HOUR_IN_MILLIS = 1000L * 60L * 60L;", "type": "long", "var_name": "ONE_HOUR_IN_MILLIS" } ], "file": "phoenix-core/src/...
{ "body": "@Test(expected=IllegalDataException.class)\n public void testParseTimestamp_InvalidTimestamp() {\n DateUtil.parseTimestamp(\"not-a-timestamp\");\n }", "class_method_signature": "DateUtilTest.testParseTimestamp_InvalidTimestamp()", "constructor": false, "full_signature": "@Test(expected=I...
{ "fields": [ { "declarator": "DEFAULT_TIME_ZONE_ID = \"GMT\"", "modifier": "public static final", "original_string": "public static final String DEFAULT_TIME_ZONE_ID = \"GMT\";", "type": "String", "var_name": "DEFAULT_TIME_ZONE_ID" }, { "declarator": "LOCAL_TIME_ZONE_I...
{ "body": "public static Timestamp parseTimestamp(String timestampValue) {\n Timestamp timestamp = new Timestamp(parseDateTime(timestampValue));\n int period = timestampValue.indexOf('.');\n if (period > 0) {\n String nanosStr = timestampValue.substring(period + 1);\n if (na...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_190
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/schema/PMetaDataImplTest.java", "identifier": "PMetaDataImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldAlwaysKeepAtLeastOneEntryEvenIfTooLarge() throws Exception {\n TestTimeKeeper timeKeeper = new TestTimeKeeper();\n Map<String, String> props = Maps.newHashMapWithExpectedSize(2);\n props.put(QueryServices.MAX_CLIENT_METADATA_CACHE_SIZE_ATTRIB, \"5\");\n ...
{ "fields": [ { "declarator": "metaData", "modifier": "private", "original_string": "private PMetaDataCache metaData;", "type": "PMetaDataCache", "var_name": "metaData" }, { "declarator": "timeKeeper", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public int size() {\n return metaData.size();\n }", "class_method_signature": "PMetaDataImpl.size()", "constructor": false, "full_signature": "@Override public int size()", "identifier": "size", "invocations": [ "size" ], "modifiers": "@Override public", "parame...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_169
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixDriverTest.java", "identifier": "PhoenixDriverTest", "interfaces": "", "superclass": "extends BaseConnectionlessQueryTest" }
{ "body": "@Test\n public void testFirstConnectionWhenPropsHasTenantId() throws Exception {\n Properties props = new Properties();\n final String tenantId = \"00Dxx0000001234\";\n props.put(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId);\n\n Connection connection = new PhoenixTestDriver().c...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(PhoenixDriver.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(PhoenixDriver.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "@Override\n public Connection connect(String url, Properties info) throws SQLException {\n if (!acceptsURL(url)) {\n return null;\n }\n try {\n lockInterruptibly(LockMode.READ);\n checkClosed();\n return createConnection(url, info);\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_186
{ "fields": [ { "declarator": "region", "modifier": "private", "original_string": "private Region region;", "type": "Region", "var_name": "region" }, { "declarator": "rsServices", "modifier": "private", "original_string": "private RegionServerServices rsServ...
{ "body": "@Test\n public void testCheckRegionServerStoppedOnClose() throws Exception {\n when(conn.isClosed()).thenReturn(false);\n when(conn.isAborted()).thenReturn(true);\n\n mockScanner.close();\n\n verify(conn).isClosed();\n verify(conn).isAborted();\n verify(callable...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(StatisticsScanner.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(StatisticsScanner.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@Override\n public void close() throws IOException {\n boolean async = getConfig().getBoolean(COMMIT_STATS_ASYNC, DEFAULT_COMMIT_STATS_ASYNC);\n StatisticsCollectionRunTracker collectionTracker = getStatsCollectionRunTracker(config);\n StatisticsScannerCallable callable = createCall...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_93
{ "fields": [ { "declarator": "ROW = Bytes.toBytes(\"row\")", "modifier": "private static final", "original_string": "private static final byte[] ROW = Bytes.toBytes(\"row\");", "type": "byte[]", "var_name": "ROW" }, { "declarator": "QUALIFIER = Bytes.toBytes(\"qual\")"...
{ "body": "@Test\n public void testGetMutationKeyValue() throws Exception {\n String version = VersionInfo.getVersion();\n KeyValueBuilder builder = KeyValueBuilder.get(version);\n KeyValue kv = builder.buildPut(wrap(ROW), wrap(TABLE_FAMILY_BYTES), wrap(QUALIFIER),\n wrap(ORIGINAL_VALUE));\n P...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MetaDataUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MetaDataUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public static boolean getMutationValue(Mutation headerRow, byte[] key,\n KeyValueBuilder builder, ImmutableBytesWritable ptr) {\n List<Cell> kvs = headerRow.getFamilyCellMap().get(PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES);\n if (kvs != null) {\n for (Cell cell : kvs) {\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_112
{ "fields": [ { "declarator": "testCache = null", "modifier": "static", "original_string": "static GuidePostsCache testCache = null;", "type": "GuidePostsCache", "var_name": "testCache" }, { "declarator": "phoenixStatsLoader = null", "modifier": "static", "o...
{ "body": "@Test(expected = PhoenixNonRetryableRuntimeException.class)\n public void loadAndGetGuidePostsCacheFactoryNonImplementingClassFailure(){\n helper.loadAndGetGuidePostsCacheFactory(Object.class.getTypeName());\n }", "class_method_signature": "GuidePostsCacheProviderTest.loadAndGetGuidePostsCac...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(GuidePostsCacheProvider.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(GuidePostsCacheProvider.class);", "type": "Logger", "var_name": "LOGGE...
{ "body": "@VisibleForTesting\n GuidePostsCacheFactory loadAndGetGuidePostsCacheFactory(String classString) {\n Preconditions.checkNotNull(classString);\n if (guidePostsCacheFactory == null) {\n try {\n\n Class clazz = Class.forName(classString);\n if (!GuideP...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_145
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/mapreduce/CsvBulkImportUtilTest.java", "identifier": "CsvBulkImportUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetChar_NotPresent() {\n Configuration conf = new Configuration();\n assertNull(CsvBulkImportUtil.getCharacter(conf, \"conf.key\"));\n }", "class_method_signature": "CsvBulkImportUtilTest.testGetChar_NotPresent()", "constructor": false, "full_signature": "@...
{ "fields": [], "file": "phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkImportUtil.java", "identifier": "CsvBulkImportUtil", "interfaces": "", "methods": [ { "class_method_signature": "CsvBulkImportUtil.initCsvImportJob(Configuration conf, char fieldDelimiter, char quoteChar,\n ...
{ "body": "@VisibleForTesting\n static Character getCharacter(Configuration conf, String confKey) {\n String strValue = conf.get(confKey);\n if (strValue == null) {\n return null;\n }\n return new String(Base64.getDecoder().decode(strValue)).charAt(0);\n }", "class_metho...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_50
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/JDBCUtilTest.java", "identifier": "JDBCUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetMaxMutateBytes() throws Exception {\n assertEquals(1000L, JDBCUtil.getMutateBatchSizeBytes(\"localhost;\" + PhoenixRuntime.UPSERT_BATCH_SIZE_BYTES_ATTRIB +\n \"=1000\", new Properties(), ReadOnlyProps.EMPTY_PROPS));\n\n Properties props = new Propertie...
{ "fields": [], "file": "phoenix-core/src/main/java/org/apache/phoenix/util/JDBCUtil.java", "identifier": "JDBCUtil", "interfaces": "", "methods": [ { "class_method_signature": "JDBCUtil.JDBCUtil()", "constructor": true, "full_signature": "private JDBCUtil()", "identifier": "JDBCU...
{ "body": "public static long getMutateBatchSizeBytes(String url, Properties info, ReadOnlyProps props) throws SQLException {\n String batchSizeStr = findProperty(url, info, PhoenixRuntime.UPSERT_BATCH_SIZE_BYTES_ATTRIB);\n return (batchSizeStr == null ? props.getLong(QueryServices.MUTATE_BATCH_SIZE_BYT...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_46
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/JDBCUtilTest.java", "identifier": "JDBCUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetAutoCommit_FalseInProperties() {\n Properties props = new Properties();\n props.setProperty(\"AutoCommit\", \"false\");\n assertFalse(JDBCUtil.getAutoCommit(\"localhost\", props, false));\n }", "class_method_signature": "JDBCUtilTest.testGetAutoCommit...
{ "fields": [], "file": "phoenix-core/src/main/java/org/apache/phoenix/util/JDBCUtil.java", "identifier": "JDBCUtil", "interfaces": "", "methods": [ { "class_method_signature": "JDBCUtil.JDBCUtil()", "constructor": true, "full_signature": "private JDBCUtil()", "identifier": "JDBCU...
{ "body": "public static boolean getAutoCommit(String url, Properties info, boolean defaultValue) {\n String autoCommit = findProperty(url, info, PhoenixRuntime.AUTO_COMMIT_ATTRIB);\n if (autoCommit == null) {\n return defaultValue;\n }\n return Boolean.valueOf(autoCommit);\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_153
{ "fields": [ { "declarator": "scanRanges", "modifier": "private final", "original_string": "private final ScanRanges scanRanges;", "type": "ScanRanges", "var_name": "scanRanges" }, { "declarator": "keyRange", "modifier": "private final", "original_string": ...
{ "body": "@Test\n public void test() {\n byte[] lowerInclusiveKey = keyRange.getLowerRange();\n if (!keyRange.isLowerInclusive() && !Bytes.equals(lowerInclusiveKey, KeyRange.UNBOUND)) {\n // This assumes the last key is fixed length, otherwise the results may be incorrect\n // ...
{ "fields": [ { "declarator": "EVERYTHING_RANGES = Collections.<List<KeyRange>>emptyList()", "modifier": "private static final", "original_string": "private static final List<List<KeyRange>> EVERYTHING_RANGES = Collections.<List<KeyRange>>emptyList();", "type": "List<List<KeyRange>>", ...
{ "body": "public boolean intersectRegion(byte[] regionStartKey, byte[] regionEndKey, boolean isLocalIndex) {\n if (isEverything()) {\n return true;\n }\n if (isDegenerate()) {\n return false;\n }\n // Every range intersects all regions of a local index table \...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_11
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/ColumnInfoTest.java", "identifier": "ColumnInfoTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected=IllegalArgumentException.class)\n public void testFromString_InvalidString() {\n ColumnInfo.fromString(\"invalid\");\n }", "class_method_signature": "ColumnInfoTest.testFromString_InvalidString()", "constructor": false, "full_signature": "@Test(expected=IllegalArgumentExce...
{ "fields": [ { "declarator": "STR_SEPARATOR = \":\"", "modifier": "private static final", "original_string": "private static final String STR_SEPARATOR = \":\";", "type": "String", "var_name": "STR_SEPARATOR" }, { "declarator": "columnName", "modifier": "private ...
{ "body": "public static ColumnInfo fromString(String stringRepresentation) {\n List<String> components =\n Lists.newArrayList(stringRepresentation.split(\":\", 2));\n\n if (components.size() != 2) {\n throw new IllegalArgumentException(\"Unparseable string: \" + stringRepresen...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_10
{ "fields": [ { "declarator": "exit = ExpectedSystemExit.none()", "modifier": "@Rule\n public final", "original_string": "@Rule\n public final ExpectedSystemExit exit = ExpectedSystemExit.none();", "type": "ExpectedSystemExit", "var_name": "exit" } ], "file": "phoenix-p...
{ "body": "@Test\n public void testInvalidLogPerNRowsArgument() throws Exception {\n Long zero = 0l;\n Long negativeOne = -1l;\n String invaildNum = \"abc\";\n\n String[] args = {\"-listFiles\", \"-log_per_nrows\", zero.toString()};\n assertEquals(Long.valueOf(PherfConstants.LOG_...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(Pherf.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Pherf.class);", "type": "Logger", "var_name": "LOGGER" }, { "declarator": ...
{ "body": "public Properties getProperties() {\n return this.properties;\n }", "class_method_signature": "Pherf.getProperties()", "constructor": false, "full_signature": "public Properties getProperties()", "identifier": "getProperties", "invocations": [], "modifiers": "public", "parameters": ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_47
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/JDBCUtilTest.java", "identifier": "JDBCUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetConsistency_TIMELINE_InUrl() {\n assertTrue(JDBCUtil.getConsistencyLevel(\"localhost;Consistency=TIMELINE\", new Properties(),\n Consistency.STRONG.toString()) == Consistency.TIMELINE);\n }", "class_method_signature": "JDBCUtilTest.testGetConsistency_TIM...
{ "fields": [], "file": "phoenix-core/src/main/java/org/apache/phoenix/util/JDBCUtil.java", "identifier": "JDBCUtil", "interfaces": "", "methods": [ { "class_method_signature": "JDBCUtil.JDBCUtil()", "constructor": true, "full_signature": "private JDBCUtil()", "identifier": "JDBCU...
{ "body": "public static Consistency getConsistencyLevel(String url, Properties info, String defaultValue) {\n String consistency = findProperty(url, info, PhoenixRuntime.CONSISTENCY_ATTRIB);\n\n if(consistency != null && consistency.equalsIgnoreCase(Consistency.TIMELINE.toString())){\n retur...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_152
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/compile/PostIndexDDLCompilerTest.java", "identifier": "PostIndexDDLCompilerTest", "interfaces": "", "superclass": "extends BaseConnectionlessQueryTest" }
{ "body": "@Test\n public void testCompile() throws Exception {\n try (Connection conn = DriverManager.getConnection(getUrl())) {\n setupTables(conn);\n PhoenixConnection pConn = conn.unwrap(PhoenixConnection.class);\n PTable pDataTable = pConn.getTable(new PTableKey(null, \...
{ "fields": [ { "declarator": "connection", "modifier": "private final", "original_string": "private final PhoenixConnection connection;", "type": "PhoenixConnection", "var_name": "connection" }, { "declarator": "dataTableRef", "modifier": "private final", "...
{ "body": "public MutationPlan compile(final PTable indexTable) throws SQLException {\n /*\n * Compiles an UPSERT SELECT command to read from the data table and populate the index table\n */\n StringBuilder indexColumns = new StringBuilder();\n StringBuilder dataColumns = new Stri...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_144
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/mapreduce/CsvBulkImportUtilTest.java", "identifier": "CsvBulkImportUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConfigurePreUpsertProcessor() {\n Configuration conf = new Configuration();\n CsvBulkImportUtil.configurePreUpsertProcessor(conf, MockProcessor.class);\n ImportPreUpsertKeyValueProcessor processor = PhoenixConfigurationUtil.loadPreUpsertProcessor(conf);\n ...
{ "fields": [], "file": "phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkImportUtil.java", "identifier": "CsvBulkImportUtil", "interfaces": "", "methods": [ { "class_method_signature": "CsvBulkImportUtil.initCsvImportJob(Configuration conf, char fieldDelimiter, char quoteChar,\n ...
{ "body": "public static void configurePreUpsertProcessor(Configuration conf,\n Class<? extends ImportPreUpsertKeyValueProcessor> processorClass) {\n conf.setClass(PhoenixConfigurationUtil.UPSERT_HOOK_CLASS_CONFKEY, processorClass,\n ImportPreUpsertKeyValueProcessor.class);\n }", ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_51
{ "fields": [ { "declarator": "conn", "modifier": "private", "original_string": "private Connection conn;", "type": "Connection", "var_name": "conn" }, { "declarator": "converter", "modifier": "private", "original_string": "private StringToArrayConverter con...
{ "body": "@Test\n public void testToArray_EmptyString() throws SQLException {\n Array emptyArray = converter.toArray(\"\");\n assertEquals(0, ((Object[]) emptyArray.getArray()).length);\n }", "class_method_signature": "StringToArrayConverterTest.testToArray_EmptyString()", "constructor": fals...
{ "fields": [ { "declarator": "splitter", "modifier": "private final", "original_string": "private final Splitter splitter;", "type": "Splitter", "var_name": "splitter" }, { "declarator": "conn", "modifier": "private final", "original_string": "private final...
{ "body": "public Array toArray(String input) throws SQLException {\n if (input == null || input.isEmpty()) {\n return conn.createArrayOf(elementDataType.getSqlTypeName(), new Object[0]);\n }\n return conn.createArrayOf(\n elementDataType.getSqlTypeName(),\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_113
{ "fields": [ { "declarator": "testCache = null", "modifier": "static", "original_string": "static GuidePostsCache testCache = null;", "type": "GuidePostsCache", "var_name": "testCache" }, { "declarator": "phoenixStatsLoader = null", "modifier": "static", "o...
{ "body": "@Test\n public void loadAndGetGuidePostsCacheFactoryTestFactory(){\n GuidePostsCacheFactory factory = helper.loadAndGetGuidePostsCacheFactory(\n TestGuidePostsCacheFactory.class.getTypeName());\n assertTrue(factory instanceof TestGuidePostsCacheFactory);\n }", "class_me...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(GuidePostsCacheProvider.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(GuidePostsCacheProvider.class);", "type": "Logger", "var_name": "LOGGE...
{ "body": "@VisibleForTesting\n GuidePostsCacheFactory loadAndGetGuidePostsCacheFactory(String classString) {\n Preconditions.checkNotNull(classString);\n if (guidePostsCacheFactory == null) {\n try {\n\n Class clazz = Class.forName(classString);\n if (!GuideP...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_168
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixEmbeddedDriverTest.java", "identifier": "PhoenixEmbeddedDriverTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotAccept() throws Exception {\n Driver driver = new PhoenixDriver();\n assertFalse(driver.acceptsURL(\"jdbc:phoenix://localhost\"));\n assertFalse(driver.acceptsURL(\"jdbc:phoenix:localhost;test=true;bar=foo\"));\n assertFalse(driver.acceptsURL(\"jdbc...
{ "fields": [ { "declarator": "DNC_JDBC_PROTOCOL_SUFFIX = \"//\"", "modifier": "private final static", "original_string": "private final static String DNC_JDBC_PROTOCOL_SUFFIX = \"//\";", "type": "String", "var_name": "DNC_JDBC_PROTOCOL_SUFFIX" }, { "declarator": "DRIVE...
{ "body": "@Override\n public boolean acceptsURL(String url) throws SQLException {\n if (url.startsWith(PhoenixRuntime.JDBC_PROTOCOL)) {\n // A connection string of \"jdbc:phoenix\" is supported, since\n // all the connection information can potentially be gotten\n // out of...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_187
{ "fields": [ { "declarator": "schema", "modifier": "private static", "original_string": "private static String schema;", "type": "String", "var_name": "schema" }, { "declarator": "baseTable", "modifier": "private static", "original_string": "private static ...
{ "body": "@Test\n public void testHandleCreateTableMutationCode() throws SQLException {\n MetaDataProtocol.MetaDataMutationResult result = new MetaDataProtocol.MetaDataMutationResult\n (MetaDataProtocol.MutationCode.UNALLOWED_TABLE_MUTATION ,new PSchema(schema),\n EnvironmentEdgeM...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MetaDataClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MetaDataClient.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "@VisibleForTesting\n public boolean handleCreateTableMutationCode(MetaDataMutationResult result, MutationCode code,\n CreateTableStatement statement, String schemaName, String tableName,\n PTable parent) throws SQLException {\n switch(code) {\n case TABL...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_92
{ "fields": [ { "declarator": "ROW = Bytes.toBytes(\"row\")", "modifier": "private static final", "original_string": "private static final byte[] ROW = Bytes.toBytes(\"row\");", "type": "byte[]", "var_name": "ROW" }, { "declarator": "QUALIFIER = Bytes.toBytes(\"qual\")"...
{ "body": "@Test\n public void testTaggingAPutDueToDifferentCellValue() throws Exception {\n Put put = generateOriginalPut();\n\n // valueArray is set to a value different than the one in the cell, so we tag the cell\n MetaDataUtil.conditionallyAddTagsToPutCells(put, TABLE_FAMILY_BYTES, QUALIF...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MetaDataUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MetaDataUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public static void conditionallyAddTagsToPutCells(Put somePut, byte[] family, byte[] qualifier,\n ExtendedCellBuilder cellBuilder, byte[] valueArray, byte[] tagArray) {\n NavigableMap<byte[], List<Cell>> familyCellMap = somePut.getFamilyCellMap();\n List<Cell> cells = familyCellMap...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_200
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/parse/CastParseNodeTest.java", "identifier": "CastParseNodeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToSQL_ArrayType() {\n ColumnParseNode columnParseNode = new ColumnParseNode(TableName.create(\"SCHEMA1\", \"TABLE1\"), \"V\");\n CastParseNode castParseNode = new CastParseNode(columnParseNode, PLong.INSTANCE, null, null, true);\n StringBuilder stringBuilder ...
{ "fields": [ { "declarator": "dt", "modifier": "private final", "original_string": "private final PDataType dt;", "type": "PDataType", "var_name": "dt" }, { "declarator": "maxLength", "modifier": "private final", "original_string": "private final Integer ma...
{ "body": "@Override\n public void toSQL(ColumnResolver resolver, StringBuilder buf) {\n List<ParseNode> children = getChildren();\n buf.append(\" CAST(\");\n children.get(0).toSQL(resolver, buf);\n buf.append(\" AS \");\n boolean isArray = dt.isArrayType();\n PDataType ty...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_84
{ "fields": [ { "declarator": "ONE_HOUR_IN_MILLIS = 1000L * 60L * 60L", "modifier": "private static final", "original_string": "private static final long ONE_HOUR_IN_MILLIS = 1000L * 60L * 60L;", "type": "long", "var_name": "ONE_HOUR_IN_MILLIS" } ], "file": "phoenix-core/src/...
{ "body": "@Test(expected=IllegalDataException.class)\n public void testParseTimestamp_negativeNanos() {\n DateUtil.parseTimestamp(\"1970-01-01 00:00:10.-1\");\n }", "class_method_signature": "DateUtilTest.testParseTimestamp_negativeNanos()", "constructor": false, "full_signature": "@Test(expected=...
{ "fields": [ { "declarator": "DEFAULT_TIME_ZONE_ID = \"GMT\"", "modifier": "public static final", "original_string": "public static final String DEFAULT_TIME_ZONE_ID = \"GMT\";", "type": "String", "var_name": "DEFAULT_TIME_ZONE_ID" }, { "declarator": "LOCAL_TIME_ZONE_I...
{ "body": "public static Timestamp parseTimestamp(String timestampValue) {\n Timestamp timestamp = new Timestamp(parseDateTime(timestampValue));\n int period = timestampValue.indexOf('.');\n if (period > 0) {\n String nanosStr = timestampValue.substring(period + 1);\n if (na...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_191
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/schema/PMetaDataImplTest.java", "identifier": "PMetaDataImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldAlwaysKeepOneEntryIfMaxSizeIsZero() throws Exception {\n TestTimeKeeper timeKeeper = new TestTimeKeeper();\n Map<String, String> props = Maps.newHashMapWithExpectedSize(2);\n props.put(QueryServices.MAX_CLIENT_METADATA_CACHE_SIZE_ATTRIB, \"0\");\n pr...
{ "fields": [ { "declarator": "metaData", "modifier": "private", "original_string": "private PMetaDataCache metaData;", "type": "PMetaDataCache", "var_name": "metaData" }, { "declarator": "timeKeeper", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public int size() {\n return metaData.size();\n }", "class_method_signature": "PMetaDataImpl.size()", "constructor": false, "full_signature": "@Override public int size()", "identifier": "size", "invocations": [ "size" ], "modifiers": "@Override public", "parame...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_109
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/query/PropertyPolicyProviderTest.java", "identifier": "PropertyPolicyProviderTest", "interfaces": "", "superclass": "extends BaseConnectionlessQueryTest" }
{ "body": "@Test\n public void testPropertyPolicyProvider() {\n PropertyPolicy provided = PropertyPolicyProvider.getPropertyPolicy();\n assertTrue(provided instanceof TestPropertyPolicy);\n }", "class_method_signature": "PropertyPolicyProviderTest.testPropertyPolicyProvider()", "constructor": ...
{ "fields": [ { "declarator": "DEFAULT_PROPERTY_POLICY = new PropertyPolicy.PropertyPolicyImpl()", "modifier": "private static final", "original_string": "private static final PropertyPolicy DEFAULT_PROPERTY_POLICY = new PropertyPolicy.PropertyPolicyImpl();", "type": "PropertyPolicy", ...
{ "body": "public static PropertyPolicy getPropertyPolicy(){\n return InstanceResolver.getSingleton(PropertyPolicy.class, DEFAULT_PROPERTY_POLICY);\n }", "class_method_signature": "PropertyPolicyProvider.getPropertyPolicy()", "constructor": false, "full_signature": "public static PropertyPolicy getPro...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_148
{ "fields": [ { "declarator": "SCRUTINY_TIME_MILLIS = 1502908914193L", "modifier": "private static final", "original_string": "private static final long SCRUTINY_TIME_MILLIS = 1502908914193L;", "type": "long", "var_name": "SCRUTINY_TIME_MILLIS" } ], "file": "phoenix-core/src/...
{ "body": "@Test\n public void testGetSqlQueryMissingTargetRows() throws SQLException {\n SourceTargetColumnNames columnNames =\n new SourceTargetColumnNames.DataSourceColNames(pDataTable, pIndexTable);\n String query =\n IndexScrutinyTableOutput.getSqlQueryMissingTargetRows(con...
{ "fields": [ { "declarator": "OUTPUT_TABLE_NAME = \"PHOENIX_INDEX_SCRUTINY\"", "modifier": "public static", "original_string": "public static String OUTPUT_TABLE_NAME = \"PHOENIX_INDEX_SCRUTINY\";", "type": "String", "var_name": "OUTPUT_TABLE_NAME" }, { "declarator": "...
{ "body": "public static String getSqlQueryMissingTargetRows(Connection conn,\n SourceTargetColumnNames columnNames, long scrutinyTimeMillis) throws SQLException {\n String paramQuery = getHasTargetRowQuery(conn, columnNames, scrutinyTimeMillis);\n return paramQuery.replaceFirst(\"\\\\?\", \"...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_164
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/cache/JodaTimezoneCacheTest.java", "identifier": "JodaTimezoneCacheTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalDataException.class)\n public void testGetInstanceStringUnknown() {\n JodaTimezoneCache.getInstance(\"SOME_UNKNOWN_TIMEZONE\");\n }", "class_method_signature": "JodaTimezoneCacheTest.testGetInstanceStringUnknown()", "constructor": false, "full_signature": "@Test(e...
{ "fields": [ { "declarator": "CACHE_EXPRIRE_TIME_MINUTES = 10", "modifier": "public static final", "original_string": "public static final int CACHE_EXPRIRE_TIME_MINUTES = 10;", "type": "int", "var_name": "CACHE_EXPRIRE_TIME_MINUTES" }, { "declarator": "cachedJodaTimeZ...
{ "body": "public static DateTimeZone getInstance(ByteBuffer timezoneId) {\n try {\n return cachedJodaTimeZones.get(timezoneId);\n } catch (ExecutionException ex) {\n throw new IllegalDataException(ex);\n } catch (UncheckedExecutionException e) {\n throw new Illeg...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_71
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/Base62EncoderTest.java", "identifier": "Base62EncoderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public final void testPowersBase62() {\n // add 1 since pow62 doesn't contain it\n long[] pow62 = new long[Base62Encoder.pow62.length + 1];\n pow62[0] = 1;\n System.arraycopy(Base62Encoder.pow62, 0, pow62, 1, Base62Encoder.pow62.length);\n long input = 0l;\n ...
{ "fields": [ { "declarator": "digits = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\".toCharArray()", "modifier": "public static final", "original_string": "public static final char[] digits = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\".toCharArray();"...
{ "body": "public static String toString(long num) {\n if (num == Long.MIN_VALUE)\n return \"-AzL8n0Y58m8\";\n int size = (num < 0) ? stringSize(-num) + 1 : stringSize(num);\n char[] buf = new char[size];\n getChars(num, size, buf);\n return new String(buf);\n }", "c...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_133
{ "fields": [ { "declarator": "overAllQueryMetrics", "modifier": "private", "original_string": "private OverAllQueryMetrics overAllQueryMetrics;", "type": "OverAllQueryMetrics", "var_name": "overAllQueryMetrics" }, { "declarator": "numParallelScans = 10L", "modifi...
{ "body": "@Test\n public void testCombine() {\n OverAllQueryMetrics otherMetrics = new OverAllQueryMetrics(true, LogLevel.TRACE);\n final long otherNumParallelScans = 9L;\n final int otherQueryTimeouts = 8;\n final int otherQueryFailures = 7;\n final int otherCacheRefreshes = 6;...
{ "fields": [ { "declarator": "queryWatch", "modifier": "private final", "original_string": "private final MetricsStopWatch queryWatch;", "type": "MetricsStopWatch", "var_name": "queryWatch" }, { "declarator": "resultSetWatch", "modifier": "private final", "...
{ "body": "public OverAllQueryMetrics combine(OverAllQueryMetrics metric) {\n cacheRefreshedDueToSplits.combine(metric.cacheRefreshedDueToSplits);\n queryFailed.combine(metric.queryFailed);\n queryTimedOut.combine(metric.queryTimedOut);\n numParallelScans.combine(metric.numParallelScans);\...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_26
{ "fields": [ { "declarator": "MIN_VALUE = 1", "modifier": "private static", "original_string": "private static long MIN_VALUE = 1;", "type": "long", "var_name": "MIN_VALUE" }, { "declarator": "MAX_VALUE = 10", "modifier": "private static", "original_string"...
{ "body": "@Test\n public void testBulkAllocationAscendingNextValueGreaterThanMax() throws SQLException {\n assertTrue(SequenceUtil.checkIfLimitReached(MAX_VALUE, MIN_VALUE, MAX_VALUE, 2/* incrementBy */, CACHE_SIZE, 1));\n }", "class_method_signature": "SequenceUtilTest.testBulkAllocationAscendingNext...
{ "fields": [ { "declarator": "DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L", "modifier": "public static final", "original_string": "public static final long DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L;", "type": "long", "var_name": "DEFAULT_NUM_SLOTS_TO_ALLOCATE" } ], "file": "phoenix-core/src...
{ "body": "public static boolean checkIfLimitReached(long currentValue, long minValue, long maxValue,\n long incrementBy, long cacheSize, long numToAllocate) {\n long nextValue = 0;\n boolean increasingSeq = incrementBy > 0 ? true : false;\n // advance currentValue while checking for o...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_3
{ "fields": [ { "declarator": "mockParser", "modifier": "@Mock\n private static", "original_string": "@Mock\n private static XMLConfigParser mockParser;", "type": "XMLConfigParser", "var_name": "mockParser" }, { "declarator": "mockDMR", "modifier": "@Mock\n ...
{ "body": "@Test\n public void testTimeout() throws Exception {\n Mockito.when(mockQuery.getTimeoutDuration()).thenReturn(1000L);\n Mockito.when(mockQuery.getExpectedAggregateRowCount()).thenReturn(1L);\n MultiThreadedRunner mtr = new MultiThreadedRunner(\"test\",\n mockQuery, m...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MultiThreadedRunner.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MultiThreadedRunner.class);", "type": "Logger", "var_name": "LOGGER" }...
{ "body": "@VisibleForTesting\n /**\n * @return a Pair whose first value is the resultRowCount, and whose second value is whether the query timed out.\n */\n Pair<Long, Long> getResults(ResultSet rs, String queryIteration, boolean isSelectCountStatement, Long queryStartTime) throws Exception {\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_30
{ "fields": [ { "declarator": "MIN_VALUE = 1", "modifier": "private static", "original_string": "private static long MIN_VALUE = 1;", "type": "long", "var_name": "MIN_VALUE" }, { "declarator": "MAX_VALUE = 10", "modifier": "private static", "original_string"...
{ "body": "@Test\n public void testBulkAllocationDescendingNextValueLessThanMax() throws SQLException {\n assertTrue(SequenceUtil.checkIfLimitReached(10, MIN_VALUE, MAX_VALUE, -2/* incrementBy */, CACHE_SIZE, 5));\n }", "class_method_signature": "SequenceUtilTest.testBulkAllocationDescendingNextValueLe...
{ "fields": [ { "declarator": "DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L", "modifier": "public static final", "original_string": "public static final long DEFAULT_NUM_SLOTS_TO_ALLOCATE = 1L;", "type": "long", "var_name": "DEFAULT_NUM_SLOTS_TO_ALLOCATE" } ], "file": "phoenix-core/src...
{ "body": "public static boolean checkIfLimitReached(long currentValue, long minValue, long maxValue,\n long incrementBy, long cacheSize, long numToAllocate) {\n long nextValue = 0;\n boolean increasingSeq = incrementBy > 0 ? true : false;\n // advance currentValue while checking for o...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_125
{ "fields": [ { "declarator": "row = Bytes.toBytes(\"row\")", "modifier": "private static final", "original_string": "private static final byte[] row = Bytes.toBytes(\"row\");", "type": "byte[]", "var_name": "row" }, { "declarator": "TABLE_NAME = \"table\"", "modi...
{ "body": "@Test\n public void testCancelingUpdates() throws Exception {\n IndexUpdateManager manager = new IndexUpdateManager(mockIndexMetaData);\n\n long ts1 = 10, ts2 = 11;\n // at different timestamps, so both should be retained\n Delete d = new Delete(row, ts1);\n Put p = new Put(row, ts2);\n ...
{ "fields": [ { "declarator": "COMPARATOR = new MutationComparator()", "modifier": "public", "original_string": "public Comparator<Mutation> COMPARATOR = new MutationComparator();", "type": "Comparator<Mutation>", "var_name": "COMPARATOR" }, { "declarator": "PHOENIX_HBA...
{ "body": "public void addIndexUpdate(byte[] tableName, Mutation m) {\n // we only keep the most recent update\n ImmutableBytesPtr key = new ImmutableBytesPtr(tableName);\n Collection<Mutation> updates = map.get(key);\n if (updates == null) {\n updates = new TreeSet<Mutation>(COMPARATOR);\n map....
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_67
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/util/ByteUtilTest.java", "identifier": "ByteUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSplitBytes() {\n byte[] startRow = Bytes.toBytes(\"EA\");\n byte[] stopRow = Bytes.toBytes(\"EZ\");\n byte[][] splitPoints = Bytes.split(startRow, stopRow, 10);\n for (byte[] splitPoint : splitPoints) {\n assertTrue(Bytes.toStringBinary(spli...
{ "fields": [ { "declarator": "EMPTY_BYTE_ARRAY = new byte[0]", "modifier": "public static final", "original_string": "public static final byte[] EMPTY_BYTE_ARRAY = new byte[0];", "type": "byte[]", "var_name": "EMPTY_BYTE_ARRAY" }, { "declarator": "EMPTY_BYTE_ARRAY_PTR ...
{ "body": "public static byte[] toBytes(byte[][] byteArrays) {\n int size = 0;\n for (byte[] b : byteArrays) {\n if (b == null) {\n size++;\n } else {\n size += b.length;\n size += WritableUtils.getVIntSize(b.length);\n }\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_172
{ "fields": [], "file": "phoenix-core/src/test/java/org/apache/phoenix/schema/RowKeySchemaTest.java", "identifier": "RowKeySchemaTest", "interfaces": "", "superclass": "extends BaseConnectionlessQueryTest" }
{ "body": "@Test\n public void testClipLeft() throws Exception {\n ImmutableBytesWritable ptr = new ImmutableBytesWritable();\n Connection conn = DriverManager.getConnection(getUrl());\n conn.createStatement().execute(\"CREATE TABLE T1(K1 CHAR(1) NOT NULL, K2 VARCHAR, K3 VARCHAR, CONSTRAINT pk...
{ "fields": [ { "declarator": "EMPTY_SCHEMA = new RowKeySchema(0,Collections.<Field>emptyList(), true)", "modifier": "public static final", "original_string": "public static final RowKeySchema EMPTY_SCHEMA = new RowKeySchema(0,Collections.<Field>emptyList(), true)\n ;", "type": "RowKeyS...
{ "body": "public KeyRange clipLeft(int pkPos, KeyRange keyRange, int spansToClip, ImmutableBytesWritable ptr) {\n if (spansToClip < 0) {\n throw new IllegalArgumentException(\"Cannot specify a negative spansToClip (\" + spansToClip + \")\");\n }\n if (spansToClip == 0) {\n ...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
20473418_88
{ "fields": [ { "declarator": "ROW = Bytes.toBytes(\"row\")", "modifier": "private static final", "original_string": "private static final byte[] ROW = Bytes.toBytes(\"row\");", "type": "byte[]", "var_name": "ROW" }, { "declarator": "QUALIFIER = Bytes.toBytes(\"qual\")"...
{ "body": "@Test\n public void testMutatingAPut() throws Exception {\n Put put = generateOriginalPut();\n byte[] newValue = Bytes.toBytes(\"new-value\");\n Cell cell = put.get(TABLE_FAMILY_BYTES, QUALIFIER).get(0);\n assertEquals(Bytes.toString(ORIGINAL_VALUE),\n Bytes.to...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MetaDataUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MetaDataUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public static void mutatePutValue(Put somePut, byte[] family, byte[] qualifier, byte[] newValue) {\n NavigableMap<byte[], List<Cell>> familyCellMap = somePut.getFamilyCellMap();\n List<Cell> cells = familyCellMap.get(family);\n List<Cell> newCells = Lists.newArrayList();\n if (c...
{ "created": "6/4/2014 7:00:08 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 20473418, "size": null, "stargazer_count": null, "stars": 752, "updates": "2020-01-27T08:20:53+00:00", "url": "https://github.com/apache/phoenix" }
70038531_25
{ "fields": [], "file": "wraith-engine/src/test/java/com/srotya/tau/wraith/rules/validator/TestAlertTemplateValidator.java", "identifier": "TestAlertTemplateValidator", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testHTTPAlertTemplateNegative() {\n\t\tAlertTemplateValidator validator = new AlertTemplateValidator();\n\t\tAlertTemplate template = new AlertTemplate((short)2);\n\t\ttemplate.setMedia(\"http\");\n\t\ttemplate.setSubject(\"hello\");\n\t\ttemplate.setBody(\"hello $x\");\n\t\ttemplate.s...
{ "fields": [ { "declarator": "MAX_LENGTH_ALERT_DESTINATION = 200", "modifier": "private static final", "original_string": "private static final int MAX_LENGTH_ALERT_DESTINATION = 200;", "type": "int", "var_name": "MAX_LENGTH_ALERT_DESTINATION" }, { "declarator": "MAX_L...
{ "body": "@Override\n\tpublic void validate(AlertTemplate template) throws ValidationException {\n\t\tif (template.getDestination() == null || template.getDestination().trim().isEmpty()) {\n\t\t\tthrow new ValidationException(\"Alert target can't be empty\");\n\t\t}\n\t\tif (template.getDestination().length() > MAX_...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 70038531, "size": 6233, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/srotya/tau" }
70038531_12
{ "fields": [ { "declarator": "TIMESTAMP = \"@timestamp\"", "modifier": "private static final", "original_string": "private static final String TIMESTAMP = \"@timestamp\";", "type": "String", "var_name": "TIMESTAMP" }, { "declarator": "interceptor", "modifier": "p...
{ "body": "@Test\n\tpublic void testISO8601() throws ValidationException {\n\t\tJsonObject obj = new JsonObject();\n\t\tobj.addProperty(TIMESTAMP, \"2011-04-19T03:44:01.103Z\");\n\t\tinterceptor.validate(obj);\n\t\tobj.remove(TIMESTAMP);\n\t\ttry {\n\t\t\tinterceptor.validate(obj);\n\t\t\tfail(\"Must have thrown vali...
{ "fields": [ { "declarator": "TIMESTAMP = \"@timestamp\"", "modifier": "public static final", "original_string": "public static final String TIMESTAMP = \"@timestamp\";", "type": "String", "var_name": "TIMESTAMP" }, { "declarator": "DATEFIELD = \"dateinterceptor.datefi...
{ "body": "@Override\n\tpublic void validate(JsonObject event) throws ValidationException {\n\t\ttry {\n\t\t\tDateTime ts = formatter.parseDateTime(event.get(dateField).getAsString());\n\t\t\tevent.remove(dateField);\n\t\t\tevent.addProperty(dateField, ts.getMillis());\n\t\t\tif (next != null) {\n\t\t\t\tnext.validat...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 70038531, "size": 6233, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/srotya/tau" }
70038531_24
{ "fields": [], "file": "wraith-engine/src/test/java/com/srotya/tau/wraith/rules/validator/TestAlertTemplateValidator.java", "identifier": "TestAlertTemplateValidator", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testHTTPAlertTemplatePostive() throws ValidationException {\n\t\tAlertTemplateValidator validator = new AlertTemplateValidator();\n\t\tAlertTemplate template = new AlertTemplate((short)2);\n\t\ttemplate.setMedia(\"http\");\n\t\ttemplate.setSubject(\"hello\");\n\t\ttemplate.setBody(\"he...
{ "fields": [ { "declarator": "MAX_LENGTH_ALERT_DESTINATION = 200", "modifier": "private static final", "original_string": "private static final int MAX_LENGTH_ALERT_DESTINATION = 200;", "type": "int", "var_name": "MAX_LENGTH_ALERT_DESTINATION" }, { "declarator": "MAX_L...
{ "body": "@Override\n\tpublic void validate(AlertTemplate template) throws ValidationException {\n\t\tif (template.getDestination() == null || template.getDestination().trim().isEmpty()) {\n\t\t\tthrow new ValidationException(\"Alert target can't be empty\");\n\t\t}\n\t\tif (template.getDestination().length() > MAX_...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 70038531, "size": 6233, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/srotya/tau" }
70038531_23
{ "fields": [], "file": "wraith-engine/src/test/java/com/srotya/tau/wraith/rules/validator/TestAlertTemplateValidator.java", "identifier": "TestAlertTemplateValidator", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testMailAlertTemplateNegative() {\n\t\tAlertTemplateValidator validator = new AlertTemplateValidator();\n\t\tAlertTemplate template = new AlertTemplate((short)2);\n\t\ttry{\n\t\t\tvalidator.validate(template);\n\t\t\tfail(\"Invalid template, can't pass test\");\n\t\t}catch(ValidationEx...
{ "fields": [ { "declarator": "MAX_LENGTH_ALERT_DESTINATION = 200", "modifier": "private static final", "original_string": "private static final int MAX_LENGTH_ALERT_DESTINATION = 200;", "type": "int", "var_name": "MAX_LENGTH_ALERT_DESTINATION" }, { "declarator": "MAX_L...
{ "body": "@Override\n\tpublic void validate(AlertTemplate template) throws ValidationException {\n\t\tif (template.getDestination() == null || template.getDestination().trim().isEmpty()) {\n\t\t\tthrow new ValidationException(\"Alert target can't be empty\");\n\t\t}\n\t\tif (template.getDestination().length() > MAX_...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 70038531, "size": 6233, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/srotya/tau" }
70038531_0
{ "fields": [ { "declarator": "TEST_RULE_GROUP = \"test-tenant\"", "modifier": "private static final", "original_string": "private static final String TEST_RULE_GROUP = \"test-tenant\";", "type": "String", "var_name": "TEST_RULE_GROUP" }, { "declarator": "RULE_GROUP_ID_...
{ "body": "@Test\n\tpublic void testGetTemplate() throws Exception {\n\t\tAlertTemplates templates = new AlertTemplates();\n\t\truleGroup = TemplateManager.getInstance().getRuleGroup(em, RULE_GROUP_ID_1);\n\t\tid = TemplateManager.getInstance().createNewTemplate(em, templates, ruleGroup);\n\t\tAlertTemplates template...
{ "fields": [ { "declarator": "logger = Logger.getLogger(TemplateManager.class.getName())", "modifier": "private static final", "original_string": "private static final Logger logger = Logger.getLogger(TemplateManager.class.getName());", "type": "Logger", "var_name": "logger" }, ...
{ "body": "public AlertTemplates getTemplate(EntityManager em, String ruleGroupId, short templateId) throws Exception {\n\t\ttry {\n\t\t\tAlertTemplates result = em.createNamedQuery(Queries.TEMPLATE_FIND_BY_ID, AlertTemplates.class)\n\t\t\t\t\t.setParameter(\"templateId\", templateId).setParameter(\"ruleGroupId\", ru...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 70038531, "size": 6233, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/srotya/tau" }
70038531_1
{ "fields": [ { "declarator": "TEST_RULE_GROUP = \"test-tenant\"", "modifier": "private static final", "original_string": "private static final String TEST_RULE_GROUP = \"test-tenant\";", "type": "String", "var_name": "TEST_RULE_GROUP" }, { "declarator": "RULE_GROUP_ID_...
{ "body": "@Test\n\tpublic void testSaveTemplate() throws Exception {\n\t\tAlertTemplate tpl = new AlertTemplate();\n\t\truleGroup = TemplateManager.getInstance().getRuleGroup(em, RULE_GROUP_ID_1);\n\t\tAlertTemplates template = TemplateManager.getInstance().getTemplate(em, ruleGroup.getRuleGroupId(), id);\n\t\ttpl.s...
{ "fields": [ { "declarator": "logger = Logger.getLogger(TemplateManager.class.getName())", "modifier": "private static final", "original_string": "private static final Logger logger = Logger.getLogger(TemplateManager.class.getName());", "type": "Logger", "var_name": "logger" }, ...
{ "body": "public short saveTemplate(EntityManager em, AlertTemplates templates, RuleGroup ruleGroup, AlertTemplate currTemplate,\n\t\t\tApplicationManager am) throws Exception {\n\t\tif (currTemplate == null || templates == null || ruleGroup == null) {\n\t\t\tlogger.info(\"Template was null can't save\");\n\t\t\tret...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 70038531, "size": 6233, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/srotya/tau" }
70038531_22
{ "fields": [], "file": "wraith-engine/src/test/java/com/srotya/tau/wraith/rules/validator/TestAlertTemplateValidator.java", "identifier": "TestAlertTemplateValidator", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testMailAlertTemplatePositive() throws ValidationException {\n\t\tAlertTemplateValidator validator = new AlertTemplateValidator();\n\t\tAlertTemplate template = new AlertTemplate((short)2);\n\t\ttemplate.setMedia(\"mail\");\n\t\ttemplate.setSubject(\"hello\");\n\t\ttemplate.setBody(\"h...
{ "fields": [ { "declarator": "MAX_LENGTH_ALERT_DESTINATION = 200", "modifier": "private static final", "original_string": "private static final int MAX_LENGTH_ALERT_DESTINATION = 200;", "type": "int", "var_name": "MAX_LENGTH_ALERT_DESTINATION" }, { "declarator": "MAX_L...
{ "body": "@Override\n\tpublic void validate(AlertTemplate template) throws ValidationException {\n\t\tif (template.getDestination() == null || template.getDestination().trim().isEmpty()) {\n\t\t\tthrow new ValidationException(\"Alert target can't be empty\");\n\t\t}\n\t\tif (template.getDestination().length() > MAX_...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 70038531, "size": 6233, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/srotya/tau" }
70038531_2
{ "fields": [ { "declarator": "TEST_RULE_GROUP = \"test-tenant\"", "modifier": "private static final", "original_string": "private static final String TEST_RULE_GROUP = \"test-tenant\";", "type": "String", "var_name": "TEST_RULE_GROUP" }, { "declarator": "RULE_GROUP_ID_...
{ "body": "@Test\n\tpublic void testGetRules() throws Exception {\n\t\tList<Rules> rules = null;\n\t\ttry {\n\t\t\trules = RulesManager.getInstance().getRules(em, RULE_GROUP_ID_1);\n\t\t\tassertEquals(0, rules.size());\n\t\t} catch (NoResultException e) {\n\t\t}\n\t\tRules rule = new Rules();\n\t\tRuleGroup tenant = ...
{ "fields": [ { "declarator": "PARAM_RULE_GROUP_ID = \"ruleGroupId\"", "modifier": "public static final", "original_string": "public static final String PARAM_RULE_GROUP_ID = \"ruleGroupId\";", "type": "String", "var_name": "PARAM_RULE_GROUP_ID" }, { "declarator": "PARA...
{ "body": "public List<Rules> getRules(EntityManager em, String ruleGroupId) throws Exception {\n\t\tRuleGroup ruleGroup = getRuleGroup(em, ruleGroupId);\n\t\tif (ruleGroup == null) {\n\t\t\tthrow new NoResultException(\"Rule group not found\");\n\t\t}\n\t\ttry {\n\t\t\tList<Rules> result = em.createNamedQuery(Querie...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 70038531, "size": 6233, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/srotya/tau" }
70038531_21
{ "fields": [ { "declarator": "caller", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate RulesEngineCaller<Object, Object> caller;", "type": "RulesEngineCaller<Object, Object>", "var_name": "caller" }, { "declarator": "testFactory", "modifier":...
{ "body": "@Test\n\tpublic void testUpdateRule() throws Exception {\n\t\t// test RE with no pre-loaded rules\n\t\tengine.initialize(new HashMap<>());\n\t\tengine.updateRule(\"all\",\n\t\t\t\tRuleSerializer.serializeRuleToJSONString(new SimpleRule((short) 1123, \"test1\", true,\n\t\t\t\t\t\tnew EqualsCondition(\"host\...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(StatelessRulesEngine.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(StatelessRulesEngine.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "public void updateRule(String ruleGroup, String ruleJson, boolean delete) throws Exception {\n\t\tif (ruleGroup == null) {\n\t\t\tthrow new PerformantException(\"Supplied rule group is null\");\n\t\t}\n\t\tMap<Short, Rule> ruleMap = ruleGroupMap.get(ruleGroup);\n\t\tif (ruleMap == null) {\n\t\t\truleMap = ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 70038531, "size": 6233, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/srotya/tau" }
70038531_3
{ "fields": [ { "declarator": "TEST_RULE_GROUP = \"test-tenant\"", "modifier": "private static final", "original_string": "private static final String TEST_RULE_GROUP = \"test-tenant\";", "type": "String", "var_name": "TEST_RULE_GROUP" }, { "declarator": "RULE_GROUP_ID_...
{ "body": "@Test\n\tpublic void testGetRuleObjects() throws Exception {\n\t\tRules rule = new Rules();\n\t\tRuleGroup tenant = RulesManager.getInstance().getRuleGroup(em, RULE_GROUP_ID_2);\n\t\tshort ruleId = RulesManager.getInstance().createNewRule(em, rule, tenant).getRuleId();\n\t\ttry {\n\t\t\tList<Rule> rules = ...
{ "fields": [ { "declarator": "PARAM_RULE_GROUP_ID = \"ruleGroupId\"", "modifier": "public static final", "original_string": "public static final String PARAM_RULE_GROUP_ID = \"ruleGroupId\";", "type": "String", "var_name": "PARAM_RULE_GROUP_ID" }, { "declarator": "PARA...
{ "body": "public List<Rule> getRuleObjects(EntityManager em, String ruleGroupId) throws Exception {\n\t\tList<Rule> rules = new ArrayList<>();\n\t\ttry {\n\t\t\tList<Rules> results = getRules(em, ruleGroupId);\n\t\t\tfor (Rules rule : results) {\n\t\t\t\tif (rule.getRuleContent() != null) {\n\t\t\t\t\trules.add(Rule...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 70038531, "size": 6233, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/srotya/tau" }