id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
117256380_6 | {
"fields": [
{
"declarator": "colorBag",
"modifier": "private",
"original_string": "private ColorBag colorBag;",
"type": "ColorBag",
"var_name": "colorBag"
}
],
"file": "junit5/beforeeach/ColorBagTest.java",
"identifier": "ColorBagTest",
"interfaces": "",
"superclass":... | {
"body": "@Test\n @DisplayName(\"size of a color bag should match\")\n void size() {\n\n int bagSize = colorBag.size();\n\n assertEquals(6, bagSize,\n \"failure - size of bag does not match\");\n }",
"class_method_signature": "ColorBagTest.size()",
"constructor": false,
"f... | {
"fields": [
{
"declarator": "colors = new HashSet<>()",
"modifier": "private",
"original_string": "private Set<String> colors = new HashSet<>();",
"type": "Set<String>",
"var_name": "colors"
}
],
"file": "junit5/beforeeach/ColorBag.java",
"identifier": "ColorBag",
"inte... | {
"body": "public int size() {\n\n return colors.size();\n }",
"class_method_signature": "ColorBag.size()",
"constructor": false,
"full_signature": "public int size()",
"identifier": "size",
"invocations": [
"size"
],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signa... | {
"created": "1/12/2018 3:21:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 117256380,
"size": null,
"stargazer_count": null,
"stars": 14,
"updates": "2020-01-25T13:50:32+00:00",
"url": "https://github.com/janbodnar/Java-A... |
117256380_11 | {
"fields": [
{
"declarator": "messageService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private MessageService messageService;",
"type": "MessageService",
"var_name": "messageService"
},
{
"declarator": "captor1",
"modifier": "@Captor\n ... | {
"body": "@Test\n void testGetMessage() {\n\n messageService.getMessage(\"Hello!\", LocalDateTime.of(2019, 8, 20, 20, 18));\n\n Mockito.verify(messageService).getMessage(captor1.capture(), captor2.capture());\n\n assertEquals(\"Hello!\", captor1.getValue());\n assertEquals(LocalDateTim... | {
"fields": [],
"file": "mockito/argumentcaptor/MessageService.java",
"identifier": "MessageService",
"interfaces": "",
"methods": [
{
"class_method_signature": "MessageService.getMessage(String message, LocalDateTime dateTime)",
"constructor": false,
"full_signature": "public String get... | {
"body": "public String getMessage(String message, LocalDateTime dateTime) {\n\n return String.format(\"%s %s\", message, dateTime);\n }",
"class_method_signature": "MessageService.getMessage(String message, LocalDateTime dateTime)",
"constructor": false,
"full_signature": "public String getMessage(S... | {
"created": "1/12/2018 3:21:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 117256380,
"size": null,
"stargazer_count": null,
"stars": 14,
"updates": "2020-01-25T13:50:32+00:00",
"url": "https://github.com/janbodnar/Java-A... |
117256380_7 | {
"fields": [
{
"declarator": "messageService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private MessageService messageService;",
"type": "MessageService",
"var_name": "messageService"
}
],
"file": "mockito/nofcalls/MessageServiceTest.java",
"identif... | {
"body": "@Test\n void testSayMessage() {\n\n messageService.say();\n messageService.say();\n messageService.say();\n\n Mockito.verify(messageService, Mockito.times(3)).say();\n }",
"class_method_signature": "MessageServiceTest.testSayMessage()",
"constructor": false,
"full_si... | {
"fields": [
{
"declarator": "count = 0",
"modifier": "private static",
"original_string": "private static int count = 0;",
"type": "int",
"var_name": "count"
}
],
"file": "mockito/nofcalls/MessageService.java",
"identifier": "MessageService",
"interfaces": "",
"method... | {
"body": "public void say() {\n\n count++;\n\n if (count == 1) {\n\n System.out.printf(\"Method called %d time%n\", count);\n } else {\n\n System.out.printf(\"Method called %d times%n\", count);\n }\n }",
"class_method_signature": "MessageService.say()",
"cons... | {
"created": "1/12/2018 3:21:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 117256380,
"size": null,
"stargazer_count": null,
"stars": 14,
"updates": "2020-01-25T13:50:32+00:00",
"url": "https://github.com/janbodnar/Java-A... |
117256380_10 | {
"fields": [
{
"declarator": "helloService",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private HelloService helloService;",
"type": "HelloService",
"var_name": "helloService"
}
],
"file": "mockito/helloservice/HelloServiceTest.java",
"identifier": "H... | {
"body": "@Test\n void testHelloMessage() {\n\n when(helloService.getMessage()).thenReturn(\"Hello!\");\n assertEquals(helloService.getMessage(), \"Hello!\");\n }",
"class_method_signature": "HelloServiceTest.testHelloMessage()",
"constructor": false,
"full_signature": "@Test void testHello... | {
"fields": [],
"file": "mockito/helloservice/HelloService.java",
"identifier": "HelloService",
"interfaces": "",
"methods": [
{
"class_method_signature": "HelloService.getMessage()",
"constructor": false,
"full_signature": "public String getMessage()",
"identifier": "getMessage",
... | {
"body": "public String getMessage() {\n\n return \"Hello there!\";\n }",
"class_method_signature": "HelloService.getMessage()",
"constructor": false,
"full_signature": "public String getMessage()",
"identifier": "getMessage",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"r... | {
"created": "1/12/2018 3:21:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 117256380,
"size": null,
"stargazer_count": null,
"stars": 14,
"updates": "2020-01-25T13:50:32+00:00",
"url": "https://github.com/janbodnar/Java-A... |
117256380_8 | {
"fields": [
{
"declarator": "utils",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private StringUtils utils;",
"type": "StringUtils",
"var_name": "utils"
}
],
"file": "mockito/throwexception/StringUtilsTest.java",
"identifier": "StringUtilsTest",
"in... | {
"body": "@Test\n void testReverseWithNull() {\n\n when(utils.reverse(null))\n .thenThrow(new IllegalArgumentException());\n\n assertThrows(IllegalArgumentException.class, () -> utils.reverse(null));\n }",
"class_method_signature": "StringUtilsTest.testReverseWithNull()",
"cons... | {
"fields": [],
"file": "mockito/throwexception/StringUtils.java",
"identifier": "StringUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringUtils.reverse(String original)",
"constructor": false,
"full_signature": "public String reverse(String original)",
"iden... | {
"body": "public String reverse(String original) {\n\n if (original == null) {\n\n throw new IllegalArgumentException(\"The word cannot be null\");\n }\n\n char[] data = original.toCharArray();\n\n Stack<Character> stack = new Stack<>();\n\n for (char c: data) {\n\n ... | {
"created": "1/12/2018 3:21:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 117256380,
"size": null,
"stargazer_count": null,
"stars": 14,
"updates": "2020-01-25T13:50:32+00:00",
"url": "https://github.com/janbodnar/Java-A... |
117256380_4 | {
"fields": [
{
"declarator": "colorBag",
"modifier": "private",
"original_string": "private ColorBag colorBag;",
"type": "ColorBag",
"var_name": "colorBag"
}
],
"file": "junit5/beforeeach/ColorBagTest.java",
"identifier": "ColorBagTest",
"interfaces": "",
"superclass":... | {
"body": "@Test\n @DisplayName(\"removed color should not be in bag\")\n void remove() {\n\n var color = \"green\";\n colorBag.remove(color);\n\n assertFalse(colorBag.contains(color),\n \"failure - removed color still in bag\");\n }",
"class_method_signature": "ColorBag... | {
"fields": [
{
"declarator": "colors = new HashSet<>()",
"modifier": "private",
"original_string": "private Set<String> colors = new HashSet<>();",
"type": "Set<String>",
"var_name": "colors"
}
],
"file": "junit5/beforeeach/ColorBag.java",
"identifier": "ColorBag",
"inte... | {
"body": "public void remove(String color) {\n\n colors.remove(color);\n }",
"class_method_signature": "ColorBag.remove(String color)",
"constructor": false,
"full_signature": "public void remove(String color)",
"identifier": "remove",
"invocations": [
"remove"
],
"modifiers": "public",
... | {
"created": "1/12/2018 3:21:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 117256380,
"size": null,
"stargazer_count": null,
"stars": 14,
"updates": "2020-01-25T13:50:32+00:00",
"url": "https://github.com/janbodnar/Java-A... |
117256380_5 | {
"fields": [
{
"declarator": "colorBag",
"modifier": "private",
"original_string": "private ColorBag colorBag;",
"type": "ColorBag",
"var_name": "colorBag"
}
],
"file": "junit5/beforeeach/ColorBagTest.java",
"identifier": "ColorBagTest",
"interfaces": "",
"superclass":... | {
"body": "@Test\n @DisplayName(\"color bag should be transformed into List\")\n void toList() {\n\n var myList = Arrays.asList(\"red\",\"green\", \"yellow\",\n \"blue\", \"magenta\", \"brown\");\n var colorList = colorBag.toList();\n\n Collections.sort(myList);\n Coll... | {
"fields": [
{
"declarator": "colors = new HashSet<>()",
"modifier": "private",
"original_string": "private Set<String> colors = new HashSet<>();",
"type": "Set<String>",
"var_name": "colors"
}
],
"file": "junit5/beforeeach/ColorBag.java",
"identifier": "ColorBag",
"inte... | {
"body": "public List<String> toList() {\n\n return new ArrayList<>(colors);\n }",
"class_method_signature": "ColorBag.toList()",
"constructor": false,
"full_signature": "public List<String> toList()",
"identifier": "toList",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"re... | {
"created": "1/12/2018 3:21:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 117256380,
"size": null,
"stargazer_count": null,
"stars": 14,
"updates": "2020-01-25T13:50:32+00:00",
"url": "https://github.com/janbodnar/Java-A... |
117256380_9 | {
"fields": [
{
"declarator": "utils",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private StringUtils utils;",
"type": "StringUtils",
"var_name": "utils"
}
],
"file": "mockito/throwexception/StringUtilsTest.java",
"identifier": "StringUtilsTest",
"in... | {
"body": "@Test\n void testReverse() {\n\n when(utils.reverse(\"falcon\"))\n .thenReturn(\"noclaf\");\n\n assertEquals(utils.reverse(\"falcon\"), \"noclaf\");\n }",
"class_method_signature": "StringUtilsTest.testReverse()",
"constructor": false,
"full_signature": "@Test void ... | {
"fields": [],
"file": "mockito/throwexception/StringUtils.java",
"identifier": "StringUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "StringUtils.reverse(String original)",
"constructor": false,
"full_signature": "public String reverse(String original)",
"iden... | {
"body": "public String reverse(String original) {\n\n if (original == null) {\n\n throw new IllegalArgumentException(\"The word cannot be null\");\n }\n\n char[] data = original.toCharArray();\n\n Stack<Character> stack = new Stack<>();\n\n for (char c: data) {\n\n ... | {
"created": "1/12/2018 3:21:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 117256380,
"size": null,
"stargazer_count": null,
"stars": 14,
"updates": "2020-01-25T13:50:32+00:00",
"url": "https://github.com/janbodnar/Java-A... |
117256380_2 | {
"fields": [
{
"declarator": "vals",
"modifier": "private static",
"original_string": "private static List<Integer> vals;",
"type": "List<Integer>",
"var_name": "vals"
}
],
"file": "junit5/beforeall/MathUtilsTest.java",
"identifier": "MathUtilsTest",
"interfaces": "",
... | {
"body": "@Test\n @DisplayName(\"should get negative values\")\n void negativeTest() {\n\n var negativeValues = MathUtils.negative(vals);\n\n assertEquals(negativeValues, List.of(-2, -1, -1));\n }",
"class_method_signature": "MathUtilsTest.negativeTest()",
"constructor": false,
"full_sig... | {
"fields": [],
"file": "junit5/beforeall/MathUtils.java",
"identifier": "MathUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "MathUtils.sum(List<Integer> vals)",
"constructor": false,
"full_signature": "public static Integer sum(List<Integer> vals)",
"identifier... | {
"body": "public static List<Integer> negative(List<Integer> vals) {\n\n return vals.stream().filter(val -> val < 0).collect(Collectors.toList());\n }",
"class_method_signature": "MathUtils.negative(List<Integer> vals)",
"constructor": false,
"full_signature": "public static List<Integer> negative(Li... | {
"created": "1/12/2018 3:21:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 117256380,
"size": null,
"stargazer_count": null,
"stars": 14,
"updates": "2020-01-25T13:50:32+00:00",
"url": "https://github.com/janbodnar/Java-A... |
117256380_3 | {
"fields": [
{
"declarator": "colorBag",
"modifier": "private",
"original_string": "private ColorBag colorBag;",
"type": "ColorBag",
"var_name": "colorBag"
}
],
"file": "junit5/beforeeach/ColorBagTest.java",
"identifier": "ColorBagTest",
"interfaces": "",
"superclass":... | {
"body": "@Test\n @DisplayName(\"added color value should be in bag\")\n void add() {\n\n var newColor = \"pink\";\n colorBag.add(newColor);\n\n assertTrue(colorBag.contains(newColor),\n \"failure - added colour not it the bag\");\n }",
"class_method_signature": "ColorB... | {
"fields": [
{
"declarator": "colors = new HashSet<>()",
"modifier": "private",
"original_string": "private Set<String> colors = new HashSet<>();",
"type": "Set<String>",
"var_name": "colors"
}
],
"file": "junit5/beforeeach/ColorBag.java",
"identifier": "ColorBag",
"inte... | {
"body": "public void add(String color) {\n\n colors.add(color);\n }",
"class_method_signature": "ColorBag.add(String color)",
"constructor": false,
"full_signature": "public void add(String color)",
"identifier": "add",
"invocations": [
"add"
],
"modifiers": "public",
"parameters": "(S... | {
"created": "1/12/2018 3:21:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 117256380,
"size": null,
"stargazer_count": null,
"stars": 14,
"updates": "2020-01-25T13:50:32+00:00",
"url": "https://github.com/janbodnar/Java-A... |
66062805_4 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/router/rule/engine/RuleEngineBaseTest.java",
"identifier": "RuleEngineBaseTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testDate() throws Exception {\n\t\tRuleEngineBase target = new RuleEngineBase();\n\t\tDate result = target.date(\"2015-01-01 19:02:02.0001\");\n\t\tSystem.out.println(result.toString());\n\t}",
"class_method_signature": "RuleEngineBaseTest.testDate()",
"constructor": false,
"full... | {
"fields": [
{
"declarator": "SKIP = -1",
"modifier": "public static final",
"original_string": "public static final int SKIP = -1;",
"type": "int",
"var_name": "SKIP"
},
{
"declarator": "DATE_FORMAT_1 = \"yyyy-MM-dd\"",
"modifier": "public static final",
"... | {
"body": "public Date date(Object value) throws ParseException {\n\t\tif (value instanceof Date) {\n\t\t\treturn (Date) value;\n\t\t}\n\t\tif (value instanceof String) {\n\t\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\", Locale.SIMPLIFIED_CHINESE);\n\t\t\treturn format.parse((String) value);\n\... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_50 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/group/jdbc/GroupDataSourceTest.java",
"identifier": "GroupDataSourceTest",
"interfaces": "",
"superclass": "extends MultiDatabaseTestCase"
} | {
"body": "@Test\n\tpublic void test_override_properties_by_srping_bean()\n\t\t\tthrows NoSuchMethodException, InvocationTargetException, IllegalAccessException {\n\t\tGroupDataSourceConfig groupConfig = new GroupDataSourceConfig();\n\t\tDataSourceConfig config = new DataSourceConfig();\n\t\tconfig.setId(\"1\");\n\t\... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(GroupDataSource.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOGGER = LoggerFactory.getLogger(GroupDataSource.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Deprecated\n\tpublic void setName(String name) {\n\t\tthis.jdbcRef = name;\n\t}",
"class_method_signature": "GroupDataSource.setName(String name)",
"constructor": false,
"full_signature": "@Deprecated public void setName(String name)",
"identifier": "setName",
"invocations": [],
"modifiers": "... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_11 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMultipalShardColumn2() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b from db where `c` = 1 and `d` = ?\");\n\t\tList<Object> params = new ArrayList<Object>();\n\t\tparams.add(2);\n\t\tShardEvalContext ctx = new ShardEvalCon... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_46 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/group/datasources/LoadBalancedDataSourceTest.java",
"identifier": "LoadBalancedDataSourceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = SlaveDsDisConnectedException.class)\n\tpublic void test_init_fail_when_wrong_config() {\n\t\tString resourceName = \"sample.ds.error\";\n\t\tMap<String, Object> configs = ServiceConfigBuilder.newInstance()\n\t\t .putValue(Constants.CONFIG_SERVICE_NAME_KEY, resourceName).build();\n\t\t... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(LoadBalancedDataSource.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(LoadBalancedDataSource.class);",
"type": "Logger",
"var_name": "LOGGER"... | {
"body": "public void init() {\n\t\tthis.dataSourceManager = SingleDataSourceManagerFactory.getDataSourceManager();\n\n\t\tfor (DataSourceConfig config : loadBalancedConfigMap.values()) {\n\t\t\tcheckConfig(config);\n\t\t}\n\n\t\tfor (DataSourceConfig config : loadBalancedConfigMap.values()) {\n\t\t\tSingleDataSourc... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_31 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/group/router/region/LocalRegionManagerTest.java",
"identifier": "LocalRegionManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() throws Exception{\n\n ZebraRegionManager instance = new LocalRegionManager();\n instance.init();\n\n Assert.assertEquals(false, instance.isInSameIdc(\"192.168.1.1\", \"192.168.1.3\"));\n Assert.assertEquals(true, instance.isInSameIdc(\"192.20.1.1\",... | {
"fields": [
{
"declarator": "CENTER_CONFIG_FILE = \"region/center.json\"",
"modifier": "private static final",
"original_string": "private static final String CENTER_CONFIG_FILE = \"region/center.json\";",
"type": "String",
"var_name": "CENTER_CONFIG_FILE"
},
{
"decla... | {
"body": "public void init() {\n\t\ttry {\n\t\t\tString centerConfig = readCenterConfigFromFile();\n\n\t\t\tparseCenterConfig(centerConfig);\n\n\t\t\tString regionConfig = null;\n\t\t\tInputStream in = this.getClass().getResourceAsStream(REGION_CONFIG_FILE);\n\t\t\tif (in == null) {\n\t\t\t\tthrow new ZebraConfigExc... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_8 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardDateParseUtilTest.java",
"identifier": "ShardDateParseUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAddMonth() {\n ShardDateParseUtil.ShardDate sd = ShardDateParseUtil.addMonth(\"yyyy-MM-dd\", \"2016-02-28\", 1);\n Assert.assertEquals(new ShardDateParseUtil.ShardDate(2016, 2, 27), sd);\n\n sd = ShardDateParseUtil.addMonth(\"yyyy-MM-dd\", \"2016-03-31\", 1);... | {
"fields": [
{
"declarator": "DATE_FORMAT_1 = \"yyyy-MM-dd\"",
"modifier": "private static final",
"original_string": "private static final String DATE_FORMAT_1 = \"yyyy-MM-dd\";",
"type": "String",
"var_name": "DATE_FORMAT_1"
},
{
"declarator": "DATE_FORMAT_2 = \"yyyy... | {
"body": "public static ShardDate addMonth(String dateFormat, Object input, int delta) {\n\t\tif (input instanceof Date) {\n\t\t\treturn innerAddMonth((Date) input, delta);\n\t\t} else if (input instanceof String) {\n\t\t\treturn innerAddMonth(dateFormat, (String) input, delta);\n\t\t} else {\n\t\t\tthrow new ShardR... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_27 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMultiIn() throws ShardParseException {\n\t\tList<Object> params = new ArrayList<Object>();\n\t\tparams.add(1);\n\t\tparams.add(2);\n\t\tparams.add(1);\n\t\tparams.add(3);\n\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b from db where (`c`,`d`) in ((?,?)... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_26 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testThreadLocalShardValue3() throws ShardParseException {\n\t\tList<Object> params = new ArrayList<Object>();\n\t\tparams.add(\"1\");\n\t\tparams.add(\"2\");\n\t\tparams.add(\"3\");\n\n\t\tShardDataSourceHelper.setShardParams(\"Name\", params);\n\t\tShardDataSourceHelper.setExtractPara... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_9 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testBitwiseAnd() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select * from order where user_id = 111 and lock_status & 2 = 0\");\n\t\tList<Object> params = null;\n\t\tShardEvalContext ctx = new ShardEvalContext(parseResult, params);\n\t... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_30 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/parser/SQLHintTest.java",
"identifier": "SQLHintTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testParseColumn() {\n\t\tSet<String> expected = SQLHint.parseShardColumns(\"col0\");\n\t\tAssert.assertEquals(buildColumnSet(\"col0\"), expected);\n\n\t\texpected = SQLHint.parseShardColumns(\"col0+col1\");\n\t\tAssert.assertEquals(buildColumnSet(\"col0\", \"col1\"), expected);\n\n\t\t... | {
"fields": [
{
"declarator": "forceMaster = false",
"modifier": "private",
"original_string": "private boolean forceMaster = false;",
"type": "boolean",
"var_name": "forceMaster"
},
{
"declarator": "batchInsert = false",
"modifier": "private",
"original_str... | {
"body": "public static Set<String> parseShardColumns(String columnStr) {\n\t\tif(columnStr != null) {\n\t\t\tSet<String> colSet = new HashSet<String>();\n\t\t\tint idx = -1;\n\t\t\tint start = 0;\n\t\t\tdo {\n\t\t\t\tidx = columnStr.indexOf('+', start);\n\t\t\t\tif (idx >= 0) {\n\t\t\t\t\tString col = columnStr.sub... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_47 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/group/jdbc/GroupDataSourceTest.java",
"identifier": "GroupDataSourceTest",
"interfaces": "",
"superclass": "extends MultiDatabaseTestCase"
} | {
"body": "@Test(expected=ZebraException.class)\n\tpublic void test_group_datasource_security_check_fail() {\n\t\tGroupDataSource ds = new GroupDataSource(\"sample.ds.security\");\n\t\tds.setConfigManagerType(getConfigManagerType());\n\t\tds.init();\n\t}",
"class_method_signature": "GroupDataSourceTest.test_group_d... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(GroupDataSource.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOGGER = LoggerFactory.getLogger(GroupDataSource.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "public synchronized void init() {\n\t\tif (StringUtils.isBlank(jdbcRef)) {\n\t\t\tthrow new ZebraException(\"jdbcRef cannot be empty\");\n\t\t}\n\n\t\tthis.checkJdbcRefInitializationTimes();\n\n\t\tif (init) {\n\t\t\tthrow new ZebraException(String.format(\"GroupDataSource [%s] is already initialized once.... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_10 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMultipalShardColumn1() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b from db where `c` = 1 and `d` = 2\");\n\t\tList<Object> params = null;\n\t\tShardEvalContext ctx = new ShardEvalContext(parseResult, params);\n\t\tSet<Str... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_51 | {
"fields": [],
"file": "zebra-cat-client/src/test/java/com/dianping/zebra/monitor/filter/CatFilterTest.java",
"identifier": "CatFilterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test_sql_rejected_by_flow_control() throws SQLException {\n\t\tGroupDataSource ds = new GroupDataSource();\n\t\tds.setConfigManagerType(Constants.CONFIG_MANAGER_TYPE_LOCAL);\n\t\tds.setJdbcRef(\"sample.ds.v2\");\n\t\tds.setFilter(\"wall,cat\");\n\t\tds.init();\n\n\t\tDaoContextHolder.s... | {
"fields": [
{
"declarator": "CAT_TYPE = \"DAL\"",
"modifier": "private static final",
"original_string": "private static final String CAT_TYPE = \"DAL\";",
"type": "String",
"var_name": "CAT_TYPE"
},
{
"declarator": "SHARD_CAT_TYPE = \"ShardSQL\"",
"modifier": "... | {
"body": "@Override\n\tpublic void init() {\n\t\tif (!Constants.ZEBRA_VERSION.equals(Version.ZEBRA_VERSION)) {\n\t\t\tLOGGER.warn(\"zebra-cat-client version(\" + Version.ZEBRA_VERSION + \") is not same as zebra-client(\"\n\t\t\t + Constants.ZEBRA_VERSION + \")\");\n\t\t}\n\t}",
"class_method_signature": "CatF... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_5 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardDateParseUtilTest.java",
"identifier": "ShardDateParseUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseDate() throws ParseException {\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n ShardDateParseUtil.ShardDate sd = ShardDateParseUtil.parseToYMD(\"yyyy-MM-dd\", format.parse(\"2017-02-28\"));\n Assert.assertEquals(new ShardDateParseUtil... | {
"fields": [
{
"declarator": "DATE_FORMAT_1 = \"yyyy-MM-dd\"",
"modifier": "private static final",
"original_string": "private static final String DATE_FORMAT_1 = \"yyyy-MM-dd\";",
"type": "String",
"var_name": "DATE_FORMAT_1"
},
{
"declarator": "DATE_FORMAT_2 = \"yyyy... | {
"body": "public static ShardDate parseToYMD(String dateFormat, Object input) {\n\t\tif (input instanceof Date) {\n\t\t\treturn innerParseToYMD((Date) input);\n\t\t} else if (input instanceof String) {\n\t\t\treturn innerParseToYMD(dateFormat, ((String) input).trim());\n\t\t} else {\n\t\t\tthrow new ZebraConfigExcep... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_37 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n\tpublic void testInOneRegion() {\n\t\tregionManager.setLocalAddress(\"192.3.1.1\");\n\n\t\tthis.dataSourceRouter = new RegionAwareRouter(\n\t\t dataSourceConfigManager.getGroupDataSourceConfig().getDataSourceConfigs(),\n\t\t Constants.CONFIG_MANAGER_TYPE_LOCAL, configService, Constants.RO... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\n\t\tif (localRegionRouter != null) {\n\t\t\trouterTarget = localRegionRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteRegionRouter != null) {\n\t\t\trouterTarget = ... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_21 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testPreparedIn2() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\n\t\t\t\t\"SELECT A.ReceiptID, A.UserID, A.DealGroupID, A.DealID from RS_Receipt A WHERE A.UserID IN (28152647,22050) AND A.ReceiptID IN (234460949,234400906,234400907,2344009... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_2 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/filter/DefaultFilterManagerTest.java",
"identifier": "DefaultFilterManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test_load_by_two_name() {\n\t\tList<JdbcFilter> filters = FilterManagerFactory.getFilterManager().loadFilters(\"wall,no_exist\", Constants.CONFIG_MANAGER_TYPE_REMOTE, null);\n\t\tAssert.assertEquals(filters.size(), 1);\n\t}",
"class_method_signature": "DefaultFilterManagerTest.test_... | {
"fields": [
{
"declarator": "FILTER_KEY_NAME = \"zebra.filter.\"",
"modifier": "private static final",
"original_string": "private static final String FILTER_KEY_NAME = \"zebra.filter.\";",
"type": "String",
"var_name": "FILTER_KEY_NAME"
},
{
"declarator": "FILTER_PRO... | {
"body": "@Override\n\tpublic List<JdbcFilter> loadFilters(String strConfig, String configType, Map<String, Object> serviceConfigs) {\n\t\tList<JdbcFilter> result = new LinkedList<JdbcFilter>();\n\t\tif (strConfig != null) {\n\t\t\tfor (String name : strConfig.trim().split(\",\")) {\n\t\t\t\tList<JdbcFilter> filters... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_17 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testLessThan() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b from db where `c` <= 1\");\n\t\tList<Object> params = null;\n\t\tShardEvalContext ctx = new ShardEvalContext(parseResult, params);\n\t\tSet<String> shardColumns = new... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_40 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n\tpublic void testRegion1IdcAware() {\n\t\tregionManager.setLocalAddress(\"192.1.4.1\");\n\t\tSet<String> sh = new HashSet<String>();\n\t\tsh.add(\"db-n2-read\");\n\t\tSet<String> sets = new HashSet<String>();\n\n\t\tthis.dataSourceRouter = new RegionAwareRouter(\n\t\t dataSourceConfigManager.g... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\n\t\tif (localRegionRouter != null) {\n\t\t\trouterTarget = localRegionRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteRegionRouter != null) {\n\t\t\trouterTarget = ... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_41 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n\tpublic void testRegion1() {\n\t\tregionManager.setLocalAddress(\"192.6.4.1\");\n\t\tSet<String> sh = new HashSet<String>();\n\t\tsh.add(\"db-n2-read\");\n\t\tsh.add(\"db-n3-read\");\n\t\tsh.add(\"db-n4-read\");\n\t\tsh.add(\"db-n5-read\");\n\t\tSet<String> sets = new HashSet<String>();\n\n\t\tthis... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\n\t\tif (localRegionRouter != null) {\n\t\t\trouterTarget = localRegionRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteRegionRouter != null) {\n\t\t\trouterTarget = ... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_16 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testLargerThan() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b from db where `c` >= 1\");\n\t\tList<Object> params = null;\n\t\tShardEvalContext ctx = new ShardEvalContext(parseResult, params);\n\t\tSet<String> shardColumns = n... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_3 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/filter/DefaultFilterManagerTest.java",
"identifier": "DefaultFilterManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test_load_null() {\n\t\tList<JdbcFilter> filters = FilterManagerFactory.getFilterManager().loadFilters(null, Constants.CONFIG_MANAGER_TYPE_REMOTE, null);\n\t\tAssert.assertEquals(filters.size(), 0);\n\t}",
"class_method_signature": "DefaultFilterManagerTest.test_load_null()",
"con... | {
"fields": [
{
"declarator": "FILTER_KEY_NAME = \"zebra.filter.\"",
"modifier": "private static final",
"original_string": "private static final String FILTER_KEY_NAME = \"zebra.filter.\";",
"type": "String",
"var_name": "FILTER_KEY_NAME"
},
{
"declarator": "FILTER_PRO... | {
"body": "@Override\n\tpublic List<JdbcFilter> loadFilters(String strConfig, String configType, Map<String, Object> serviceConfigs) {\n\t\tList<JdbcFilter> result = new LinkedList<JdbcFilter>();\n\t\tif (strConfig != null) {\n\t\t\tfor (String name : strConfig.trim().split(\",\")) {\n\t\t\t\tList<JdbcFilter> filters... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_20 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testPreparedIn() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b from db where `c` in (?,?,?,?)\");\n\t\tList<Object> params = new ArrayList<Object>();\n\t\tparams.add(1);\n\t\tparams.add(2);\n\t\tparams.add(3);\n\t\tparams.add(4... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_36 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n public void testInOneDataCenter5() {\n regionManager.setLocalAddress(\"192.2.1.1\");\n this.dataSourceRouter = new IdcAwareRouter(\n dataSourceConfigManager.getGroupDataSourceConfig().getDataSourceConfigs(), \"local\", null);\n\n for (int i = 0; i < 100; i++) ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(IdcAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(IdcAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\t\tif (localIdcWeightedRouter != null) {\n\t\t\trouterTarget = localIdcWeightedRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteIdcWeightedRouter != null) {\n\t\t\tro... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_19 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testIn() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b from db where `c` in (1,2,3,4)\");\n\t\tList<Object> params = null;\n\t\tShardEvalContext ctx = new ShardEvalContext(parseResult, params);\n\t\tSet<String> shardColumns = n... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_23 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testPreparedOr1() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b from db where `c` = 2 or `c` = 3\");\n\t\tList<Object> params = null;\n\t\tShardEvalContext ctx = new ShardEvalContext(parseResult, params);\n\t\tSet<String> shard... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_35 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n public void testInOneDataCenter2() {\n regionManager.setLocalAddress(\"192.6.1.1\");\n this.dataSourceRouter = new IdcAwareRouter(\n dataSourceConfigManager.getGroupDataSourceConfig().getDataSourceConfigs(), \"local\", null);\n\n RouterTarget routerTarget = th... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(IdcAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(IdcAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\t\tif (localIdcWeightedRouter != null) {\n\t\t\trouterTarget = localIdcWeightedRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteIdcWeightedRouter != null) {\n\t\t\tro... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_42 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n\tpublic void testCenter3() {\n\t\tSet<String> c1 = new HashSet<String>();\n\t\tc1.add(\"db-n7-read\");\n\t\tc1.add(\"db-n6-read\");\n\t\tc1.add(\"db-n8-read\");\n\t\tSet<String> sets = new HashSet<String>();\n\n\t\t// RZ\n\t\tregionManager.setLocalAddress(\"192.11.4.1\");\n\t\tthis.dataSourceRouter... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\n\t\tif (localRegionRouter != null) {\n\t\t\trouterTarget = localRegionRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteRegionRouter != null) {\n\t\t\trouterTarget = ... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_15 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testSingleInsertion() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser\n\t\t\t\t.parseWithoutCache(\"INSERT INTO `User` (`Name`,`Tel`,`Alias`,`Email`)VALUES('zhuhao','123','hao.zhu','z@d')\");\n\t\tList<Object> params = null;\n\t\tShardEvalContext ctx = new Sha... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_39 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n\tpublic void testCenter1() {\n\t\tregionManager.setLocalAddress(\"192.2.4.1\");\n\t\tSet<String> sh = new HashSet<String>();\n\t\tsh.add(\"db-n2-read\");\n\t\tsh.add(\"db-n3-read\");\n\t\tsh.add(\"db-n4-read\");\n\t\tSet<String> sets = new HashSet<String>();\n\n\t\tthis.dataSourceRouter = new Regio... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\n\t\tif (localRegionRouter != null) {\n\t\t\trouterTarget = localRegionRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteRegionRouter != null) {\n\t\t\trouterTarget = ... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_0 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/filter/DefaultFilterManagerTest.java",
"identifier": "DefaultFilterManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test_load_by_empty_name() {\n\t\tList<JdbcFilter> filters = FilterManagerFactory.getFilterManager().loadFilters(\"\", Constants.CONFIG_MANAGER_TYPE_REMOTE, null);\n\t\tAssert.assertEquals(filters.size(), 0);\n\t}",
"class_method_signature": "DefaultFilterManagerTest.test_load_by_emp... | {
"fields": [
{
"declarator": "FILTER_KEY_NAME = \"zebra.filter.\"",
"modifier": "private static final",
"original_string": "private static final String FILTER_KEY_NAME = \"zebra.filter.\";",
"type": "String",
"var_name": "FILTER_KEY_NAME"
},
{
"declarator": "FILTER_PRO... | {
"body": "@Override\n\tpublic List<JdbcFilter> loadFilters(String strConfig, String configType, Map<String, Object> serviceConfigs) {\n\t\tList<JdbcFilter> result = new LinkedList<JdbcFilter>();\n\t\tif (strConfig != null) {\n\t\t\tfor (String name : strConfig.trim().split(\",\")) {\n\t\t\t\tList<JdbcFilter> filters... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_1 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/filter/DefaultFilterManagerTest.java",
"identifier": "DefaultFilterManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test_load_by_name() {\n\t\tList<JdbcFilter> filters = FilterManagerFactory.getFilterManager().loadFilters(\"wall\", Constants.CONFIG_MANAGER_TYPE_REMOTE, null);\n\t\tAssert.assertEquals(filters.size(), 1);\n\t}",
"class_method_signature": "DefaultFilterManagerTest.test_load_by_name... | {
"fields": [
{
"declarator": "FILTER_KEY_NAME = \"zebra.filter.\"",
"modifier": "private static final",
"original_string": "private static final String FILTER_KEY_NAME = \"zebra.filter.\";",
"type": "String",
"var_name": "FILTER_KEY_NAME"
},
{
"declarator": "FILTER_PRO... | {
"body": "@Override\n\tpublic List<JdbcFilter> loadFilters(String strConfig, String configType, Map<String, Object> serviceConfigs) {\n\t\tList<JdbcFilter> result = new LinkedList<JdbcFilter>();\n\t\tif (strConfig != null) {\n\t\t\tfor (String name : strConfig.trim().split(\",\")) {\n\t\t\t\tList<JdbcFilter> filters... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_38 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n\tpublic void testInOneRegion2() {\n\t\tregionManager.setLocalAddress(\"192.11.4.1\");\n\t\tthis.dataSourceRouter = new RegionAwareRouter(\n\t\t dataSourceConfigManager.getGroupDataSourceConfig().getDataSourceConfigs(), \"local\", null,\n\t\t Constants.ROUTER_STRATEGY_CENTER_AWARE_ROUTER);... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\n\t\tif (localRegionRouter != null) {\n\t\t\trouterTarget = localRegionRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteRegionRouter != null) {\n\t\t\trouterTarget = ... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_14 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMultipalInsertion() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\n\t\t\t\t\"INSERT INTO `User` (`Name`,`Tel`,`Alias`,`Email`)VALUES('zhuhao','123','hao.zhu','z@d'),('zhuhao1','1233','hao.zhu1','z@d')\");\n\t\tList<Object> params = nul... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_43 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n\tpublic void testRegion2IdcAware() {\n\t\tSet<String> c1 = new HashSet<String>();\n\t\tc1.add(\"db-n6-read\");\n\t\tSet<String> sets = new HashSet<String>();\n\n\t\tSet<String> center2 = new LinkedHashSet<>();\n\t\tcenter2.add(\"db-n7-read\");\n\t\tcenter2.add(\"db-n8-read\");\n\n\t\tregionManager.... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\n\t\tif (localRegionRouter != null) {\n\t\t\trouterTarget = localRegionRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteRegionRouter != null) {\n\t\t\trouterTarget = ... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_34 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n public void testInOneDataCenter1() {\n regionManager.setLocalAddress(\"192.6.1.1\");\n this.dataSourceRouter = new IdcAwareRouter(\n dataSourceConfigManager.getGroupDataSourceConfig().getDataSourceConfigs(), \"local\", null);\n\n RouterTarget routerTarget = th... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(IdcAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(IdcAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\t\tif (localIdcWeightedRouter != null) {\n\t\t\trouterTarget = localIdcWeightedRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteIdcWeightedRouter != null) {\n\t\t\tro... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_22 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testPreparedIn3() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\n\t\t\t\t\"update RS_Receipt set Status = ?, LastDate = now() where UserID IN (12323) and OrderId = ? and SerialNumber in ( ? ) and Status = ?\");\n\t\tList<Object> params = n... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_18 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testNotEqual() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b from db where `c` != 1\");\n\t\tList<Object> params = null;\n\t\tShardEvalContext ctx = new ShardEvalContext(parseResult, params);\n\t\tSet<String> shardColumns = new... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_44 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n\tpublic void testRegion2() {\n\t\tLocalRegionManager manager = new LocalRegionManager();\n\t\tmanager.init();\n\t\tSet<String> c1 = new HashSet<String>();\n\t\tc1.add(\"db-n6-read\");\n\t\tc1.add(\"db-n7-read\");\n\t\tc1.add(\"db-n8-read\");\n\t\tSet<String> sets = new HashSet<String>();\n\n\t\tman... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RegionAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\n\t\tif (localRegionRouter != null) {\n\t\t\trouterTarget = localRegionRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteRegionRouter != null) {\n\t\t\trouterTarget = ... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_13 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMultipalShardColumn4() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b from db where `c` = 1 and `d` = ?\");\n\t\tList<Object> params = new ArrayList<Object>();\n\t\tparams.add(2);\n\t\tShardEvalContext ctx = new ShardEvalCon... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_52 | {
"fields": [],
"file": "zebra-cat-client/src/test/java/com/dianping/zebra/monitor/monitor/SingleDataSourceMonitorTest.java",
"identifier": "SingleDataSourceMonitorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test_get_properties() {\n\t\tSingleDataSourceMBean single = Mockito.mock(SingleDataSourceMBean.class);\n\n\t\tMockito.when(single.getState()).thenReturn(DataSourceState.UP);\n\n\t\tDataSourceConfig config = new DataSourceConfig();\n\t\tconfig.setId(\"test\");\n\n\t\tMockito.when(single... | {
"fields": [
{
"declarator": "idCounter = new HashMap<String, AtomicInteger>()",
"modifier": "private static",
"original_string": "private static Map<String, AtomicInteger> idCounter = new HashMap<String, AtomicInteger>();",
"type": "Map<String, AtomicInteger>",
"var_name": "idCount... | {
"body": "@Override\n\tpublic String getDescription() {\n\t\treturn this.id;\n\t}",
"class_method_signature": "SingleDataSourceMonitor.getDescription()",
"constructor": false,
"full_signature": "@Override public String getDescription()",
"identifier": "getDescription",
"invocations": [],
"modifiers": "@O... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_29 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/parser/SQLHintTest.java",
"identifier": "SQLHintTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test0() {\n\t\tString line = \"\";\n\n\t\tSQLHint hint = SQLHint.parseZebraHint(line);\n\n\t\tAssert.assertNotNull(hint);\n\t}",
"class_method_signature": "SQLHintTest.test0()",
"constructor": false,
"full_signature": "@Test public void test0()",
"identifier": "test0",
"invoc... | {
"fields": [
{
"declarator": "forceMaster = false",
"modifier": "private",
"original_string": "private boolean forceMaster = false;",
"type": "boolean",
"var_name": "forceMaster"
},
{
"declarator": "batchInsert = false",
"modifier": "private",
"original_str... | {
"body": "public static SQLHint parseZebraHint(String hint) {\n\t\tSQLHint sqlHint = new SQLHint();\n\n\t\tif (StringUtils.isNotBlank(hint)) {\n\t\t\tint pos = hint.trim().lastIndexOf(\"*/\");\n\t\t\thint = hint.substring(2, pos);\n\t\t\tStringBuilder sb = new StringBuilder(64);\n\t\t\tString key = null;\n\t\t\tbool... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_6 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardDateParseUtilTest.java",
"identifier": "ShardDateParseUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseStr() {\n ShardDateParseUtil.ShardDate sd = ShardDateParseUtil.parseToYMD(\"yyyy-MM-dd\", \"2017-02-28\");\n Assert.assertEquals(new ShardDateParseUtil.ShardDate(2017, 1, 27), sd);\n\n sd = ShardDateParseUtil.parseToYMD(\"yyyy-MM-dd\", \"2017-03-01\");\n... | {
"fields": [
{
"declarator": "DATE_FORMAT_1 = \"yyyy-MM-dd\"",
"modifier": "private static final",
"original_string": "private static final String DATE_FORMAT_1 = \"yyyy-MM-dd\";",
"type": "String",
"var_name": "DATE_FORMAT_1"
},
{
"declarator": "DATE_FORMAT_2 = \"yyyy... | {
"body": "public static ShardDate parseToYMD(String dateFormat, Object input) {\n\t\tif (input instanceof Date) {\n\t\t\treturn innerParseToYMD((Date) input);\n\t\t} else if (input instanceof String) {\n\t\t\treturn innerParseToYMD(dateFormat, ((String) input).trim());\n\t\t} else {\n\t\t\tthrow new ZebraConfigExcep... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_48 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/group/jdbc/GroupDataSourceTest.java",
"identifier": "GroupDataSourceTest",
"interfaces": "",
"superclass": "extends MultiDatabaseTestCase"
} | {
"body": "@Test\n\tpublic void test_build_group_datasource_config_filter_from_config() {\n\t\tGroupDataSourceConfig config = new GroupDataSourceConfig();\n\t\tGroupDataSource ds = new GroupDataSource();\n\t\tconfig.setFilters(\"stat\");\n\t\tds.buildFilter(config);\n\t\tAssert.assertEquals(\"stat\", config.getFilter... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(GroupDataSource.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOGGER = LoggerFactory.getLogger(GroupDataSource.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "protected void buildFilter(GroupDataSourceConfig newGroupConfig) {\n\t\tString remoteConfig = newGroupConfig.getFilters();\n\t\tObject beanConfigObject = this.springProperties.get(Constants.SPRING_PROPERTY_FILTER);\n\t\tString beanConfig = beanConfigObject instanceof String ? (String) beanConfigObject : nu... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_25 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testThreadLocalShardValue2() throws ShardParseException {\n\t\tList<Object> params = new ArrayList<Object>();\n\t\tparams.add(\"1\");\n\t\tparams.add(\"2\");\n\t\tparams.add(\"3\");\n\n\t\tShardDataSourceHelper.setShardParams(\"UserId\", params);\n\n\t\tparams = new ArrayList<Object>()... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_33 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "dataSourceRouter",... | {
"body": "@Test\n public void testInOneDataCenter() {\n regionManager.setLocalAddress(\"192.3.1.1\");\n this.dataSourceRouter = new IdcAwareRouter(\n dataSourceConfigManager.getGroupDataSourceConfig().getDataSourceConfigs(), \"local\", null);\n\n RouterTarget routerTarget = thi... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(IdcAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(IdcAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\t\tif (localIdcWeightedRouter != null) {\n\t\t\trouterTarget = localIdcWeightedRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null && remoteIdcWeightedRouter != null) {\n\t\t\tro... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_32 | {
"fields": [
{
"declarator": "dataSourceConfigManager",
"modifier": "private",
"original_string": "private DataSourceConfigManager dataSourceConfigManager;",
"type": "DataSourceConfigManager",
"var_name": "dataSourceConfigManager"
},
{
"declarator": "center1",
"m... | {
"body": "@Test\n\tpublic void testCenterRouter() {\n\t\tSet<String> sets = new HashSet<String>();\n\t\tLocalRegionManager manager = (LocalRegionManager) zebraRegionManager;\n\n\t\tmanager.setLocalAddress(\"192.3.123.21\");\n\t\tDataSourceRouter dataSourceRouter = new CenterAwareRouter(\n\t\t dataSourceConfigMa... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(CenterAwareRouter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CenterAwareRouter.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n\tpublic RouterTarget select(RouterContext routerContext) {\n\t\tRouterTarget routerTarget = null;\n\t\tif (localCenterRouter != null) {\n\t\t\trouterTarget = localCenterRouter.select(routerContext);\n\t\t}\n\n\t\tif (routerTarget == null) {\n\t\t\tfor (WeightDataSourceRouter weightDataSourceRou... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_24 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testThreadLocalShardValue1() throws ShardParseException {\n\t\tList<Object> params = new ArrayList<Object>();\n\t\tparams.add(\"1\");\n\t\tparams.add(\"2\");\n\t\tparams.add(\"3\");\n\n\t\tShardDataSourceHelper.setShardParams(\"UserId\", params);\n\t\tSQLParsedResult parseResult = SQLP... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_49 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/group/jdbc/GroupDataSourceTest.java",
"identifier": "GroupDataSourceTest",
"interfaces": "",
"superclass": "extends MultiDatabaseTestCase"
} | {
"body": "@Test\n\tpublic void test_build_group_datasource_config_filter_from_configManager() {\n\t\tGroupDataSource ds = (GroupDataSource) getDataSource();\n\n\t\tAssert.assertTrue(ds.getConfig().getFilters().contains(\"mock\"));\n\t\tAssert.assertTrue(ds.getConfig().getFilters().contains(\"stat\"));\n\t\tAssert.as... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(GroupDataSource.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger LOGGER = LoggerFactory.getLogger(GroupDataSource.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n\tpublic GroupDataSourceConfig getConfig() {\n\t\treturn groupConfig;\n\t}",
"class_method_signature": "GroupDataSource.getConfig()",
"constructor": false,
"full_signature": "@Override public GroupDataSourceConfig getConfig()",
"identifier": "getConfig",
"invocations": [],
"modifiers... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_7 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardDateParseUtilTest.java",
"identifier": "ShardDateParseUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAddDay() {\n ShardDateParseUtil.ShardDate sd = ShardDateParseUtil.addDay(\"yyyy-MM-dd\", \"2016-02-28\", 1);\n Assert.assertEquals(new ShardDateParseUtil.ShardDate(2016, 1, 28), sd);\n\n sd = ShardDateParseUtil.addDay(\"yyyy-MM-dd\", \"2017-02-28\", 1);\n ... | {
"fields": [
{
"declarator": "DATE_FORMAT_1 = \"yyyy-MM-dd\"",
"modifier": "private static final",
"original_string": "private static final String DATE_FORMAT_1 = \"yyyy-MM-dd\";",
"type": "String",
"var_name": "DATE_FORMAT_1"
},
{
"declarator": "DATE_FORMAT_2 = \"yyyy... | {
"body": "public static ShardDate addDay(String dateFormat, Object input, int delta) {\n\t\tif (input instanceof Date) {\n\t\t\treturn innerAddDay((Date) input, delta);\n\t\t} else if (input instanceof String) {\n\t\t\treturn innerAddDay(dateFormat, (String) input, delta);\n\t\t} else {\n\t\t\tthrow new ShardRouterE... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_28 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMultiSkSingleIn() throws ShardParseException {\n\t\tList<Object> params = new ArrayList<Object>();\n\t\tparams.add(1);\n\t\tparams.add(2);\n\t\tparams.add(3);\n\t\tparams.add(4);\n\t\tparams.add('a');\n\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b fro... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_53 | {
"fields": [],
"file": "zebra-cat-client/src/test/java/com/dianping/zebra/monitor/monitor/GroupDataSourceMonitorTest.java",
"identifier": "GroupDataSourceMonitorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test_get_properties() {\n\t\tGroupDataSourceMBean bean = Mockito.mock(GroupDataSourceMBean.class);\n\t\tMockito.when(bean.getConfig()).thenReturn(new GroupDataSourceConfig());\n\t\tSingleDataSourceMBean single = Mockito.mock(SingleDataSourceMBean.class);\n\n\t\tMockito.when(bean.getWri... | {
"fields": [
{
"declarator": "groupDsCounter = new AtomicInteger()",
"modifier": "private final static",
"original_string": "private final static AtomicInteger groupDsCounter = new AtomicInteger();",
"type": "AtomicInteger",
"var_name": "groupDsCounter"
},
{
"declarato... | {
"body": "@Override\n\tpublic String getDescription() {\n\t\tStringBuilder sb = new StringBuilder(1024 * 3);\n\n\t\tSingleDataSourceMBean writeBean = groupDataSourceBean.getWriteSingleDataSourceMBean();\n\t\tif (writeBean != null) {\n\t\t\tsb.append(\"currentWriter:\" + writeBean.getId() + \" running at state:\" + w... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_12 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/shard/util/ShardColumnValueUtilTest.java",
"identifier": "ShardColumnValueUtilTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMultipalShardColumn3() throws ShardParseException {\n\t\tSQLParsedResult parseResult = SQLParser.parseWithoutCache(\"select a,b from db where `c` = 1 and `d` = ? and `e` = 1\");\n\t\tList<Object> params = new ArrayList<Object>();\n\t\tparams.add(2);\n\t\tShardEvalContext ctx = new ... | {
"fields": [],
"file": "zebra-client/src/main/java/com/dianping/zebra/shard/util/ShardColumnValueUtil.java",
"identifier": "ShardColumnValueUtil",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",... | {
"body": "public static List<ColumnValue> eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange) {\n\t\treturn eval(ctx, shardColumns, isRange, false);\n\t}",
"class_method_signature": "ShardColumnValueUtil.eval(ShardEvalContext ctx, Set<String> shardColumns, boolean isRange)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
66062805_45 | {
"fields": [],
"file": "zebra-client/src/test/java/com/dianping/zebra/group/util/SmoothReloadTest.java",
"identifier": "SmoothReloadTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void test_smooth_reload() {\n\t\tRandom rnd = new Random();\n\t\tlong maxTime = rnd.nextInt(1000);\n\n\t\tSmoothReload sr = new SmoothReload(maxTime);\n\t\tlong now = System.currentTimeMillis();\n\t\tsr.waitForReload();\n\t\tlong interval = System.currentTimeMillis() - now;\n\n\t\tSystem.ou... | {
"fields": [
{
"declarator": "SLEEP_TIME = 100",
"modifier": "public static final",
"original_string": "public static final int SLEEP_TIME = 100;",
"type": "int",
"var_name": "SLEEP_TIME"
},
{
"declarator": "DEFAULT_MAX_MILLISECOND_INTERVAL = 1000",
"modifier": "... | {
"body": "public void waitForReload() {\n\t\tif (maxMillisecondInterval <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\twhile (startMillisecond + randomInterval > System.currentTimeMillis()) {\n\t\t\ttry {\n\t\t\t\tTimeUnit.MILLISECONDS.sleep(SLEEP_TIME);\n\t\t\t} catch (InterruptedException ignore) {\n\t\t\t}\n\t\t}\n\t}",
... | {
"created": null,
"fork": null,
"fork_count": 534,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 66062805,
"size": 7617,
"stargazer_count": 1726,
"stars": null,
"updates": null,
"url": "https://github.com/Meituan-Dianping/Zebra"
} |
72628208_2 | {
"fields": [
{
"declarator": "URI = new Uri.Builder().scheme(\"content\")\n .authority(\"com.doctoror.rxcursorloader.test.provider\").build()",
"modifier": "private static final",
"original_string": "private static final Uri URI = new Uri.Builder().scheme(\"content\")\n .a... | {
"body": "@Test\n public void queryIsValidParcelable() {\n final RxCursorLoader.Query query = new RxCursorLoader.Query.Builder()\n .setContentUri(URI)\n .setProjection(new String[]{MediaStore.Audio.Media._ID})\n .setSortOrder(MediaStore.Audio.Artists.ARTIST)\n ... | {
"fields": [
{
"declarator": "TAG = \"RxCursorLoader\"",
"modifier": "static final",
"original_string": "static final String TAG = \"RxCursorLoader\";",
"type": "String",
"var_name": "TAG"
},
{
"declarator": "LOG_DEBUG = false",
"modifier": "private static",
... | {
"body": "@Deprecated\n @NonNull\n public static Observable<Cursor> create(\n @NonNull final ContentResolver resolver,\n @NonNull final Query query) {\n return observable(resolver, query, Schedulers.io());\n }",
"class_method_signature": "RxCursorLoader.create(\n @N... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 72628208,
"size": 131,
"stargazer_count": 14,
"stars": null,
"updates": null,
"url": "https://github.com/Doctoror/RxCursorLoader"
} |
72628208_0 | {
"fields": [
{
"declarator": "URI = new Uri.Builder().scheme(\"content\")\n .authority(\"com.doctoror.rxcursorloader.test.provider\").build()",
"modifier": "private static final",
"original_string": "private static final Uri URI = new Uri.Builder().scheme(\"content\")\n .a... | {
"body": "@Test(expected = NullPointerException.class)\n public void nullContentResolverThrowsNullPointerException() {\n //noinspection ConstantConditions\n RxCursorLoader.flowable(\n null, buildQuery(), Schedulers.trampoline(), BackpressureStrategy.ERROR);\n }",
"class_method_si... | {
"fields": [
{
"declarator": "TAG = \"RxCursorLoader\"",
"modifier": "static final",
"original_string": "static final String TAG = \"RxCursorLoader\";",
"type": "String",
"var_name": "TAG"
},
{
"declarator": "LOG_DEBUG = false",
"modifier": "private static",
... | {
"body": "@NonNull\n public static Flowable<Cursor> flowable(\n @NonNull final ContentResolver resolver,\n @NonNull final Query query,\n @NonNull final Scheduler scheduler,\n @NonNull final BackpressureStrategy backpressureStrategy) {\n return RxCursorLoaderFlowa... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 72628208,
"size": 131,
"stargazer_count": 14,
"stars": null,
"updates": null,
"url": "https://github.com/Doctoror/RxCursorLoader"
} |
72628208_1 | {
"fields": [
{
"declarator": "URI = new Uri.Builder().scheme(\"content\")\n .authority(\"com.doctoror.rxcursorloader.test.provider\").build()",
"modifier": "private static final",
"original_string": "private static final Uri URI = new Uri.Builder().scheme(\"content\")\n .a... | {
"body": "@Test(expected = NullPointerException.class)\n public void nullQueryThrowsNullPointerException() {\n //noinspection ConstantConditions\n RxCursorLoader.flowable(\n contentResolver, null, Schedulers.trampoline(), BackpressureStrategy.ERROR);\n }",
"class_method_signature... | {
"fields": [
{
"declarator": "TAG = \"RxCursorLoader\"",
"modifier": "static final",
"original_string": "static final String TAG = \"RxCursorLoader\";",
"type": "String",
"var_name": "TAG"
},
{
"declarator": "LOG_DEBUG = false",
"modifier": "private static",
... | {
"body": "@NonNull\n public static Flowable<Cursor> flowable(\n @NonNull final ContentResolver resolver,\n @NonNull final Query query,\n @NonNull final Scheduler scheduler,\n @NonNull final BackpressureStrategy backpressureStrategy) {\n return RxCursorLoaderFlowa... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 72628208,
"size": 131,
"stargazer_count": 14,
"stars": null,
"updates": null,
"url": "https://github.com/Doctoror/RxCursorLoader"
} |
32870652_2 | {
"fields": [
{
"declarator": "STANDARD_FREQUENCIES_UNITTEST = new double[]{100, 125, 160, 200, 250, 315, 400, 500, 630, 800, 1000, 1250, 1600, 2000, 2500, 3150, 4000, 5000, 6300, 8000, 10000, 12500, 16000}",
"modifier": "public static final",
"original_string": "public static final double[] STA... | {
"body": "@Test\n public void testVoice1() throws IOException {\n final int sampleRate = 44100;\n double p0 = 32767.;\n double dbFsReference = -20 * Math.log10(p0);\n // Reference spectrum\n double[] refSpl = {-66, -68.04, -67.52, -45.97, -31.96, -37.13, -49.21, -35.29, -43.01,\... | {
"fields": [
{
"declarator": "window",
"modifier": "public final",
"original_string": "public final FFTSignalProcessing.WINDOW_TYPE window;",
"type": "FFTSignalProcessing.WINDOW_TYPE",
"var_name": "window"
},
{
"declarator": "signalProcessing",
"modifier": "priva... | {
"body": "private void processSample() {\n lastProcessedSpectrum = pushedSamples;\n FFTSignalProcessing.ProcessingResult result = signalProcessing.processSample(window,\n aWeighting, true);\n // Move result by 1 backward\n if(windowResults.length > 1) {\n System.... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32870652,
"size": 77510,
"stargazer_count": 39,
"stars": null,
"updates": null,
"url": "https://github.com/Ifsttar/NoiseCapture"
} |
32870652_0 | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ThirdOctaveBandsFiltering.class)",
"modifier": "private final static",
"original_string": "private final static Logger LOGGER = LoggerFactory.getLogger(ThirdOctaveBandsFiltering.class);",
"type": "Logger",
"var_name": "L... | {
"body": "@Test\n public void testReadCsv() {\n int samplingRate = 44100;\n ThirdOctaveBandsFiltering.FREQUENCY_BANDS frequencyBands = ThirdOctaveBandsFiltering.FREQUENCY_BANDS.REDUCED;\n ThirdOctaveBandsFiltering thirdOctaveBandsFiltering = new ThirdOctaveBandsFiltering(samplingRate, frequen... | {
"fields": [
{
"declarator": "expectedSampleLength",
"modifier": "private",
"original_string": "private int expectedSampleLength;",
"type": "int",
"var_name": "expectedSampleLength"
},
{
"declarator": "samplingRate",
"modifier": "private",
"original_string"... | {
"body": "public List<FiltersParameters> getFilterParameters() { return filterParameters; }",
"class_method_signature": "ThirdOctaveBandsFiltering.getFilterParameters()",
"constructor": false,
"full_signature": "public List<FiltersParameters> getFilterParameters()",
"identifier": "getFilterParameters",
"in... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32870652,
"size": 77510,
"stargazer_count": 39,
"stars": null,
"updates": null,
"url": "https://github.com/Ifsttar/NoiseCapture"
} |
32870652_1 | {
"fields": [],
"file": "sosfilter/src/test/java/org/orbisgis/sos/AWeightingTest.java",
"identifier": "AWeightingTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAWeighting() throws IOException, UnsupportedAudioFileException {\n\n /*\n Reference data (i.e. expected results)\n */\n\n // Reference A-weighted signal (i.e. expected results)\n Scanner scanExpectedData = new Scanner(new File(\"src/test/resour... | {
"fields": [
{
"declarator": "denominator = new double[]{ 1.0,\n -4.0195761811158306,\n 6.1894064429206894,\n -4.4531989035441137... | {
"body": "public static double[] aWeightingSignal(double[] inputSignal) {\n\n int signalLength = inputSignal.length;\n int order = Math.max(denominator.length, numerator.length);\n double[] weightedSignal = new double[signalLength];\n // Filter delays\n double[][] z = new double[or... | {
"created": null,
"fork": null,
"fork_count": 21,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32870652,
"size": 77510,
"stargazer_count": 39,
"stars": null,
"updates": null,
"url": "https://github.com/Ifsttar/NoiseCapture"
} |
84466727_9 | {
"fields": [
{
"declarator": "SECRET = Secret.secret(\"keys\", \"/etc/keys\")",
"modifier": "private static final",
"original_string": "private static final Secret SECRET = Secret.secret(\"keys\", \"/etc/keys\");",
"type": "Secret",
"var_name": "SECRET"
},
{
"declarato... | {
"body": "@Test(expected=RuntimeException.class)\n public void forbidImageInYaml() throws Exception {\n RunEnvironment env = fromYaml(\"/with-image.yaml\");\n Pod pod = createPod(env);\n }",
"class_method_signature": "KubernetesDockerRunnerTest.forbidImageInYaml()",
"constructor": false,
"full_signatur... | {
"fields": [
{
"declarator": "HYPE_RUN = \"hype-run\"",
"modifier": "static final",
"original_string": "static final String HYPE_RUN = \"hype-run\";",
"type": "String",
"var_name": "HYPE_RUN"
},
{
"declarator": "EXECUTION_ID = \"HYPE_EXECUTION_ID\"",
"modifier": ... | {
"body": "@VisibleForTesting\n Pod createPod(RunSpec runSpec) {\n final String podName = HYPE_RUN + \"-\" + randomAlphaNumeric(8);\n final RunEnvironment env = runSpec.runEnvironment();\n final List<Secret> secrets = env.secretMounts();\n final StagedContinuation stagedContinuation = runSpec.stagedConti... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_5 | {
"fields": [
{
"declarator": "testFiles",
"modifier": "",
"original_string": "List<String> testFiles;",
"type": "List<String>",
"var_name": "testFiles"
},
{
"declarator": "stagingPath",
"modifier": "",
"original_string": "Path stagingPath;",
"type": "... | {
"body": "@Test\n public void end2endStaging() throws Exception {\n List<StagedPackage> stagedPackages =\n StagingUtil.stageClasspathElements(testFiles, stagingLocation);\n\n RunManifest manifest = new RunManifestBuilder()\n .continuation(stagedPackages.get(0).name())\n .files(stagedPacka... | {
"fields": [
{
"declarator": "FJP = new ForkJoinPool(32)",
"modifier": "private static final",
"original_string": "private static final ForkJoinPool FJP = new ForkJoinPool(32);",
"type": "ForkJoinPool",
"var_name": "FJP"
}
],
"file": "hype-gcs/src/main/java/com/spotify/hype/... | {
"body": "public static RunManifest downloadManifest(Path manifestPath, Path destinationDir) throws IOException {\n final RunManifest manifest = ManifestUtil.read(manifestPath);\n\n final Set<Path> manifestEntries = new LinkedHashSet<>();\n manifestEntries.add(manifestPath.resolveSibling(manifest.continuati... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_12 | {
"fields": [
{
"declarator": "EXISTING_CLAIM = \"name-class-16Gi\"",
"modifier": "private static final",
"original_string": "private static final String EXISTING_CLAIM = \"name-class-16Gi\";",
"type": "String",
"var_name": "EXISTING_CLAIM"
},
{
"declarator": "expect = ... | {
"body": "@Test\n public void createWhenExistingClaimNotFound() throws Exception {\n VolumeRequest request = VolumeRequest.createIfNotExists(\"new-claim\", \"class\", \"16Gi\");\n PersistentVolumeClaim claim = volumeRepository.getClaim(request);\n\n assertThat(claim, not(mockPvc));\n assertThat(\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(VolumeRepository.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(VolumeRepository.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "PersistentVolumeClaim getClaim(VolumeRequest volumeRequest) {\n return claims.computeIfAbsent(volumeRequest, this::createClaim);\n }",
"class_method_signature": "VolumeRepository.getClaim(VolumeRequest volumeRequest)",
"constructor": false,
"full_signature": " PersistentVolumeClaim getClaim(Volum... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_13 | {
"fields": [
{
"declarator": "EXISTING_CLAIM = \"name-class-16Gi\"",
"modifier": "private static final",
"original_string": "private static final String EXISTING_CLAIM = \"name-class-16Gi\";",
"type": "String",
"var_name": "EXISTING_CLAIM"
},
{
"declarator": "expect = ... | {
"body": "@Test\n public void cachesRequestClaims() throws Exception {\n VolumeRequest request = VolumeRequest.volumeRequest(\"storage-class-name\", \"16Gi\");\n volumeRepository.getClaim(request);\n volumeRepository.getClaim(request);\n\n verify(pvcs, times(1)).create(any());\n }",
"class_method_sig... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(VolumeRepository.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(VolumeRepository.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "PersistentVolumeClaim getClaim(VolumeRequest volumeRequest) {\n return claims.computeIfAbsent(volumeRequest, this::createClaim);\n }",
"class_method_signature": "VolumeRepository.getClaim(VolumeRequest volumeRequest)",
"constructor": false,
"full_signature": " PersistentVolumeClaim getClaim(Volum... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_4 | {
"fields": [
{
"declarator": "EXAMPLE = new RunManifestBuilder()\n .continuation(\"continuation-ce89ba3b.bin\")\n .classPathFiles(\"lib1.jar\", \"lib2.jar\", \"lib3.jar\")\n .files(\"other-file.txt\")\n .build()",
"modifier": "private static final",
"original_string": "priva... | {
"body": "@Test\n public void malformedManifest() throws Exception {\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(\"Malformed manifest line 'clib2.jar'\");\n\n Path manifestPath = load(\"/malformed-manifest.txt\");\n ManifestUtil.read(manifestPath);\n }",
"class_metho... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ManifestUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ManifestUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarat... | {
"body": "static RunManifest read(Path manifestPath) throws IOException {\n final Stream<String> lines = Files.lines(manifestPath);\n\n final RunManifestBuilder builder = new RunManifestBuilder();\n lines.forEachOrdered(line -> {\n if (line.trim().isEmpty()) {\n return;\n }\n\n final S... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_8 | {
"fields": [
{
"declarator": "testFilePath",
"modifier": "",
"original_string": "String testFilePath;",
"type": "String",
"var_name": "testFilePath"
},
{
"declarator": "filenameWithoutExtension",
"modifier": "",
"original_string": "String filenameWithoutExt... | {
"body": "@Test\n public void returnStagedLocations() throws Exception {\n List<StagingUtil.StagedPackage> stagedPackages =\n StagingUtil.stageClasspathElements(singletonList(testFilePath), stagingPath);\n\n assertThat(stagedPackages, hasSize(1));\n StagingUtil.StagedPackage stagedPackage = stagedPa... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(StagingUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(StagingUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator... | {
"body": "public static List<StagedPackage> stageClasspathElements(\n Collection<String> classpathElements, String stagingPath) {\n LOG.info(\"Uploading {} files to staging location {} to \"\n + \"prepare for execution.\", classpathElements.size(), stagingPath);\n\n if (classpathElements.size(... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_3 | {
"fields": [
{
"declarator": "EXAMPLE = new RunManifestBuilder()\n .continuation(\"continuation-ce89ba3b.bin\")\n .classPathFiles(\"lib1.jar\", \"lib2.jar\", \"lib3.jar\")\n .files(\"other-file.txt\")\n .build()",
"modifier": "private static final",
"original_string": "priva... | {
"body": "@Test\n public void skipEmptyLines() throws Exception {\n Path manifestPath = load(\"/empty-lines-manifest.txt\");\n RunManifest manifest = ManifestUtil.read(manifestPath);\n\n assertThat(manifest, is(EXAMPLE));\n }",
"class_method_signature": "ManifestUtilTest.skipEmptyLines()",
"constructo... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ManifestUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ManifestUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarat... | {
"body": "static RunManifest read(Path manifestPath) throws IOException {\n final Stream<String> lines = Files.lines(manifestPath);\n\n final RunManifestBuilder builder = new RunManifestBuilder();\n lines.forEachOrdered(line -> {\n if (line.trim().isEmpty()) {\n return;\n }\n\n final S... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_2 | {
"fields": [
{
"declarator": "EXAMPLE = new RunManifestBuilder()\n .continuation(\"continuation-ce89ba3b.bin\")\n .classPathFiles(\"lib1.jar\", \"lib2.jar\", \"lib3.jar\")\n .files(\"other-file.txt\")\n .build()",
"modifier": "private static final",
"original_string": "priva... | {
"body": "@Test\n public void writeManifest() throws Exception {\n Path manifest = Files.createTempFile(\"manifest\", \".txt\");\n ManifestUtil.write(EXAMPLE, manifest);\n\n List<String> expected = Files.readAllLines(load(\"/example-manifest.txt\"));\n List<String> strings = Files.readAllLines(manifest)... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ManifestUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ManifestUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarat... | {
"body": "static void write(RunManifest manifest, Path manifestPath) throws IOException {\n try (PrintWriter writer = new PrintWriter(Files.newOutputStream(manifestPath))) {\n writer.write(LAMBDA + \" \" + manifest.continuation() + '\\n');\n manifest.classPathFiles().forEach(cpf -> writer.write(CLASSPAT... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_1 | {
"fields": [
{
"declarator": "EXAMPLE = new RunManifestBuilder()\n .continuation(\"continuation-ce89ba3b.bin\")\n .classPathFiles(\"lib1.jar\", \"lib2.jar\", \"lib3.jar\")\n .files(\"other-file.txt\")\n .build()",
"modifier": "private static final",
"original_string": "priva... | {
"body": "@Test\n public void multipleContinuation() throws Exception {\n Path manifestPath = load(\"/multi-lambda-manifest.txt\");\n RunManifest manifest = ManifestUtil.read(manifestPath);\n\n assertThat(manifest.continuation(), is(\"continuation-other.bin\"));\n }",
"class_method_signature": "Manifest... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ManifestUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ManifestUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarat... | {
"body": "static RunManifest read(Path manifestPath) throws IOException {\n final Stream<String> lines = Files.lines(manifestPath);\n\n final RunManifestBuilder builder = new RunManifestBuilder();\n lines.forEachOrdered(line -> {\n if (line.trim().isEmpty()) {\n return;\n }\n\n final S... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_0 | {
"fields": [
{
"declarator": "EXAMPLE = new RunManifestBuilder()\n .continuation(\"continuation-ce89ba3b.bin\")\n .classPathFiles(\"lib1.jar\", \"lib2.jar\", \"lib3.jar\")\n .files(\"other-file.txt\")\n .build()",
"modifier": "private static final",
"original_string": "priva... | {
"body": "@Test\n public void readManifest() throws Exception {\n Path manifestPath = load(\"/example-manifest.txt\");\n RunManifest manifest = ManifestUtil.read(manifestPath);\n\n assertThat(manifest, is(EXAMPLE));\n }",
"class_method_signature": "ManifestUtilTest.readManifest()",
"constructor": fals... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(ManifestUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(ManifestUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarat... | {
"body": "static RunManifest read(Path manifestPath) throws IOException {\n final Stream<String> lines = Files.lines(manifestPath);\n\n final RunManifestBuilder builder = new RunManifestBuilder();\n lines.forEachOrdered(line -> {\n if (line.trim().isEmpty()) {\n return;\n }\n\n final S... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_10 | {
"fields": [
{
"declarator": "EXISTING_CLAIM = \"name-class-16Gi\"",
"modifier": "private static final",
"original_string": "private static final String EXISTING_CLAIM = \"name-class-16Gi\";",
"type": "String",
"var_name": "EXISTING_CLAIM"
},
{
"declarator": "expect = ... | {
"body": "@Test\n public void createsNewVolumeClaim() throws Exception {\n VolumeRequest request = VolumeRequest.volumeRequest(\"storage-class-name\", \"16Gi\");\n PersistentVolumeClaim claim = volumeRepository.getClaim(request);\n\n assertThat(claim.getMetadata().getName(), equalTo(request.id()));\n as... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(VolumeRepository.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(VolumeRepository.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "PersistentVolumeClaim getClaim(VolumeRequest volumeRequest) {\n return claims.computeIfAbsent(volumeRequest, this::createClaim);\n }",
"class_method_signature": "VolumeRepository.getClaim(VolumeRequest volumeRequest)",
"constructor": false,
"full_signature": " PersistentVolumeClaim getClaim(Volum... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_7 | {
"fields": [
{
"declarator": "testFilePath",
"modifier": "",
"original_string": "String testFilePath;",
"type": "String",
"var_name": "testFilePath"
},
{
"declarator": "filenameWithoutExtension",
"modifier": "",
"original_string": "String filenameWithoutExt... | {
"body": "@Test\n public void detectsAlreadyStagedFiles() throws Exception {\n StagingUtil.stageClasspathElements(singletonList(testFilePath), stagingPath);\n StagingUtil.stageClasspathElements(singletonList(testFilePath), stagingPath);\n\n List<String> list = Files.list(tmp).map(Path::toString).collect(to... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(StagingUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(StagingUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator... | {
"body": "public static List<StagedPackage> stageClasspathElements(\n Collection<String> classpathElements, String stagingPath) {\n LOG.info(\"Uploading {} files to staging location {} to \"\n + \"prepare for execution.\", classpathElements.size(), stagingPath);\n\n if (classpathElements.size(... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_6 | {
"fields": [
{
"declarator": "testFilePath",
"modifier": "",
"original_string": "String testFilePath;",
"type": "String",
"var_name": "testFilePath"
},
{
"declarator": "filenameWithoutExtension",
"modifier": "",
"original_string": "String filenameWithoutExt... | {
"body": "@Test\n public void stagesFileWithHashedFilename() throws Exception {\n StagingUtil.stageClasspathElements(singletonList(testFilePath), stagingPath);\n\n List<String> list = Files.list(tmp).map(Path::toString).collect(toList());\n assertThat(list, hasSize(1));\n assertThat(list, hasItem(contai... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(StagingUtil.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(StagingUtil.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"declarator... | {
"body": "public static List<StagedPackage> stageClasspathElements(\n Collection<String> classpathElements, String stagingPath) {\n LOG.info(\"Uploading {} files to staging location {} to \"\n + \"prepare for execution.\", classpathElements.size(), stagingPath);\n\n if (classpathElements.size(... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
84466727_11 | {
"fields": [
{
"declarator": "EXISTING_CLAIM = \"name-class-16Gi\"",
"modifier": "private static final",
"original_string": "private static final String EXISTING_CLAIM = \"name-class-16Gi\";",
"type": "String",
"var_name": "EXISTING_CLAIM"
},
{
"declarator": "expect = ... | {
"body": "@Test\n public void returnsExistingClaim() throws Exception {\n VolumeRequest request = VolumeRequest.createIfNotExists(\"name\", \"class\", \"16Gi\");\n PersistentVolumeClaim claim = volumeRepository.getClaim(request);\n\n assertThat(claim, is(mockPvc));\n }",
"class_method_signature": "Volum... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(VolumeRepository.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(VolumeRepository.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"... | {
"body": "PersistentVolumeClaim getClaim(VolumeRequest volumeRequest) {\n return claims.computeIfAbsent(volumeRequest, this::createClaim);\n }",
"class_method_signature": "VolumeRepository.getClaim(VolumeRequest volumeRequest)",
"constructor": false,
"full_signature": " PersistentVolumeClaim getClaim(Volum... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 84466727,
"size": 537,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/spotify/hype"
} |
58279246_1 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "@Test\n public void testInitFromEtcd() throws Exception {\n client.put(FLAGZ_PATH + \"etcd_test_int\", \"101\").send().get();\n client.put(FLAGZ_PATH + \"etcd_test_string\", \"etcdinit_overwritten\").send().get();\n etcdUpdater.init();\n assertThat(flagInt.get(), is(101));\n assertThat(flag... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "public void init() {\n init(Preconditions.checkNotNull(Strings.emptyToNull(directoryFlag.get())));\n }",
"class_method_signature": "EtcdFlagFieldUpdater.init()",
"constructor": false,
"full_signature": "public void init()",
"identifier": "init",
"invocations": [
"init",
"checkNotNull"... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 58279246,
"size": 83,
"stargazer_count": 30,
"stars": null,
"updates": null,
"url": "https://github.com/mwitkow/java-flagz"
} |
58279246_0 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "@Test\n public void testNothingInEtcd() throws Exception {\n etcdUpdater.init();\n assertThat(flagInt.get(), is(flagInt.defaultValue()));\n assertThat(flagString.get(), is(\"cmdline_overwrite\"));\n assertThat(flagMap.get(), is(flagMap.defaultValue()));\n }",
"class_method_signature": "Etcd... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "public void init() {\n init(Preconditions.checkNotNull(Strings.emptyToNull(directoryFlag.get())));\n }",
"class_method_signature": "EtcdFlagFieldUpdater.init()",
"constructor": false,
"full_signature": "public void init()",
"identifier": "init",
"invocations": [
"init",
"checkNotNull"... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 58279246,
"size": 83,
"stargazer_count": 30,
"stars": null,
"updates": null,
"url": "https://github.com/mwitkow/java-flagz"
} |
58279246_7 | {
"fields": [
{
"declarator": "EMPTY_ARGS = {}",
"modifier": "public static final",
"original_string": "public static final String[] EMPTY_ARGS = {};",
"type": "String[]",
"var_name": "EMPTY_ARGS"
},
{
"declarator": "EMPTY_PACKAGE_PREFIXES = ImmutableList.of()",
"... | {
"body": "@Test\n public void testListenerFiredOnCommandLine() {\n String[] args = {\"--test_flag_string=moo\"};\n FlagFieldRegistry registry = Flagz.parse(args, EMPTY_PACKAGE_PREFIXES, SET_OF_THIS_TEST);\n verify(mockConsumer).accept(\"moo\");\n }",
"class_method_signature": "BaseFlagTest.testListenerF... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FlagFieldRegistry.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FlagFieldRegistry.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "@Override\n public void accept(T value) {\n checkValidators(value);\n this.value = value;\n notifyListeners(value);\n }",
"class_method_signature": "BaseFlag.accept(T value)",
"constructor": false,
"full_signature": "@Override public void accept(T value)",
"identifier": "accept",
"invo... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 58279246,
"size": 83,
"stargazer_count": 30,
"stars": null,
"updates": null,
"url": "https://github.com/mwitkow/java-flagz"
} |
58279246_6 | {
"fields": [
{
"declarator": "EMPTY_ARGS = {}",
"modifier": "public static final",
"original_string": "public static final String[] EMPTY_ARGS = {};",
"type": "String[]",
"var_name": "EMPTY_ARGS"
},
{
"declarator": "EMPTY_PACKAGE_PREFIXES = ImmutableList.of()",
"... | {
"body": "@Test\n public void testNoActionOnDefultValues() {\n String[] args = {};\n // This should not throw an exception, as default values are not subject to validators.\n Flagz.parse(args, EMPTY_PACKAGE_PREFIXES, SET_OF_THIS_TEST);\n verify(mockConsumer, never()).accept(anyString());\n }",
"class... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FlagFieldRegistry.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FlagFieldRegistry.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "@Override\n public void accept(T value) {\n checkValidators(value);\n this.value = value;\n notifyListeners(value);\n }",
"class_method_signature": "BaseFlag.accept(T value)",
"constructor": false,
"full_signature": "@Override public void accept(T value)",
"identifier": "accept",
"invo... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 58279246,
"size": 83,
"stargazer_count": 30,
"stars": null,
"updates": null,
"url": "https://github.com/mwitkow/java-flagz"
} |
58279246_5 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "@Test(expected = FlagException.BadValue.class)\n public void testInitFromEtcd_BadValue_ThrowsException() throws Exception {\n // 99 is below the >100 validator.\n client.put(FLAGZ_PATH + \"etcd_test_int\", \"99\").send().get();\n etcdUpdater.init();\n }",
"class_method_signature": "EtcdFlagFie... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "public void init() {\n init(Preconditions.checkNotNull(Strings.emptyToNull(directoryFlag.get())));\n }",
"class_method_signature": "EtcdFlagFieldUpdater.init()",
"constructor": false,
"full_signature": "public void init()",
"identifier": "init",
"invocations": [
"init",
"checkNotNull"... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 58279246,
"size": 83,
"stargazer_count": 30,
"stars": null,
"updates": null,
"url": "https://github.com/mwitkow/java-flagz"
} |
58279246_4 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "@Test(expected = FlagException.IllegalFormat.class)\n public void testInitFromEtcd_IllegalFormat_ThrowsException() throws Exception {\n client.put(FLAGZ_PATH + \"etcd_test_map_int\", \"random_stuff\").send().get();\n etcdUpdater.init();\n }",
"class_method_signature": "EtcdFlagFieldUpdaterTest.te... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "public void init() {\n init(Preconditions.checkNotNull(Strings.emptyToNull(directoryFlag.get())));\n }",
"class_method_signature": "EtcdFlagFieldUpdater.init()",
"constructor": false,
"full_signature": "public void init()",
"identifier": "init",
"invocations": [
"init",
"checkNotNull"... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 58279246,
"size": 83,
"stargazer_count": 30,
"stars": null,
"updates": null,
"url": "https://github.com/mwitkow/java-flagz"
} |
58279246_8 | {
"fields": [
{
"declarator": "EMPTY_ARGS = {}",
"modifier": "public static final",
"original_string": "public static final String[] EMPTY_ARGS = {};",
"type": "String[]",
"var_name": "EMPTY_ARGS"
},
{
"declarator": "EMPTY_PACKAGE_PREFIXES = ImmutableList.of()",
"... | {
"body": "@Test\n public void testListenerFiredOnDynamicChange() {\n String[] args = {};\n FlagFieldRegistry registry = Flagz.parse(args, EMPTY_PACKAGE_PREFIXES, SET_OF_THIS_TEST);\n registry.setField(\"test_flag_string\", \"foo\");\n verify(mockConsumer).accept(\"foo\");\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(FlagFieldRegistry.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(FlagFieldRegistry.class);",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "@Override\n public void accept(T value) {\n checkValidators(value);\n this.value = value;\n notifyListeners(value);\n }",
"class_method_signature": "BaseFlag.accept(T value)",
"constructor": false,
"full_signature": "@Override public void accept(T value)",
"identifier": "accept",
"invo... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 58279246,
"size": 83,
"stargazer_count": 30,
"stars": null,
"updates": null,
"url": "https://github.com/mwitkow/java-flagz"
} |
58279246_3 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "@Test(expected = FlagException.UnknownFlag.class)\n public void testInitFromEtcd_UnknownFlag_ThrowsException() throws Exception {\n client.put(FLAGZ_PATH + \"etcd_test_some_flag\", \"123\").send().get();\n etcdUpdater.init();\n }",
"class_method_signature": "EtcdFlagFieldUpdaterTest.testInitFromE... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "public void init() {\n init(Preconditions.checkNotNull(Strings.emptyToNull(directoryFlag.get())));\n }",
"class_method_signature": "EtcdFlagFieldUpdater.init()",
"constructor": false,
"full_signature": "public void init()",
"identifier": "init",
"invocations": [
"init",
"checkNotNull"... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 58279246,
"size": 83,
"stargazer_count": 30,
"stars": null,
"updates": null,
"url": "https://github.com/mwitkow/java-flagz"
} |
58279246_2 | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "@Test\n public void testInitFromEtcd_CallsListener() throws Exception {\n client.put(FLAGZ_PATH + \"etcd_test_int\", \"333\").send().get();\n etcdUpdater.init();\n assertThat(flagInt.get(), is(333));\n verify(intListener).accept(eq(333));\n }",
"class_method_signature": "EtcdFlagFieldUpdate... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcdFlagFieldUpdater.class);",
"type": "Logger",
"var_name": "LOG"
},
{... | {
"body": "public void init() {\n init(Preconditions.checkNotNull(Strings.emptyToNull(directoryFlag.get())));\n }",
"class_method_signature": "EtcdFlagFieldUpdater.init()",
"constructor": false,
"full_signature": "public void init()",
"identifier": "init",
"invocations": [
"init",
"checkNotNull"... | {
"created": null,
"fork": null,
"fork_count": 5,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 58279246,
"size": 83,
"stargazer_count": 30,
"stars": null,
"updates": null,
"url": "https://github.com/mwitkow/java-flagz"
} |
105770301_25 | {
"fields": [
{
"declarator": "DS_NAME = \"executeSqlData\"",
"modifier": "private static final",
"original_string": "private static final String DS_NAME = \"executeSqlData\";",
"type": "String",
"var_name": "DS_NAME"
},
{
"declarator": "h2Server",
"modifier": "pr... | {
"body": "@Test\n public void testFetchAllRows() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"SQLStatement\",\n \"select * from Person\");\n\n ExecuteSq... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ExecuteSqlWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ExecuteSqlWorkItemHandler.class);",
"type": "Logger",
"var_name": "l... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager workItemManager) {\n Connection connection = null;\n PreparedStatement statement = null;\n ResultSet resultSet = null;\n\n try {\n RequiredParameterValidator.validate(this.... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_13 | {
"fields": [
{
"declarator": "tempFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "tempFolder"
}
],
"file": "archive-workitem/... | {
"body": "@Test\n public void testNoArchiveSpecified() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"Files\",\n new ArrayList<File>());\n\n ArchiveWorkIt... | {
"fields": [],
"file": "archive-workitem/src/main/java/org/jbpm/process/workitem/archive/ArchiveWorkItemHandler.java",
"identifier": "ArchiveWorkItemHandler",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArchiveWorkItemHandler.executeWorkItem(WorkItem workItem,\n ... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager manager) {\n String archive = (String) workItem.getParameter(\"Archive\");\n List<File> files = (List<File>) workItem.getParameter(\"Files\");\n\n try {\n RequiredParameterValidat... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_3 | {
"fields": [],
"file": "exec-workitem/src/test/java/org/jbpm/process/workitem/exec/ExecShellScriptWorkItemHandlerTest.java",
"identifier": "ExecShellScriptWorkItemHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExecShellScriptCommandWithRemoveEnvironmentVariables() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"ShellScriptLocation\", \"src/test/resources/TestScript... | {
"fields": [
{
"declarator": "RESULT = \"Output\"",
"modifier": "public static final",
"original_string": "public static final String RESULT = \"Output\";",
"type": "String",
"var_name": "RESULT"
},
{
"declarator": "logger = LoggerFactory.getLogger(ExecShellScriptWorkI... | {
"body": "public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {\n\n try {\n\n RequiredParameterValidator.validate(this.getClass(), workItem);\n String shellScriptLocation = (String) workItem.getParameter(\"ShellScriptLocation\");\n String tout = (String) wo... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_28 | {
"fields": [
{
"declarator": "DS_NAME = \"executeSqlData\"",
"modifier": "private static final",
"original_string": "private static final String DS_NAME = \"executeSqlData\";",
"type": "String",
"var_name": "DS_NAME"
},
{
"declarator": "h2Server",
"modifier": "pr... | {
"body": "@Test\n public void testUpdate() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"SQLStatement\",\n \"update Person set age=4 where id = 3\");\n E... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(ExecuteSqlWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(ExecuteSqlWorkItemHandler.class);",
"type": "Logger",
"var_name": "l... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager workItemManager) {\n Connection connection = null;\n PreparedStatement statement = null;\n ResultSet resultSet = null;\n\n try {\n RequiredParameterValidator.validate(this.... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_2 | {
"fields": [],
"file": "exec-workitem/src/test/java/org/jbpm/process/workitem/exec/ExecShellScriptWorkItemHandlerTest.java",
"identifier": "ExecShellScriptWorkItemHandlerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testExecShellScriptCommandWithAddEnvironmentVariables() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setParameter(\"ShellScriptLocation\", \"src/test/resources/TestScript.sh... | {
"fields": [
{
"declarator": "RESULT = \"Output\"",
"modifier": "public static final",
"original_string": "public static final String RESULT = \"Output\";",
"type": "String",
"var_name": "RESULT"
},
{
"declarator": "logger = LoggerFactory.getLogger(ExecShellScriptWorkI... | {
"body": "public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {\n\n try {\n\n RequiredParameterValidator.validate(this.getClass(), workItem);\n String shellScriptLocation = (String) workItem.getParameter(\"ShellScriptLocation\");\n String tout = (String) wo... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_12 | {
"fields": [
{
"declarator": "tempFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "tempFolder"
}
],
"file": "archive-workitem/... | {
"body": "@Test\n public void testWithTempFile() throws Exception {\n TestWorkItemManager manager = new TestWorkItemManager();\n WorkItemImpl workItem = new WorkItemImpl();\n workItem.setId(123L);\n\n File tempFile = tempFolder.newFile(\"tempFile1.txt\");\n FileUtils.writeString... | {
"fields": [],
"file": "archive-workitem/src/main/java/org/jbpm/process/workitem/archive/ArchiveWorkItemHandler.java",
"identifier": "ArchiveWorkItemHandler",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArchiveWorkItemHandler.executeWorkItem(WorkItem workItem,\n ... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager manager) {\n String archive = (String) workItem.getParameter(\"Archive\");\n List<File> files = (List<File>) workItem.getParameter(\"Files\");\n\n try {\n RequiredParameterValidat... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
105770301_24 | {
"fields": [],
"file": "mavenembedder-workitem/src/test/java/org/jbpm/process/workitem/mavenembedder/MavenEmbedderWorkitemHandlerTest.java",
"identifier": "MavenEmbedderWorkitemHandlerTest",
"interfaces": "",
"superclass": "extends AbstractBaseTest"
} | {
"body": "@Test(expected = WorkItemHandlerRuntimeException.class)\n public void testCleanInstallSimpleProjectWithInvalidParams() {\n TestWorkItemManager manager = new TestWorkItemManager();\n\n WorkItemImpl workItem = new WorkItemImpl();\n\n MavenEmbedderWorkItemHandler handler = new MavenEmb... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(MavenEmbedderWorkItemHandler.class)",
"modifier": "private static final",
"original_string": "private static final Logger logger = LoggerFactory.getLogger(MavenEmbedderWorkItemHandler.class);",
"type": "Logger",
"var_nam... | {
"body": "public void executeWorkItem(WorkItem workItem,\n WorkItemManager workItemManager) {\n\n try {\n\n RequiredParameterValidator.validate(this.getClass(),\n workItem);\n\n String goals = (String) workItem... | {
"created": "10/4/2017 1:15:54 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 105770301,
"size": null,
"stargazer_count": null,
"stars": 24,
"updates": "2020-01-20T08:34:36+00:00",
"url": "https://github.com/kiegroup/jbpm-wo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.