id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
215950115_53
{ "fields": [ { "declarator": "message01Repository", "modifier": "private", "original_string": "private Message01Repository message01Repository;", "type": "Message01Repository", "var_name": "message01Repository" }, { "declarator": "dbNodeService", "modifier": "pri...
{ "body": "@Test\n\tpublic void getMessageByIdsTest() {\n\t\tmessage01ServiceImpl.getMessageByIds(\"test\", Arrays.asList(1L)); \n\t\tverify(message01Repository).getMessageByIds(anyString(), anyList());\n\t\tmessage01ServiceImpl.setDbId(1);\n\t\tboolean rs = false;\n\t\tdoThrow(new RuntimeException(\"test\")).when(me...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "publ...
{ "body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.NOT_SUPPORTED, value = \"msgTransactionManager\")\n\tpublic List<Message01Entity> getMessageByIds(String tbName, List<Long> ids) {\n\t\tsetMaster(false);\n\t\tList<Message01Entity> message01Entitys = null;\n\t\ttry {\n\t\t...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_126
{ "fields": [ { "declarator": "consumerCommitServiceImpl = null", "modifier": "", "original_string": "ConsumerCommitServiceImpl consumerCommitServiceImpl = null;", "type": "ConsumerCommitServiceImpl", "var_name": "consumerCommitServiceImpl" }, { "declarator": "queueOffs...
{ "body": "@Test\n\tpublic void clearOldDataTest() {\n\t\t//init();\n\t\tconsumerCommitServiceImpl.lastTime=1L;\n\t\tconsumerCommitServiceImpl.failMapAppPolling.put(1L, new ConsumerQueueVersionDto());\n\t\tconsumerCommitServiceImpl.clearOldData();\n\t\tassertEquals(1, consumerCommitServiceImpl.mapAppPolling.get().siz...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerCommitService.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ConsumerCommitService.class);", "type": "Logger", "var_name": "log" }, ...
{ "body": "protected void clearOldData() {\n\t\tboolean flag = (System.currentTimeMillis() - lastTime - 10 * 60 * 1000) > 0;\n\t\tif (flag) {\n\t\t\tsynchronized (lockObj) {\n\t\t\t\tif ((System.currentTimeMillis() - lastTime - 30 * 60 * 1000) > 0) {\n\t\t\t\t\tmapAppPolling.set(new ConcurrentHashMap<>(failMapAppPoll...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_151
{ "fields": [], "file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/ClassLoaderUtilTest.java", "identifier": "ClassLoaderUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void isClassPresentTest() {\n\t\tassertEquals(false, ClassLoaderUtil.isClassPresent(\"tt.tt\"));\n\t\t\n\t\tassertEquals(true, ClassLoaderUtil.isClassPresent(\"com.ppdai.infrastructure.mq.biz.common.util.ClassLoaderUtilTest\"));\n\t}", "class_method_signature": "ClassLoaderUtilTest.isClas...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ClassLoaderUtil.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(ClassLoaderUtil.class);", "type": "Logger", "var_name": "logger" }, { ...
{ "body": "public static boolean isClassPresent(String className) {\n\t\ttry {\n\t\t\tClass.forName(className);\n\t\t\treturn true;\n\t\t} catch (ClassNotFoundException ex) {\n\t\t\treturn false;\n\t\t}\n\t}", "class_method_signature": "ClassLoaderUtil.isClassPresent(String className)", "constructor": false, "f...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_24
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void infoTest() {\n\t\tassertEquals(null, consumerGroupServiceImpl.info());\n\t}", "class_method_signature": "ConsumerGroupServiceImplTest.infoTest()", "constructor": false, "full_signature": "@Test public void infoTest()", "identifier": "infoTest", "invocations": [ "assertEqu...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\tpublic String info() {\n\t\t// TODO Auto-generated method stub\n\t\treturn null;\n\t}", "class_method_signature": "ConsumerGroupServiceImpl.info()", "constructor": false, "full_signature": "@Override public String info()", "identifier": "info", "invocations": [], "modifiers": "@Ove...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_73
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void publish3Test() {\n\t\t// 测试无队列\n\t\tPublishMessageRequest request = new PublishMessageRequest();\n\t\trequest.setTopicName(\"test\");\n\t\trequest.setMsgs(Arrays.asList(new ProducerDataDto()));\n\t\tMap<String, TopicEntity> cacheData = new HashMap<String, TopicEntity>();\n\t\tcacheData...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "@Override\n public PublishMessageResponse publish(PublishMessageRequest request) {\n PublishMessageResponse response = new PublishMessageResponse();\n checkVaild(request, response);\n if (!response.isSuc()) {\n return response;\n }\n try {\n if (!...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_106
{ "fields": [ { "declarator": "consumerGroupTopicServiceImpl", "modifier": "private", "original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;", "type": "ConsumerGroupTopicServiceImpl", "var_name": "consumerGroupTopicServiceImpl" }, { "de...
{ "body": "@Test\n\tpublic void infoTest() {\n\t\tassertEquals(null, consumerGroupTopicServiceImpl.info());\n\t}", "class_method_signature": "ConsumerGroupTopicServiceImplTest.infoTest()", "constructor": false, "full_signature": "@Test public void infoTest()", "identifier": "infoTest", "invocations": [ ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "...
{ "body": "@Override\n\tpublic String info() {\n\t\t// TODO Auto-generated method stub\n\t\treturn null;\n\t}", "class_method_signature": "ConsumerGroupTopicServiceImpl.info()", "constructor": false, "full_signature": "@Override public String info()", "identifier": "info", "invocations": [], "modifiers": ...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_110
{ "fields": [ { "declarator": "consumerGroupTopicServiceImpl", "modifier": "private", "original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;", "type": "ConsumerGroupTopicServiceImpl", "var_name": "consumerGroupTopicServiceImpl" }, { "de...
{ "body": "@Test\n\tpublic void createConsumerGroupTopicAndFailTopicTest() {\n\t\tConsumerGroupEntity consumerGroupEntity = new ConsumerGroupEntity();\n\t\tconsumerGroupEntity.setMode(2);\n\t\tconsumerGroupEntity.setName(\"test\");\n\t\tconsumerGroupEntity.setOriginName(\"test\");\n\t\tconsumerGroupEntity.setId(1L);\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "...
{ "body": "protected ConsumerGroupTopicCreateResponse createConsumerGroupTopicAndFailTopic(\n ConsumerGroupTopicCreateRequest consumerGroupTopicCreateRequest, Map<String, ConsumerGroupEntity> consumerGroupMap) {\n\t\tCacheUpdateHelper.updateCache();\n\t\tif (roleService.getRole(userInfoHolder.getUserId(), ...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_65
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void heartbeatTest() {\n\t\tconsumerServiceImpl.heartbeat(Arrays.asList(1L));\n\t\tverify(consumerRepository).heartbeat(anyListOf(Long.class));\n\t}", "class_method_signature": "ConsumerServiceImplTest.heartbeatTest()", "constructor": false, "full_signature": "@Test public void heartb...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "@Override\n public void heartbeat(List<Long> ids) {\n if (!CollectionUtils.isEmpty(ids)) {\n consumerRepository.heartbeat(ids);\n }\n }", "class_method_signature": "ConsumerServiceImpl.heartbeat(List<Long> ids)", "constructor": false, "full_signature": "@Override public...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_32
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void deleteTopicNameFromConsumerGroupTest() {\n\t\tConsumerGroupEntity consumerGroupEntity=new ConsumerGroupEntity();\n\t\tconsumerGroupEntity.setTopicNames(\"test,test2\");\n\t\twhen(consumerGroupRepository.getById(anyLong())).thenReturn(consumerGroupEntity);\n\t\tConsumerGroupTopicEntity ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\tpublic BaseUiResponse<Void> deleteTopicNameFromConsumerGroup(ConsumerGroupTopicEntity consumerGroupTopicEntity) {\n\t\tConsumerGroupEntity consumerGroupEntity = get(consumerGroupTopicEntity.getConsumerGroupId());\n\t\tString oldTopicNames = consumerGroupEntity.getTopicNames();\n\t\tString[] na...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_147
{ "fields": [], "file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/ConsumerGroupUtilTest.java", "identifier": "ConsumerGroupUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void getBroadcastConsumerNameTest() {\n\t\tassertEquals(\"1_2-3\", ConsumerGroupUtil.getBroadcastConsumerName(\"1\", \"2\", 3));\n\t}", "class_method_signature": "ConsumerGroupUtilTest.getBroadcastConsumerNameTest()", "constructor": false, "full_signature": "@Test public void getBroad...
{ "fields": [], "file": "mq-client/mq-core/src/main/java/com/ppdai/infrastructure/mq/biz/common/util/ConsumerGroupUtil.java", "identifier": "ConsumerGroupUtil", "interfaces": "", "methods": [ { "class_method_signature": "ConsumerGroupUtil.getBroadcastConsumerName(String consumerGroupName, String ip,...
{ "body": "public static String getBroadcastConsumerName(String consumerGroupName, String ip, long consumerId) {\n\t\treturn String.format(\"%s_%s-%s\", consumerGroupName, ip, consumerId);\n\t}", "class_method_signature": "ConsumerGroupUtil.getBroadcastConsumerName(String consumerGroupName, String ip, long consumer...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_49
{ "fields": [ { "declarator": "message01Repository", "modifier": "private", "original_string": "private Message01Repository message01Repository;", "type": "Message01Repository", "var_name": "message01Repository" }, { "declarator": "dbNodeService", "modifier": "pri...
{ "body": "@Test\n\tpublic void getListDyTest() {\n\t\tmessage01ServiceImpl.getListDy(\"test\", \"test\", 0, 1);\n\t\tverify(message01Repository).getListDy(anyString(), anyLong(), anyLong());\n\t\tmessage01ServiceImpl.setDbId(1);\n\t\tboolean rs = false;\n\t\tdoThrow(new RuntimeException(\"test\")).when(message01Repo...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "publ...
{ "body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW, value = \"msgTransactionManager\")\n\tpublic List<Message01Entity> getListDy(String topic, String tbName, long start, long end) {\n\t\tList<Message01Entity> rs = new ArrayList<>();\n\t\tsetMaster(false);\n\t\...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_184
{ "fields": [], "file": "mq-client/mq-client-spring/src/test/java/com/ppdai/infrastructure/mq/client/bootstrap/MqEnvPropTest.java", "identifier": "MqEnvPropTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void getEnvTest() {\n\t\tConfigurableEnvironment environment=mock(ConfigurableEnvironment.class);\n\t\tMutablePropertySources mutablePropertySources=new MutablePropertySources();\n\t\twhen(environment.getPropertySources()).thenReturn(mutablePropertySources);\n\t\tMap<String, Object> map=new...
{ "fields": [ { "declarator": "environment", "modifier": "private", "original_string": "private Environment environment;", "type": "Environment", "var_name": "environment" }, { "declarator": "sanitizer = new Sanitizer()", "modifier": "private final", "origin...
{ "body": "public Map<String, Object> getEnv() {\n\t\tMap<String, Object> result = new LinkedHashMap<String, Object>();\t\t\n\t\tfor (Entry<String, PropertySource<?>> entry : getPropertySources().entrySet()) {\n\t\t\tPropertySource<?> source = entry.getValue();\t\t\t\n\t\t\tif (source instanceof EnumerablePropertySou...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_4
{ "fields": [ { "declarator": "consumerGroupConsumerRepository", "modifier": "private", "original_string": "private ConsumerGroupConsumerRepository consumerGroupConsumerRepository;", "type": "ConsumerGroupConsumerRepository", "var_name": "consumerGroupConsumerRepository" }, {...
{ "body": "@Test\n\tpublic void deleteUnActiveConsumerTest() {\n\t\twhen(consumerGroupConsumerRepository.deleteUnActiveConsumer()).thenReturn(1);\n\t\tassertEquals(1, consumerGroupConsumerServiceImpl.deleteUnActiveConsumer());\n\t}", "class_method_signature": "ConsumerGroupConsumerServiceImplTest.deleteUnActiveCons...
{ "fields": [ { "declarator": "consumerGroupConsumerRepository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate ConsumerGroupConsumerRepository consumerGroupConsumerRepository;", "type": "ConsumerGroupConsumerRepository", "var_name": "consumerGroupCons...
{ "body": "@Override\n\tpublic int deleteUnActiveConsumer() {\t\t\n\t\t// TODO Auto-generated method stub\n\t\treturn consumerGroupConsumerRepository.deleteUnActiveConsumer();\n\t}", "class_method_signature": "ConsumerGroupConsumerServiceImpl.deleteUnActiveConsumer()", "constructor": false, "full_signature": "@...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_5
{ "fields": [ { "declarator": "consumerGroupConsumerRepository", "modifier": "private", "original_string": "private ConsumerGroupConsumerRepository consumerGroupConsumerRepository;", "type": "ConsumerGroupConsumerRepository", "var_name": "consumerGroupConsumerRepository" }, {...
{ "body": "@Test\n\tpublic void getByConsumerIdsTest() {\n\t\tassertEquals(true, consumerGroupConsumerServiceImpl.getByConsumerIds(null).size() == 0);\n\t\twhen(consumerGroupConsumerRepository.getByConsumerIds(anyList())).thenReturn(new ArrayList());\n\t\t// TODO Auto-generated method stub\n\t\tconsumerGroupConsumerS...
{ "fields": [ { "declarator": "consumerGroupConsumerRepository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate ConsumerGroupConsumerRepository consumerGroupConsumerRepository;", "type": "ConsumerGroupConsumerRepository", "var_name": "consumerGroupCons...
{ "body": "@Override\n\tpublic List<ConsumerGroupConsumerEntity> getByConsumerIds(List<Long> consumerIds) {\n\t\tif (CollectionUtils.isEmpty(consumerIds)) {\n\t\t\treturn new ArrayList<>();\n\t\t}\n\t\treturn consumerGroupConsumerRepository.getByConsumerIds(consumerIds);\n\t}", "class_method_signature": "ConsumerGr...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_48
{ "fields": [ { "declarator": "message01Repository", "modifier": "private", "original_string": "private Message01Repository message01Repository;", "type": "Message01Repository", "var_name": "message01Repository" }, { "declarator": "dbNodeService", "modifier": "pri...
{ "body": "@Test\n\tpublic void deleteDyTest() {\n\t\tmessage01ServiceImpl.deleteDy(\"test\", 0, 1);\n\t\tverify(message01Repository).deleteDy(anyString(), anyLong(), anyLong());\n\n\t\tboolean rs = false;\n\t\tdoThrow(new RuntimeException(\"test\")).when(message01Repository).deleteDy(anyString(), anyLong(), anyLong(...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "publ...
{ "body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW, value = \"msgTransactionManager\")\n\tpublic void deleteDy(String tbName, long start, long end) {\n\t\ttry {\n\t\t\tsetMaster(true); \n\t\t\tmessage01Repository.deleteDy(getDbName() + \".\" + tbName, start, e...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_33
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void addTopicNameToConsumerGroupTest() {\n\t\tConsumerGroupEntity consumerGroupEntity=new ConsumerGroupEntity();\n\t\tconsumerGroupEntity.setTopicNames(\"test3,test2\");\n\t\twhen(consumerGroupRepository.getById(anyLong())).thenReturn(consumerGroupEntity);\n\t\tConsumerGroupTopicEntity cons...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\tpublic BaseUiResponse<Void> addTopicNameToConsumerGroup(ConsumerGroupTopicEntity consumerGroupTopicEntity) {\n\t\tConsumerGroupEntity consumerGroupEntity = get(consumerGroupTopicEntity.getConsumerGroupId());\n\t\tString oldTopicNames = consumerGroupEntity.getTopicNames();\n\n\t\t// 如果mq3的group...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_146
{ "fields": [], "file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/HttpClientTest.java", "identifier": "HttpClientTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void postError3Test() throws IOException {\n\t\tClientAndServer mockClient = new ClientAndServer(5000);\n\t\ttry {\n\t\t\tmockClient.when(HttpRequest.request().withMethod(\"POST\"))\n\t\t\t\t\t.respond(HttpResponse.response().withStatusCode(200).withBody(\"1\"));\n\t\t\tHttpClient httpClien...
{ "fields": [ { "declarator": "JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\");", "type": "MediaType", "var_name": ...
{ "body": "public String post(String url, Object reqObj) throws IOException,BrokerException {\n\t\tString json = \"\";\n\t\tif (reqObj != null) { \n\t\t\tjson = JsonUtil.toJsonNull(reqObj);\n\t\t}\n\t\tResponse response = null;\n\t\tTransaction transaction = Tracer.newTransaction(\"mq-http\", url);\n\t\ttry {\n\t\t\t...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_111
{ "fields": [ { "declarator": "consumerGroupTopicServiceImpl", "modifier": "private", "original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;", "type": "ConsumerGroupTopicServiceImpl", "var_name": "consumerGroupTopicServiceImpl" }, { "de...
{ "body": "@Test\n\tpublic void createConsumerGroupTopicAndFailTopicTopicTest() {\n\t\tConsumerGroupEntity consumerGroupEntity = new ConsumerGroupEntity();\n\t\tconsumerGroupEntity.setMode(2);\n\t\tconsumerGroupEntity.setName(\"test\");\n\t\tconsumerGroupEntity.setOriginName(\"test\");\n\t\tconsumerGroupEntity.setId(...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "...
{ "body": "protected ConsumerGroupTopicCreateResponse createConsumerGroupTopicAndFailTopic(\n ConsumerGroupTopicCreateRequest consumerGroupTopicCreateRequest, Map<String, ConsumerGroupEntity> consumerGroupMap) {\n\t\tCacheUpdateHelper.updateCache();\n\t\tif (roleService.getRole(userInfoHolder.getUserId(), ...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_64
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void deRegisterTest() {\n\t\tConsumerDeRegisterRequest deRegisterRequest = new ConsumerDeRegisterRequest();\n\t\tassertEquals(false, consumerServiceImpl.deRegister(deRegisterRequest).isSuc());\n\n\t\tdeRegisterRequest.setId(1);\n\n\t\tList<ConsumerGroupConsumerEntity> consumerGroupConsumers...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "@Override\n @Transactional(rollbackFor = Exception.class)\n public ConsumerDeRegisterResponse deRegister(ConsumerDeRegisterRequest deRegisterRequest) {\n ConsumerDeRegisterResponse response = new ConsumerDeRegisterResponse();\n response.setSuc(true);\n if (deRegisterRequest == nu...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_72
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void publish2Test() {\n\t\t// 测试无可写队列,但是是严格模式\n\t\tPublishMessageRequest request = new PublishMessageRequest();\n\t\trequest.setTopicName(\"test\");\n\t\trequest.setMsgs(Arrays.asList(new ProducerDataDto()));\n\t\tMap<String, TopicEntity> cacheData = new HashMap<String, TopicEntity>();\n\t\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "@Override\n public PublishMessageResponse publish(PublishMessageRequest request) {\n PublishMessageResponse response = new PublishMessageResponse();\n checkVaild(request, response);\n if (!response.isSuc()) {\n return response;\n }\n try {\n if (!...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_107
{ "fields": [ { "declarator": "consumerGroupTopicServiceImpl", "modifier": "private", "original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;", "type": "ConsumerGroupTopicServiceImpl", "var_name": "consumerGroupTopicServiceImpl" }, { "de...
{ "body": "@Test\n\tpublic void getCacheJsonTest() {\n\t\tassertEquals(\"{}\", consumerGroupTopicServiceImpl.getCacheJson());\n\t}", "class_method_signature": "ConsumerGroupTopicServiceImplTest.getCacheJsonTest()", "constructor": false, "full_signature": "@Test public void getCacheJsonTest()", "identifier": "...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "...
{ "body": "@Override\n\tpublic String getCacheJson() {\n\t\t// TODO Auto-generated method stub\n\t\treturn JsonUtil.toJsonNull(getCache());\n\t}", "class_method_signature": "ConsumerGroupTopicServiceImpl.getCacheJson()", "constructor": false, "full_signature": "@Override public String getCacheJson()", "identi...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_150
{ "fields": [], "file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/ClassLoaderUtilTest.java", "identifier": "ClassLoaderUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void getClassPathTest() {\n\t\tassertEquals(true, ClassLoaderUtil.getClassPath()!=null);\n\t}", "class_method_signature": "ClassLoaderUtilTest.getClassPathTest()", "constructor": false, "full_signature": "@Test public void getClassPathTest()", "identifier": "getClassPathTest", "in...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ClassLoaderUtil.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(ClassLoaderUtil.class);", "type": "Logger", "var_name": "logger" }, { ...
{ "body": "public static String getClassPath() {\n\t\treturn classPath;\n\t}", "class_method_signature": "ClassLoaderUtil.getClassPath()", "constructor": false, "full_signature": "public static String getClassPath()", "identifier": "getClassPath", "invocations": [], "modifiers": "public static", "parame...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_25
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void notifyRbByNamesTest() {\n\t\tconsumerGroupServiceImpl.notifyRbByNames(null);\n\t\tverify(notifyMessageService, times(0)).insertBatch(anyListOf(NotifyMessageEntity.class));\n\t\tconsumerGroupServiceImpl.notifyRbByNames(Arrays.asList(\"test\"));\n\t\tverify(notifyMessageService, times(0)...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\tpublic void notifyRbByNames(List<String> consumerGroupNames) {\n\t\tif (CollectionUtils.isEmpty(consumerGroupNames))\n\t\t\treturn;\n\t\tList<Long> ids = new ArrayList<>();\n\t\tMap<String, ConsumerGroupEntity> cacheData = consumerGroupRefMap.get();\n\t\tif (cacheData == null || cacheData.size...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_52
{ "fields": [ { "declarator": "message01Repository", "modifier": "private", "original_string": "private Message01Repository message01Repository;", "type": "Message01Repository", "var_name": "message01Repository" }, { "declarator": "dbNodeService", "modifier": "pri...
{ "body": "@Test\n\tpublic void getMessageByIdTest() {\n\t\tmessage01ServiceImpl.getMessageById(\"test\",1L);\n\t\tverify(message01Repository).getMessageById(anyString(), anyLong());\n\t\tmessage01ServiceImpl.setDbId(1);\n\t\tboolean rs = false;\n\t\tdoThrow(new RuntimeException(\"test\")).when(message01Repository).g...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "publ...
{ "body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.NOT_SUPPORTED, value = \"msgTransactionManager\")\n\tpublic Message01Entity getMessageById(String tbName, long id) {\n\t\tsetMaster(false);\n\t\tMessage01Entity message01Entity = null;\n\t\ttry {\n\t\t\tmessage01Entity = m...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_127
{ "fields": [ { "declarator": "consumerGroupTopicCheckServiceImpl", "modifier": "private", "original_string": "private ConsumerGroupTopicCheckServiceImpl consumerGroupTopicCheckServiceImpl;", "type": "ConsumerGroupTopicCheckServiceImpl", "var_name": "consumerGroupTopicCheckServiceImp...
{ "body": "@Test\n\tpublic void checkItemTest() {\n\t\tassertEquals(true, consumerGroupTopicCheckServiceImpl.checkItem() != null);\n\t}", "class_method_signature": "ConsumerGroupTopicCheckServiceImplTest.checkItemTest()", "constructor": false, "full_signature": "@Test public void checkItemTest()", "identifier...
{ "fields": [ { "declarator": "consumerGroupTopicService", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private ConsumerGroupTopicService consumerGroupTopicService;", "type": "ConsumerGroupTopicService", "var_name": "consumerGroupTopicService" }, ...
{ "body": "@Override\n public String checkItem() {\n String field = \"ConsumerGroupTopic下校验:\" + ConsumerGroupTopicEntity.FdConsumerGroupName + \",\" + ConsumerGroupTopicEntity.FdTopicName;\n return field;\n }", "class_method_signature": "ConsumerGroupTopicCheckServiceImpl.checkItem()", "const...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_9
{ "fields": [ { "declarator": "consumerGroupService", "modifier": "private", "original_string": "private ConsumerGroupService consumerGroupService;", "type": "ConsumerGroupService", "var_name": "consumerGroupService" }, { "declarator": "auditLogService", "modifier...
{ "body": "@Test\n\tpublic void addBrokerLogTest() {\t\t\n\t\tLogDto logDto=new LogDto();\n\t\tlogDto.setConsumerGroupName(\"Test\");\n\t\tlogDto.setType(1);\n\t\tMap<String, ConsumerGroupEntity> map =new HashMap<String, ConsumerGroupEntity>();\n\t\tConsumerGroupEntity consumerGroupEntity=new ConsumerGroupEntity();\n...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(LogServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(LogServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "logType = new Ha...
{ "body": "@Override\n\tpublic void addBrokerLog(LogDto request) {\n\t\tif (request.getType() >= 3) {\n\t\t\tMap<String, ConsumerGroupEntity> cache = consumerGroupService.getCache();\n\t\t\tif (!StringUtils.isEmpty(request.getConsumerGroupName())\n\t\t\t\t\t&& cache.containsKey(request.getConsumerGroupName())) {\n\t\...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_170
{ "fields": [], "file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java", "identifier": "MqResourceTest", "interfaces": "", "superclass": "extends AbstractTest" }
{ "body": "@Test\n\tpublic void getConsumerGroupNullTest() {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tassertEquals(\"getConsumerGroupNullTest error\", null, mqResource.getConsumerGroup(null));\n\t}", "class_method_sign...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MqResource.class)", "modifier": "private final", "original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "htt...
{ "body": "public GetConsumerGroupResponse getConsumerGroup(GetConsumerGroupRequest request) {\n\t\tif (request == null) {\n\t\t\treturn null;\n\t\t}\n\t\tString url = MqConstanst.CONSUMERPRE + \"/getConsumerGroupPolling\";\n\t\treturn post(request, url, 10, GetConsumerGroupResponse.class, true);\n\t}", "class_meth...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_13
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void rbTest() {\n\t\tList<QueueOffsetEntity> queueOffsetEntities = new ArrayList<QueueOffsetEntity>();\n\t\tQueueOffsetEntity queueOffsetEntity = new QueueOffsetEntity();\n\t\tqueueOffsetEntity.setId(1L);\n\t\tqueueOffsetEntities.add(queueOffsetEntity);\n\t\tconsumerGroupServiceImpl.rb(queu...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\t// @Transactional(rollbackFor = Exception.class)\n\tpublic void rb(List<QueueOffsetEntity> queueOffsetEntities) {\n\t\tMap<Long, String> idsMap = new HashMap<>(30);\n\t\tList<NotifyMessageEntity> notifyMessageEntities = new ArrayList<>(30);\n\t\tqueueOffsetEntities.forEach(t1 -> {\n\t\t\tidsMa...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_166
{ "fields": [], "file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java", "identifier": "MqResourceTest", "interfaces": "", "superclass": "extends AbstractTest" }
{ "body": "@Test\n\tpublic void publishNullTest() {\n\t\tMqResource mqResource = new MqResource(\"http://localhost\", 10000, 10000);\n\t\tassertEquals(\"publishNullTest error\", true, mqResource.publish(null));\n\t}", "class_method_signature": "MqResourceTest.publishNullTest()", "constructor": false, "full_sign...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MqResource.class)", "modifier": "private final", "original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "htt...
{ "body": "public boolean publish(PublishMessageRequest request) {\n\t\treturn publish(request, 10);\n\t}", "class_method_signature": "MqResource.publish(PublishMessageRequest request)", "constructor": false, "full_signature": "public boolean publish(PublishMessageRequest request)", "identifier": "publish", ...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_131
{ "fields": [], "file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/UtilTest.java", "identifier": "UtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void formateDateTest() {\n\t\tDate date = new Date(2019 - 1900, 0, 1);\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.set(2019, 0, 1, 0, 0, 0);\n\t\tassertEquals(\"2019-01-01\", Util.formateDate(calendar.getTime(), \"yyyy-MM-dd\"));\n\t\tassertEquals(\"2019-01-01 00:00:00\",...
{ "fields": [ { "declarator": "DEFAULT_FORMATE = \"yyyy-MM-dd HH:mm:ss\"", "modifier": "private final static", "original_string": "private final static String DEFAULT_FORMATE = \"yyyy-MM-dd HH:mm:ss\";", "type": "String", "var_name": "DEFAULT_FORMATE" }, { "declarator":...
{ "body": "public static String formateDate(Date date, String formate) {\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(formate);\n\t\treturn simpleDateFormat.format(date);\n\t}", "class_method_signature": "Util.formateDate(Date date, String formate)", "constructor": false, "full_signature": "pub...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_44
{ "fields": [ { "declarator": "dbNodeRepository", "modifier": "private", "original_string": "private DbNodeRepository dbNodeRepository;", "type": "DbNodeRepository", "var_name": "dbNodeRepository" }, { "declarator": "dbNodeServiceImpl", "modifier": "private", ...
{ "body": "@Test\n\tpublic void createDataSourceTest() throws SQLException {\n\t\tDruidDataSource dataSource = mock(DruidDataSource.class);\n\t\tDbNodeServiceImpl.DataSourceFactory dataSourceFactory = new DbNodeServiceImpl.DataSourceFactory() {\n\t\t\t@Override\n\t\t\tpublic DruidDataSource createDataSource() {\n\t\t...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(DbNodeServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(DbNodeServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "dbNodeRepo...
{ "body": "@Override\n\tpublic void createDataSource(DbNodeEntity t1) {\n\t\tcreateDataSource(t1, cacheDataMap.get());\n\t}", "class_method_signature": "DbNodeServiceImpl.createDataSource(DbNodeEntity t1)", "constructor": false, "full_signature": "@Override public void createDataSource(DbNodeEntity t1)", "ide...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_87
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void checkTopicTest() {\n\t\tConsumerGroupRegisterRequest request = new ConsumerGroupRegisterRequest();\n\t\tConsumerGroupRegisterResponse response = new ConsumerGroupRegisterResponse();\n\t\tresponse.setSuc(true);\n\n\t\tMap<String, List<String>> consumerGroupNames = new HashMap<String, Li...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "protected Map<String, ConsumerGroupEntity> checkTopic(ConsumerGroupRegisterRequest request,\n ConsumerGroupRegisterResponse response) {\n\n Map<String, ConsumerGroupEntity> consumerGroupMap = consumerGroupService\n .getByNames(n...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_68
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void registerConsumerGroupTest() {\n\t\tConsumerGroupRegisterRequest request = new ConsumerGroupRegisterRequest();\n\t\tassertEquals(false, consumerServiceImpl.registerConsumerGroup(request).isSuc());\n\t\tassertEquals(false, consumerServiceImpl.registerConsumerGroup(null).isSuc());\n\n\t\t...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "@Override\n //@Transactional(rollbackFor = Exception.class)\n public ConsumerGroupRegisterResponse registerConsumerGroup(ConsumerGroupRegisterRequest request) {\n ConsumerGroupRegisterResponse response = new ConsumerGroupRegisterResponse();\n ConsumerEntity consumerEntity = get(request....
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_91
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void doSaveMsgTest() {\n\t\tList<Message01Entity> message01Entities=new ArrayList<Message01Entity>();\n\t\tPublishMessageRequest request=new PublishMessageRequest();\n\t\tPublishMessageResponse response=new PublishMessageResponse();\n\t\tQueueEntity temp=new QueueEntity();\n\t\ttemp.setIp(\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "private void doSaveMsg(PublishMessageRequest request, PublishMessageResponse response,\n List<QueueEntity> queueEntities, List<Message01Entity> message01Entities) {\n int tryCount = 0;\n int queueSize = queueEntities.size();\n Exception last = null;\n T...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_29
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void deleteConsumerGroupHasConsumerTest() {\n\t\tConsumerGroupEntity consumerGroupEntity=buildConsumerGroupEntity();\n\t\tconsumerGroupEntity.setMode(2);\n\t\tconsumerGroupEntity.setOriginName(consumerGroupEntity.getName());\t\t\n\t\twhen(consumerGroupRepository.getById(anyLong())).thenRetu...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\tpublic ConsumerGroupDeleteResponse deleteConsumerGroup(long consumerGroupId, boolean checkOnline) {\n\t\tCacheUpdateHelper.updateCache();\n\t\t// 缓存数据\n\t\tMap<String, ConsumerGroupEntity> consumerGroupMap = getCache();\n\t\tConsumerGroupEntity consumerGroupEntity = get(consumerGroupId);\n\n\t...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_157
{ "fields": [], "file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java", "identifier": "MqResourceTest", "interfaces": "", "superclass": "extends AbstractTest" }
{ "body": "@Test\n\tpublic void setUrlsNotNullTest() {\n\t\tMqResource mqResource = new MqResource(\"http://localhost\", 10000, 10000);\n\t\tmqResource.setUrls(Arrays.asList(\"1\", \"1\", \"1\"), Arrays.asList(\"1\", \"1\", \"1\"));\n\t\tAtomicReference<List<String>> urlsG1 = getValue(\"urlsG1\", mqResource);\n\t\tAt...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MqResource.class)", "modifier": "private final", "original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "htt...
{ "body": "public void setUrls(List<String> urlsTempG1, List<String> urlsTempG2) {\n\t\tif (urlsTempG1 == null) {\n\t\t\turlsTempG1 = new ArrayList<>();\n\t\t}\n\t\tif (urlsTempG2 == null) {\n\t\t\turlsTempG2 = new ArrayList<>();\n\t\t}\n\t\turlsG1.set(urlsTempG1);\n\t\turlsG2.set(urlsTempG2);\n\t\tif (urlsTempG1.siz...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_22
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void getByOwnerNamesTest() {\n\t\tconsumerGroupServiceImpl.getByOwnerNames(null);\n\t\tverify(consumerGroupRepository).getByOwnerNames(anyMapOf(String.class, Object.class));\n\t}", "class_method_signature": "ConsumerGroupServiceImplTest.getByOwnerNamesTest()", "constructor": false, "f...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\tpublic List<ConsumerGroupEntity> getByOwnerNames(Map<String, Object> parameterMap) {\n\t\treturn consumerGroupRepository.getByOwnerNames(parameterMap);\n\t}", "class_method_signature": "ConsumerGroupServiceImpl.getByOwnerNames(Map<String, Object> parameterMap)", "constructor": false, "fu...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_75
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void publish_checkTopicRateTest() {\n\t\tPublishMessageRequest request = new PublishMessageRequest();\n\t\tPublishMessageResponse response = new PublishMessageResponse();\n\t\tsetProperty(\"mq.publish.rate.enable\", \"0\");\n\t\tassertEquals(true, consumerServiceImpl.checkTopicRate(request,...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "protected boolean checkTopicRate(PublishMessageRequest request, PublishMessageResponse response) {\n // 关闭限速\n if (soaConfig.getEnableTopicRate() == 0) {\n return true;\n }\n if (!topicPerMax.containsKey(request.getTopicName())) {\n synchronized (this) {\n ...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_100
{ "fields": [ { "declarator": "consumerGroupTopicServiceImpl", "modifier": "private", "original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;", "type": "ConsumerGroupTopicServiceImpl", "var_name": "consumerGroupTopicServiceImpl" }, { "de...
{ "body": "@Test\n\tpublic void deleteByConsumerGroupIdTest() {\n\t\tconsumerGroupTopicServiceImpl.deleteByConsumerGroupId(1);\n\t\tverify(consumerGroupTopicRepository).deleteByConsumerGroupId(anyLong());\n\t\tverify(uiAuditLogService).recordAudit(anyString(), anyLong(), anyString());\n\t}", "class_method_signature...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "...
{ "body": "@Override\n\tpublic void deleteByConsumerGroupId(long consumerGroupId) {\n\t\tconsumerGroupTopicRepository.deleteByConsumerGroupId(consumerGroupId);\n\t\tuiAuditLogService.recordAudit(ConsumerGroupEntity.TABLE_NAME, consumerGroupId,\n\t\t\t\t\"取消consumerGroup的所有topic订阅,即删除该consumerGroup在consumerGroupTopic表...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_116
{ "fields": [ { "declarator": "consumerGroupTopicServiceImpl", "modifier": "private", "original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;", "type": "ConsumerGroupTopicServiceImpl", "var_name": "consumerGroupTopicServiceImpl" }, { "de...
{ "body": "@Test\n\tpublic void startTest() {\n\t\tList<ConsumerGroupTopicEntity> consumerGroupEntities = new ArrayList<ConsumerGroupTopicEntity>();\n\t\tConsumerGroupTopicEntity consumerGroupEntity = new ConsumerGroupTopicEntity();\n\t\tconsumerGroupEntity.setConsumerGroupName(\"test\");\n\t\tconsumerGroupEntity.set...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "...
{ "body": "@Override\n\tpublic void start() {\n\t\tif (startFlag.compareAndSet(false, true)) {\n\t\t\tupdateCache();\n\t\t\texecutor.submit(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\twhile (isRunning) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tupdateCache();\n\t\t\t\t\t\t} catch (Exception e...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_63
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void registerTest() {\n\t\tConsumerRegisterRequest request = new ConsumerRegisterRequest();\n\t\trequest.setName(\"testt\");\n\t\trequest.setSdkVersion(\"1\");\n\t\tconsumerServiceImpl.register(request);\n\t\tverify(consumerRepository).register(any(ConsumerEntity.class));\n\t\tdoThrow(new R...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "@Override\n @Transactional(rollbackFor = Exception.class)\n public ConsumerRegisterResponse register(ConsumerRegisterRequest request) {\n ConsumerRegisterResponse response = new ConsumerRegisterResponse();\n response.setSuc(true);\n checkVaild(request, response);\n if (!re...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_34
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void checkChangedTest() {\n\t\tassertEquals(true, consumerGroupServiceImpl.checkChanged());\t\t\n\t\tLastUpdateEntity lastUpdateEntity=new LastUpdateEntity();\n\t\tlastUpdateEntity.setCount(1);\n\t\tlastUpdateEntity.setMaxId(2L);\n\t\twhen(consumerGroupRepository.getLastUpdate()).thenReturn...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "protected boolean checkChanged() {\n\t\tboolean flag = doCheckChanged();\n\t\tif (!flag) {\n\t\t\tif (System.currentTimeMillis() - lastTime > soaConfig.getMqMetaRebuildMaxInterval()) {\n\t\t\t\tlastTime = System.currentTimeMillis();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\tlastTime = System.curr...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_141
{ "fields": [], "file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/HttpClientTest.java", "identifier": "HttpClientTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void postTest() throws IOException, BrokerException {\n\t\tClientAndServer mockClient = new ClientAndServer(5000);\n\t\ttry {\n\t\t\tmockClient.when(HttpRequest.request().withMethod(\"POST\"))\n\t\t\t\t\t.respond(HttpResponse.response().withStatusCode(200).withBody(\"1\"));\n\t\t\tHttpClien...
{ "fields": [ { "declarator": "JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\");", "type": "MediaType", "var_name": ...
{ "body": "public String post(String url, Object reqObj) throws IOException,BrokerException {\n\t\tString json = \"\";\n\t\tif (reqObj != null) { \n\t\t\tjson = JsonUtil.toJsonNull(reqObj);\n\t\t}\n\t\tResponse response = null;\n\t\tTransaction transaction = Tracer.newTransaction(\"mq-http\", url);\n\t\ttry {\n\t\t\t...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_18
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void notifyOffsetTest() {\n\t\tconsumerGroupServiceImpl.notifyOffset(1L);\n\t}", "class_method_signature": "ConsumerGroupServiceImplTest.notifyOffsetTest()", "constructor": false, "full_signature": "@Test public void notifyOffsetTest()", "identifier": "notifyOffsetTest", "invocati...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\tpublic void notifyOffset(long id) {\n\t\tnotifyMeta(id);\n\t}", "class_method_signature": "ConsumerGroupServiceImpl.notifyOffset(long id)", "constructor": false, "full_signature": "@Override public void notifyOffset(long id)", "identifier": "notifyOffset", "invocations": [ "notif...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_182
{ "fields": [], "file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/core/impl/MqMetricReporterTest.java", "identifier": "MqMetricReporterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testReport() {\n\t\t@SuppressWarnings(\"resource\")\n\t\tMqMetricReporter reporter = new MqMetricReporter(MetricSingleton.getMetricRegistry(), \"mq-client\",\n\t\t\t\tMetricFilter.ALL, TimeUnit.MILLISECONDS, TimeUnit.MILLISECONDS, null, new MqContext());\n\t\treporter.report(MetricSing...
{ "fields": [ { "declarator": "tags", "modifier": "private final", "original_string": "private final Map<String, String> tags;", "type": "Map<String, String>", "var_name": "tags" }, { "declarator": "lastReport = new ConcurrentHashMap<>()", "modifier": "private", ...
{ "body": "@Override\n\tpublic void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters,\n\t\t\tSortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) {\n\t\tif (!Util.isEmpty(mqContext.getMetricUrl())) {\n\t\t\tfinal long timestamp = System....
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_2
{ "fields": [ { "declarator": "consumerGroupCheckServiceImpl", "modifier": "private", "original_string": "private ConsumerGroupCheckServiceImpl consumerGroupCheckServiceImpl;", "type": "ConsumerGroupCheckServiceImpl", "var_name": "consumerGroupCheckServiceImpl" }, { "de...
{ "body": "@Test\n\tpublic void checkResult1Test() {\n\t\tMap<String, ConsumerGroupEntity> consumerGroupMap = new HashMap<>();//consumerGroupService.getCache();\n\t\tConsumerGroupEntity consumerGroupEntity=new ConsumerGroupEntity();\n\t\tconsumerGroupEntity.setName(\"test\");\n\t\tconsumerGroupEntity.setOriginName(\"...
{ "fields": [ { "declarator": "consumerGroupService", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private ConsumerGroupService consumerGroupService;", "type": "ConsumerGroupService", "var_name": "consumerGroupService" }, { "declarator": "c...
{ "body": "@Override\n public String checkResult() {\n String result = null;\n Map<String, ConsumerGroupEntity> consumerGroupMap = consumerGroupService.getCache();\n Map<String, ConsumerGroupTopicEntity> consumerGroupTopicMap = consumerGroupTopicService.getGroupTopic();\n Map<String,Top...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_59
{ "fields": [ { "declarator": "message01Repository", "modifier": "private", "original_string": "private Message01Repository message01Repository;", "type": "Message01Repository", "var_name": "message01Repository" }, { "declarator": "dbNodeService", "modifier": "pri...
{ "body": "@Test\n\tpublic void createMessageTableTest() {\n\t\tmessage01ServiceImpl.createMessageTable(\"test\");\n\t\tverify(message01Repository).createMessageTable(anyString());\n\t}", "class_method_signature": "Message01ServiceImplTest.createMessageTableTest()", "constructor": false, "full_signature": "@Tes...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "publ...
{ "body": "@Override\n\tpublic void createMessageTable(String tbName) {\n\t\tsetMaster(true);\n\t\tmessage01Repository.createMessageTable(tbName);\n\t}", "class_method_signature": "Message01ServiceImpl.createMessageTable(String tbName)", "constructor": false, "full_signature": "@Override public void createMessa...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_96
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void sendPublishFailMailTest() {\n\t\tPublishMessageRequest request=new PublishMessageRequest();\n\t\tException last=new RuntimeException(\"testt\");\n\t\t\n\t\trequest.setTopicName(\"Test\");\n\t\tconsumerServiceImpl.sendPublishFailMail(request, last, 1);\n\t\tverify(emailService).sendProd...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "protected void sendPublishFailMail(PublishMessageRequest request, Exception last, int type) {\n if (soaConfig.enableSendFailTopicMail(request.getTopicName())) {\n SendMailRequest request2 = new SendMailRequest();\n request2.setServer(true);\n request2.setSubject(\"服务...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_79
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void pullDataTest() {\n\t\tQueueEntity queueEntity = new QueueEntity();\n\t\tqueueEntity.setDbNodeId(1);\n\t\tqueueEntity.setIp(\"127.0.0.1\");\n\t\tqueueEntity.setId(1L);\n\t\tMap<Long, QueueEntity> data = new HashMap<Long, QueueEntity>();\n\t\tdata.put(queueEntity.getId(), queueEntity);\n...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "@Override\n public PullDataResponse pullData(PullDataRequest request) {\n PullDataResponse response = new PullDataResponse();\n response.setSuc(true);\n Map<Long, QueueEntity> data = queueService.getAllQueueMap();\n checkVaild(request, response, data);\n if (!response....
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_80
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void getMessageCountTest() {\n\t\tGetMessageCountResponse response = null;\n\t\tresponse = consumerServiceImpl.getMessageCount(null);\n\t\tassertEquals(false, response.isSuc());\n\t\tGetMessageCountRequest request = new GetMessageCountRequest();\n\n\t\tMap<String, ConsumerGroupEntity> consu...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "@Override\n public GetMessageCountResponse getMessageCount(GetMessageCountRequest request) {\n GetMessageCountResponse response = new GetMessageCountResponse();\n response.setSuc(true);\n if (request == null || StringUtils.isEmpty(request.getConsumerGroupName())) {\n resp...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_38
{ "fields": [ { "declarator": "emailServiceImpl", "modifier": "private", "original_string": "private EmailServiceImpl emailServiceImpl;", "type": "EmailServiceImpl", "var_name": "emailServiceImpl" }, { "declarator": "topicService", "modifier": "private", "or...
{ "body": "@Test\n\tpublic void sendProduceMailTest() {\n\t\tSendMailRequest sendMailRequest=new SendMailRequest();\n\t\tsendMailRequest.setConsumerGroupName(\"test\");\n\t\tsendMailRequest.setTopicName(\"test\");\n\t\tsendMailRequest.setType(1);\n\t\tsendMailRequest.setSubject(\"test\");\n\t\t\n\t\tMap<String, Topic...
{ "fields": [ { "declarator": "topicService", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate TopicService topicService;", "type": "TopicService", "var_name": "topicService" }, { "declarator": "consumerGroupService", "modifier": "@Au...
{ "body": "@Override\n\tpublic void sendProduceMail(SendMailRequest request) {\n\t\t// 使用以前的告警方式\n\t\tsendByProducer(request);\n\t\taddLogMsg(request);\n\t}", "class_method_signature": "EmailServiceImpl.sendProduceMail(SendMailRequest request)", "constructor": false, "full_signature": "@Override public void sen...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_136
{ "fields": [], "file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/HttpClientTest.java", "identifier": "HttpClientTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void checkTest() throws IOException {\n\t\tClientAndServer mockClient = new ClientAndServer(5000);\n\t\ttry {\n\t\t\tmockClient.when(HttpRequest.request().withMethod(\"GET\"))\n\t\t\t\t\t.respond(HttpResponse.response().withStatusCode(200));\n\t\t\tHttpClient httpClient = new HttpClient();\...
{ "fields": [ { "declarator": "JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\");", "type": "MediaType", "var_name": ...
{ "body": "public boolean check(String url) {\t\t\n\t\tTransaction transaction = Tracer.newTransaction(\"mq-http-doubleCheck\", url);\n\t\tResponse response = null;\n\t\ttry {\n\t\t\tRequest request = new Request.Builder().url(url).get().build();\n\t\t response = client.newCall(request).execute();\t\n\t\t trans...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_43
{ "fields": [ { "declarator": "dbNodeRepository", "modifier": "private", "original_string": "private DbNodeRepository dbNodeRepository;", "type": "DbNodeRepository", "var_name": "dbNodeRepository" }, { "declarator": "dbNodeServiceImpl", "modifier": "private", ...
{ "body": "@Test\n\tpublic void checkSlaveTest() throws SQLException {\n\t\tDruidDataSource dataSource = mock(DruidDataSource.class);\n\t\tDbNodeServiceImpl.DataSourceFactory dataSourceFactory = new DbNodeServiceImpl.DataSourceFactory() {\n\t\t\t@Override\n\t\t\tpublic DruidDataSource createDataSource() {\n\t\t\t\t//...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(DbNodeServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(DbNodeServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "dbNodeRepo...
{ "body": "protected void checkSlave(DbNodeEntity dbNodeEntity) throws SQLException {\n\t\t// 检查slave\n\t\tif (hasSlave(dbNodeEntity)) {\n\t\t\tDruidDataSource dataSource = dataSourceFactory.createDataSource();\n\t\t\tdataSource.setDriverClassName(\"com.mysql.jdbc.Driver\");\n\t\t\tdataSource.setUsername(dbNodeEntity...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_14
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void notifyRbTest() {\n\t\tconsumerGroupServiceImpl.notifyRb(null);\n\t\tverify(consumerGroupRepository,times(0)).updateMetaVersion(anyListOf(Long.class));\n\t\t\n\t\tconsumerGroupServiceImpl.notifyRb(1L);\n\t\tverify(consumerGroupRepository).updateRbVersion(anyListOf(Long.class));\n\t\tver...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\tpublic void notifyRb(long id) {\n\t\tupdateRbVersion(Arrays.asList(id));\n\t\tList<NotifyMessageEntity> notifyMessageEntities = new ArrayList<>();\n\t\tNotifyMessageEntity notifyMessageEntity = new NotifyMessageEntity();\n\t\tnotifyMessageEntity.setConsumerGroupId(id);\n\t\tnotifyMessageEntity...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_161
{ "fields": [], "file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java", "identifier": "MqResourceTest", "interfaces": "", "superclass": "extends AbstractTest" }
{ "body": "@Test\n\tpublic void getMetaGroupNullTest() throws IOException, BrokerException {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\n\t\tassertEquals(\"getMetaGroupNullTest error\", null, mqResource.getMetaGroup(null));\n...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MqResource.class)", "modifier": "private final", "original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "htt...
{ "body": "public GetMetaGroupResponse getMetaGroup(GetMetaGroupRequest request) {\n\t\tif (request == null) {\n\t\t\treturn null;\n\t\t}\n\t\tString url = MqConstanst.METAPRE + \"/getMetaGroup\";\n\t\tGetMetaGroupResponse response = post(request, url, 10, GetMetaGroupResponse.class, false);\n\t\treturn response;\n\t...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_177
{ "fields": [], "file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java", "identifier": "MqResourceTest", "interfaces": "", "superclass": "extends AbstractTest" }
{ "body": "@Test\n\tpublic void postTest() throws IOException, BrokerException {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\t\t\n\t\tPublishMessageResponse response = new PublishMessageResponse();\n\t\tresponse.setSuc(false);\n...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MqResource.class)", "modifier": "private final", "original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "htt...
{ "body": "protected <T> T post(Object request, String path, int tryCount, Class<T> class1, boolean isImportant) {\n\t\tT response = null;\n\t\tint count = 0;\n\t\tException last = null;\n\t\tString url = null;\n\t\twhile (response == null && count < tryCount) {\n\t\t\tString host = getHost(isImportant);\n\t\t\turl =...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_55
{ "fields": [ { "declarator": "message01Repository", "modifier": "private", "original_string": "private Message01Repository message01Repository;", "type": "Message01Repository", "var_name": "message01Repository" }, { "declarator": "dbNodeService", "modifier": "pri...
{ "body": "@Test\n\tpublic void getMaxIdTest() {\n\t\tmessage01ServiceImpl.getMaxId(\"test\");\n\t\tverify(message01Repository).getMaxId(anyString(), anyString());\n\t\tmessage01ServiceImpl.setDbId(1);\n\t\tboolean rs = false;\n\t\tdoThrow(new RuntimeException(\"test\")).when(message01Repository).getMaxId(anyString()...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "publ...
{ "body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.NOT_SUPPORTED, value = \"msgTransactionManager\")\n\tpublic Long getMaxId(String tbName) {\n\t\tsetMaster(true);\n\t\tLong maxId = 0L;\n\t\ttry {\n\t\t\t// maxId = message01Repository.getMaxIdByTb(getDbName() + \".\" +\n\t...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_120
{ "fields": [], "file": "mq-biz/src/test/java/com/ppdai/infrastructure/mq/biz/service/impl/AuditLogServiceImplTest.java", "identifier": "AuditLogServiceImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void deleteByTest() {\n\t\tAuditLogServiceImpl auditLogServiceImpl=new AuditLogServiceImpl();\n\t\tUserInfoHolder userInfoHolder=mock(UserInfoHolder.class);\n\t\tAuditLogRepository auditLogRepository=mock(AuditLogRepository.class);\n\t\tReflectionTestUtils.setField(auditLogServiceImpl, \"us...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(AuditLogServiceImpl.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(AuditLogServiceImpl.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n\tpublic void deleteBy(Long minId) {\n\t\tauditLogRepository.deleteBy(minId);\n\t}", "class_method_signature": "AuditLogServiceImpl.deleteBy(Long minId)", "constructor": false, "full_signature": "@Override public void deleteBy(Long minId)", "identifier": "deleteBy", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_54
{ "fields": [ { "declarator": "message01Repository", "modifier": "private", "original_string": "private Message01Repository message01Repository;", "type": "Message01Repository", "var_name": "message01Repository" }, { "declarator": "dbNodeService", "modifier": "pri...
{ "body": "@Test\n\tpublic void getTableMinIdTest() {\n\t\tmessage01ServiceImpl.getTableMinId(\"test\");\n\t\tverify(message01Repository).getTableMinId(anyString());\n\t}", "class_method_signature": "Message01ServiceImplTest.getTableMinIdTest()", "constructor": false, "full_signature": "@Test public void getTab...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "publ...
{ "body": "@Override\n\t@Transactional(rollbackFor = Exception.class, propagation = Propagation.NOT_SUPPORTED, value = \"msgTransactionManager\")\n\tpublic Long getTableMinId(String tbName){\n\t\treturn message01Repository.getTableMinId(getDbName() + \".\" + tbName);\n\t}", "class_method_signature": "Message01Servi...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_121
{ "fields": [], "file": "mq-biz/src/test/java/com/ppdai/infrastructure/mq/biz/service/impl/AuditLogServiceImplTest.java", "identifier": "AuditLogServiceImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void logListTest() {\n\t\tAuditLogServiceImpl auditLogServiceImpl=new AuditLogServiceImpl();\n\t\tUserInfoHolder userInfoHolder=mock(UserInfoHolder.class);\n\t\tAuditLogRepository auditLogRepository=mock(AuditLogRepository.class);\n\t\tReflectionTestUtils.setField(auditLogServiceImpl, \"use...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(AuditLogServiceImpl.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(AuditLogServiceImpl.class);", "type": "Logger", "var_name": "log" }, { ...
{ "body": "@Override\n\tpublic AuditLogResponse logList(AuditLogRequest auditLogRequest) {\n\t\tMap<String, Object> conditionMap = new HashMap<>();\n\t\tif (StringUtils.isNotEmpty(auditLogRequest.getTbName())) {\n\t\t\tconditionMap.put(AuditLogEntity.FdTbName, auditLogRequest.getTbName());\n\t\t}\n\t\tif (StringUtils...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_176
{ "fields": [], "file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java", "identifier": "MqResourceTest", "interfaces": "", "superclass": "extends AbstractTest" }
{ "body": "@Test\n\tpublic void sendMailTest() {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\t\tmqResource.sendMail(null);\n\t\tmqResource.sendMail(new SendMailRequest());\n\t}", "class_method_signature": "MqResourceTest.sen...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MqResource.class)", "modifier": "private final", "original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "htt...
{ "body": "public void sendMail(SendMailRequest request) {\n\t\tif (request == null) {\n\t\t\treturn;\n\t\t}\n\t\texecutor1.submit(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString url = MqConstanst.TOOLPRE + \"/sendMail\";\n\t\t\t\ttry {\n\t\t\t\t\tpost(request, url, 1, SendMailResponse.cl...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_15
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void updateRbVersionTest() {\n\t\tconsumerGroupServiceImpl.updateRbVersion(null);\n\t\tverify(consumerGroupRepository, times(0)).updateRbVersion(anyListOf(Long.class));\n\t\tconsumerGroupServiceImpl.updateRbVersion(Arrays.asList(1L));\n\t\tverify(consumerGroupRepository).updateRbVersion(any...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "protected void updateRbVersion(List<Long> ids) {\n\t\tif (CollectionUtils.isEmpty(ids))\n\t\t\treturn;\n\t\tconsumerGroupRepository.updateRbVersion(ids);\n\t}", "class_method_signature": "ConsumerGroupServiceImpl.updateRbVersion(List<Long> ids)", "constructor": false, "full_signature": "protected voi...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_160
{ "fields": [], "file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java", "identifier": "MqResourceTest", "interfaces": "", "superclass": "extends AbstractTest" }
{ "body": "@Test\n\tpublic void deRegisterNullTest() throws IOException, BrokerException {\n\t\tIHttpClient httpClient = mock(IHttpClient.class);\n\t\tMqResource mqResource = new MqResource(httpClient, \"http://localhost\");\n\n\t\tmqResource.deRegister(null);\n\t}", "class_method_signature": "MqResourceTest.deRegi...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MqResource.class)", "modifier": "private final", "original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "htt...
{ "body": "public void deRegister(ConsumerDeRegisterRequest request) {\n\t\tif (request == null) {\n\t\t\treturn;\n\t\t}\n\t\tString url = MqConstanst.CONSUMERPRE + \"/deRegister\";\n\t\tpost(request, url, 10, ConsumerDeRegisterResponse.class, true);\n\t}", "class_method_signature": "MqResource.deRegister(ConsumerD...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_137
{ "fields": [], "file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/HttpClientTest.java", "identifier": "HttpClientTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void checkFalseTest() throws IOException {\n\t\t// ClientAndServer mockClient = new ClientAndServer (5000);\n\t\t// mockClient.when(HttpRequest.request().withMethod(\"GET\")).respond(HttpResponse.response().withStatusCode(200));\n\t\tHttpClient httpClient = new HttpClient(10, 10);\n\t\tasse...
{ "fields": [ { "declarator": "JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\");", "type": "MediaType", "var_name": ...
{ "body": "public boolean check(String url) {\t\t\n\t\tTransaction transaction = Tracer.newTransaction(\"mq-http-doubleCheck\", url);\n\t\tResponse response = null;\n\t\ttry {\n\t\t\tRequest request = new Request.Builder().url(url).get().build();\n\t\t response = client.newCall(request).execute();\t\n\t\t trans...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_42
{ "fields": [ { "declarator": "dbNodeRepository", "modifier": "private", "original_string": "private DbNodeRepository dbNodeRepository;", "type": "DbNodeRepository", "var_name": "dbNodeRepository" }, { "declarator": "dbNodeServiceImpl", "modifier": "private", ...
{ "body": "@Test\n\tpublic void checkDataSourceTest() throws SQLException {\n\t\tDruidDataSource dataSource = mock(DruidDataSource.class);\n\t\tDbNodeServiceImpl.DataSourceFactory dataSourceFactory = new DbNodeServiceImpl.DataSourceFactory() {\n\t\t\t@Override\n\t\t\tpublic DruidDataSource createDataSource() {\n\t\t\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(DbNodeServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(DbNodeServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "dbNodeRepo...
{ "body": "@Override\n\tpublic void checkDataSource(DbNodeEntity dbNodeEntity) {\n\t\ttry {\n\t\t\t// 检查master\n\t\t\tcheckMaster(dbNodeEntity);\n\t\t\tcheckSlave(dbNodeEntity);\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "class_method_signature": "DbNodeServiceImpl.checkDataSou...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_39
{ "fields": [ { "declarator": "dbNodeRepository", "modifier": "private", "original_string": "private DbNodeRepository dbNodeRepository;", "type": "DbNodeRepository", "var_name": "dbNodeRepository" }, { "declarator": "dbNodeServiceImpl", "modifier": "private", ...
{ "body": "@Test\n\tpublic void updateDbPropertiesTest() {\n\t\tMap<String, DataSource> dbCacheMap = new HashMap<String, DataSource>();\n\t\tdbCacheMap.put(\"test\", new DruidDataSource());\n\t\tdbNodeServiceImpl.cacheDataMap.set(dbCacheMap);\n\t\tsetProperty(\"mq.db.initCount\", \"11\");\n\t\tsetProperty(\"mq.db.max...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(DbNodeServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(DbNodeServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "dbNodeRepo...
{ "body": "protected void updateDbProperties() {\n\t\tif (minEvictableIdleTimeMillis != soaConfig.getDbMinEvictableIdleTimeMillis()) {\n\t\t\tminEvictableIdleTimeMillis = soaConfig.getDbMinEvictableIdleTimeMillis();\n\t\t\tcacheDataMap.get().values().forEach(dataSource -> {\n\t\t\t\ttry {\n\t\t\t\t\tif (dataSource in...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_81
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void findByHeartTimeIntervalTest() {\n\t\tconsumerServiceImpl.findByHeartTimeInterval(5);\n\t\tverify(consumerRepository).findByHeartTimeInterval(anyLong());\n\t}", "class_method_signature": "ConsumerServiceImplTest.findByHeartTimeIntervalTest()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "@Override\n public List<ConsumerEntity> findByHeartTimeInterval(long heartTimeInterval) {\n return consumerRepository.findByHeartTimeInterval(heartTimeInterval);\n }", "class_method_signature": "ConsumerServiceImpl.findByHeartTimeInterval(long heartTimeInterval)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_97
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void addRegisterConsumerGroupLogTest() {\n\t\tConsumerGroupRegisterRequest request=new ConsumerGroupRegisterRequest();\n\t\tConsumerGroupRegisterResponse response=new ConsumerGroupRegisterResponse();\n\t\tMap<String, List<String>> consumerGroupNames=new HashMap<String, List<String>>();\n\t\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "protected void addRegisterConsumerGroupLog(ConsumerGroupRegisterRequest request,\n ConsumerGroupRegisterResponse response) {\n String json = JsonUtil.toJsonNull(request);\n if (request != null && request.getConsumerGroupNames() != null) {\n ...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_78
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void pullData_checkStatusTest() {\n\t\tQueueEntity queueEntity = new QueueEntity();\n\t\tqueueEntity.setDbNodeId(1);\n\t\tqueueEntity.setIp(\"127.0.0.1\");\n\t\tqueueEntity.setId(1L);\n\t\tMap<Long, QueueEntity> data = new HashMap<Long, QueueEntity>();\n\t\tdata.put(queueEntity.getId(), que...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "protected boolean checkStatus(QueueEntity temp, Map<Long, DbNodeEntity> dbNodeMap) {\n if (!dbNodeMap.containsKey(temp.getDbNodeId())) {\n return false;\n }\n if (dbNodeMap.get(temp.getDbNodeId()).getReadOnly() == 3) {\n return false;\n }\n return tr...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_58
{ "fields": [ { "declarator": "message01Repository", "modifier": "private", "original_string": "private Message01Repository message01Repository;", "type": "Message01Repository", "var_name": "message01Repository" }, { "declarator": "dbNodeService", "modifier": "pri...
{ "body": "@Test\n\tpublic void getTableQuantityByDbNameTest() {\n\t\tassertEquals(0, message01ServiceImpl.getTableQuantityByDbName(\"test\"));\n\t\tassertEquals(0, message01ServiceImpl.getTableNamesByDbName(\"test\").size());\n\t\t\n\t\tList<TableInfoEntity> dataLst =new ArrayList<TableInfoEntity>();\n\t\tTableInfoE...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(Message01ServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(Message01ServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "publ...
{ "body": "@Override\n\tpublic int getTableQuantityByDbName(String dbName) {\n\t\tMap<String, Map<String, Long>> data = getMaxId();\n\t\tif (data.containsKey(dbName)) {\n\t\t\treturn data.get(dbName).size();\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "class_method_signature": "Message01ServiceImpl.getTableQuantit...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_3
{ "fields": [ { "declarator": "consumerGroupConsumerRepository", "modifier": "private", "original_string": "private ConsumerGroupConsumerRepository consumerGroupConsumerRepository;", "type": "ConsumerGroupConsumerRepository", "var_name": "consumerGroupConsumerRepository" }, {...
{ "body": "@Test\n\tpublic void getByConsumerGroupIdsTest() {\n\t\tassertEquals(true, consumerGroupConsumerServiceImpl.getByConsumerGroupIds(null).size() == 0);\n\t\twhen(consumerGroupConsumerRepository.getByConsumerGroupIds(anyList())).thenReturn(new ArrayList());\n\t\t// TODO Auto-generated method stub\n\t\tconsume...
{ "fields": [ { "declarator": "consumerGroupConsumerRepository", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate ConsumerGroupConsumerRepository consumerGroupConsumerRepository;", "type": "ConsumerGroupConsumerRepository", "var_name": "consumerGroupCons...
{ "body": "@Override\n\tpublic List<ConsumerGroupConsumerEntity> getByConsumerGroupIds(List<Long> consumerGroupIds) {\n\t\tif (CollectionUtils.isEmpty(consumerGroupIds)) {\n\t\t\treturn new ArrayList<>();\n\t\t}\n\t\t// TODO Auto-generated method stub\n\t\treturn consumerGroupConsumerRepository.getByConsumerGroupIds(...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_19
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void getGroupTopicTest() {\n\t\tconsumerGroupServiceImpl.getGroupTopic();\n\t\tverify(consumerGroupTopicService).getList();\n\t}", "class_method_signature": "ConsumerGroupServiceImplTest.getGroupTopicTest()", "constructor": false, "full_signature": "@Test public void getGroupTopicTest...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\tpublic List<ConsumerGroupTopicEntity> getGroupTopic() {\n\t\treturn consumerGroupTopicService.getList();\n\t}", "class_method_signature": "ConsumerGroupServiceImpl.getGroupTopic()", "constructor": false, "full_signature": "@Override public List<ConsumerGroupTopicEntity> getGroupTopic()",...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_183
{ "fields": [], "file": "mq-client/mq-client-spring/src/test/java/com/ppdai/infrastructure/mq/client/bootstrap/MqEnvPropTest.java", "identifier": "MqEnvPropTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void getAllEnvTest() {\n\t\t//MapPropertySource\n\t\tConfigurableEnvironment environment=mock(ConfigurableEnvironment.class);\n\t\tMutablePropertySources mutablePropertySources=new MutablePropertySources();\n\t\twhen(environment.getPropertySources()).thenReturn(mutablePropertySources);\n\t\...
{ "fields": [ { "declarator": "environment", "modifier": "private", "original_string": "private Environment environment;", "type": "Environment", "var_name": "environment" }, { "declarator": "sanitizer = new Sanitizer()", "modifier": "private final", "origin...
{ "body": "public Map<String, Map<String, Object>> getAllEnv() { \n\t\tMap<String, Map<String, Object>> result = new LinkedHashMap<String, Map<String, Object>>();\t\t\n\t\tfor (Entry<String, PropertySource<?>> entry : getPropertySources().entrySet()) {\n\t\t\tPropertySource<?> source = entry.getValue();\n\t\t\tStrin...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_35
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void forceUpdateCacheTest() {\n\t\tList<ConsumerGroupEntity> consumerGroupEntities=new ArrayList<ConsumerGroupEntity>();\n\t\tConsumerGroupEntity consumerGroupEntity=new ConsumerGroupEntity();\n\t\tconsumerGroupEntity.setName(\"test\");\n\t\tconsumerGroupEntity.setId(1L);\n\t\tconsumerGroup...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\tpublic void forceUpdateCache() {\n\t\tTransaction transaction = Tracer.newTransaction(\"Timer\", \"ConsumerGroup-updateCache\");\n\t\tTraceMessageItem traceMessageItem = new TraceMessageItem();\n\t\ttry {\n\t\t\tList<ConsumerGroupEntity> consumerGroupEntities = getList();\n\t\t\tMqReadMap<Stri...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_140
{ "fields": [], "file": "mq-client/mq-core/src/test/java/com/ppdai/infrastructure/mq/biz/common/util/HttpClientTest.java", "identifier": "HttpClientTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void getError1Test() throws IOException {\n\t\tClientAndServer mockClient = new ClientAndServer(5000);\n\t\ttry {\n\t\t\tmockClient.when(HttpRequest.request().withMethod(\"GET\"))\n\t\t\t\t\t.respond(HttpResponse.response().withStatusCode(700).withBody(\"1\"));\n\t\t\tHttpClient httpClient ...
{ "fields": [ { "declarator": "JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\")", "modifier": "private static final", "original_string": "private static final MediaType JSONTYPE = MediaType.parse(\"application/json; charset=utf-8\");", "type": "MediaType", "var_name": ...
{ "body": "public <T> T get(String url, Class<T> class1) throws IOException {\n\t\tString rs = get(url);\n\t\tif (rs == null || rs.length() == 0 || rs.trim().length() == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn JsonUtil.parseJson(rs, class1);\n\t\t}\n\t}", "class_method_signature": "HttpClient.get(Strin...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_117
{ "fields": [ { "declarator": "consumerGroupTopicServiceImpl", "modifier": "private", "original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;", "type": "ConsumerGroupTopicServiceImpl", "var_name": "consumerGroupTopicServiceImpl" }, { "de...
{ "body": "@Test\n\tpublic void doDeleteTest() {\t\t\n\t\tConsumerGroupTopicEntity consumerGroupTopicEntity = new ConsumerGroupTopicEntity();\n\t\tconsumerGroupTopicEntity.setConsumerGroupId(1);\n\t\tconsumerGroupTopicEntity.setConsumerGroupName(\"test\");\n\t\tconsumerGroupTopicEntity.setOriginTopicName(\"test\");\n...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "...
{ "body": "protected void doDelete(ConsumerGroupTopicEntity consumerGroupTopicEntity){\n\t\tList<String> failTopicNames = new ArrayList<>();\n\t\t// 删除失败topic,并且清理失败消息并且解绑失败topic\n\t\tfailTopicNames.add(TopicUtil.getFailTopicName(consumerGroupTopicEntity.getConsumerGroupName(),consumerGroupTopicEntity.getOriginTopicN...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_62
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void checkVaildTest() {\n\t\tConsumerRegisterRequest request = null;\n\t\tassertEquals(false, consumerServiceImpl.register(request).isSuc());\n\n\t\trequest = new ConsumerRegisterRequest();\n\t\tassertEquals(false, consumerServiceImpl.register(request).isSuc());\n\n\t\trequest.setClientIp(\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "protected void checkVaild(ConsumerRegisterRequest request, ConsumerRegisterResponse response) {\n if (request == null) {\n response.setSuc(false);\n response.setMsg(\"ConsumerRegisterRequest不能为空!\");\n return;\n }\n if (StringUtils.isEmpty(request.getNa...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_74
{ "fields": [ { "declarator": "consumerRepository", "modifier": "private", "original_string": "private ConsumerRepository consumerRepository;", "type": "ConsumerRepository", "var_name": "consumerRepository" }, { "declarator": "consumerGroupConsumerService", "modif...
{ "body": "@Test\n\tpublic void publicsh_checkVaildTest() {\n\t\tPublishMessageRequest request = null;\n\t\tPublishMessageResponse response = new PublishMessageResponse();\n\t\tconsumerServiceImpl.checkVaild(request, response);\n\t\tassertEquals(false, response.isSuc());\n\t\trequest = new PublishMessageRequest();\n\...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator": "consum...
{ "body": "protected void checkVaild(ConsumerRegisterRequest request, ConsumerRegisterResponse response) {\n if (request == null) {\n response.setSuc(false);\n response.setMsg(\"ConsumerRegisterRequest不能为空!\");\n return;\n }\n if (StringUtils.isEmpty(request.getNa...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_101
{ "fields": [ { "declarator": "consumerGroupTopicServiceImpl", "modifier": "private", "original_string": "private ConsumerGroupTopicServiceImpl consumerGroupTopicServiceImpl;", "type": "ConsumerGroupTopicServiceImpl", "var_name": "consumerGroupTopicServiceImpl" }, { "de...
{ "body": "@Test\n\tpublic void deleteByOriginTopicNameTest() {\n\t\tconsumerGroupTopicServiceImpl.deleteByOriginTopicName(1, \"test\");\n\t\tverify(consumerGroupTopicRepository).deleteByOriginTopicName(anyLong(), anyString());\n\t}", "class_method_signature": "ConsumerGroupTopicServiceImplTest.deleteByOriginTopicN...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupTopicServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "...
{ "body": "@Override\n\tpublic void deleteByOriginTopicName(long consumerGroupId, String originTopicName) {\n\t\tconsumerGroupTopicRepository.deleteByOriginTopicName(consumerGroupId, originTopicName);\n\t}", "class_method_signature": "ConsumerGroupTopicServiceImpl.deleteByOriginTopicName(long consumerGroupId, Strin...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_156
{ "fields": [], "file": "mq-client/mq-client-core/src/test/java/com/ppdai/infrastructure/mq/client/resource/MqResourceTest.java", "identifier": "MqResourceTest", "interfaces": "", "superclass": "extends AbstractTest" }
{ "body": "@Test\n\tpublic void setUrlsNullTest() {\n\t\tMqResource mqResource = new MqResource(\"http://localhost\", 10000, 10000);\n\t\tmqResource.setUrls(null, null);\n\t\tAtomicReference<List<String>> urlsG1 = getValue(\"urlsG1\", mqResource);\n\t\tAtomicReference<List<String>> urlsG2 = getValue(\"urlsG2\", mqRes...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MqResource.class)", "modifier": "private final", "original_string": "private final Logger logger = LoggerFactory.getLogger(MqResource.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "htt...
{ "body": "public void setUrls(List<String> urlsTempG1, List<String> urlsTempG2) {\n\t\tif (urlsTempG1 == null) {\n\t\t\turlsTempG1 = new ArrayList<>();\n\t\t}\n\t\tif (urlsTempG2 == null) {\n\t\t\turlsTempG2 = new ArrayList<>();\n\t\t}\n\t\turlsG1.set(urlsTempG1);\n\t\turlsG2.set(urlsTempG2);\n\t\tif (urlsTempG1.siz...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
215950115_23
{ "fields": [ { "declarator": "consumerGroupRepository", "modifier": "private", "original_string": "private ConsumerGroupRepository consumerGroupRepository;", "type": "ConsumerGroupRepository", "var_name": "consumerGroupRepository" }, { "declarator": "notifyMessageServi...
{ "body": "@Test\n\tpublic void countByOwnerNamesTest() {\n\t\tconsumerGroupServiceImpl.countByOwnerNames(null);\n\t\tverify(consumerGroupRepository).countByOwnerNames(anyMapOf(String.class, Object.class));\n\t}", "class_method_signature": "ConsumerGroupServiceImplTest.countByOwnerNamesTest()", "constructor": fal...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class)", "modifier": "private", "original_string": "private Logger log = LoggerFactory.getLogger(ConsumerGroupServiceImpl.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "@Override\n\tpublic long countByOwnerNames(Map<String, Object> parameterMap) {\n\t\treturn consumerGroupRepository.countByOwnerNames(parameterMap);\n\t}", "class_method_signature": "ConsumerGroupServiceImpl.countByOwnerNames(Map<String, Object> parameterMap)", "constructor": false, "full_signature": ...
{ "created": null, "fork": null, "fork_count": 90, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 215950115, "size": 3696, "stargazer_count": 223, "stars": null, "updates": null, "url": "https://github.com/ppdaicorp/pmq" }
87225655_0
{ "fields": [ { "declarator": "cut", "modifier": "", "original_string": "InvocationStatistics cut;", "type": "InvocationStatistics", "var_name": "cut" } ], "file": "perceptor/src/test/java/com/airhacks/interceptor/monitoring/entity/InvocationStatisticsTest.java", "identifie...
{ "body": "@Test\n public void addInvocation() {\n Invocation first = new Invocation(null, 15, null, 1);\n Invocation second = new Invocation(null, 15, null, 2);\n Invocation another = new Invocation(null, 30, null, 2);\n this.cut.addInvocation(first);\n this.cut.addInvocation(se...
{ "fields": [ { "declarator": "methodName", "modifier": "private", "original_string": "private String methodName;", "type": "String", "var_name": "methodName" }, { "declarator": "recentDuration", "modifier": "private", "original_string": "private long recent...
{ "body": "public void addInvocation(Invocation invocation) {\n numberOfInvocations++;\n if (this.methodName != null) {\n this.methodName = invocation.getMethodName();\n }\n this.recentDuration = invocation.getRecentDuration();\n this.lastInvocationTimestamp = invocation....
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 87225655, "size": 37, "stargazer_count": 18, "stars": null, "updates": null, "url": "https://github.com/AdamBien/perceptor" }
87225655_1
{ "fields": [ { "declarator": "cut", "modifier": "", "original_string": "InvocationMonitoring cut;", "type": "InvocationMonitoring", "var_name": "cut" } ], "file": "perceptor/src/test/java/com/airhacks/interceptor/monitoring/control/InvocationMonitoringTest.java", "identifi...
{ "body": "@Test\n public void reset() {\n Invocation ex1 = new Invocation(\"unstable\", 1, \"lazy - don't call me\", 1);\n Invocation ex2 = new Invocation(\"does not matter\", 2, null, 2);\n this.cut.onNewCall(ex1);\n this.cut.onNewCall(ex2);\n List<InvocationStatistics> recent ...
{ "fields": [ { "declarator": "statistics", "modifier": "private", "original_string": "private ConcurrentHashMap<String, InvocationStatistics> statistics;", "type": "ConcurrentHashMap<String, InvocationStatistics>", "var_name": "statistics" } ], "file": "perceptor/src/main/ja...
{ "body": "public void reset() {\n this.statistics.clear();\n }", "class_method_signature": "InvocationMonitoring.reset()", "constructor": false, "full_signature": "public void reset()", "identifier": "reset", "invocations": [ "clear" ], "modifiers": "public", "parameters": "()", "retu...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 87225655, "size": 37, "stargazer_count": 18, "stars": null, "updates": null, "url": "https://github.com/AdamBien/perceptor" }
17651735_16
{ "fields": [], "file": "fnlp-core/src/test/java/org/fnlp/nlp/tag/TaggerTest.java", "identifier": "TaggerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testMain() {\n\t\ttry {\n\t\t\tTagger.main(\"-train ../example-data/sequence/template ../example-data/sequence/train.txt ../tmp/tmp.m\".split(\"\\\\s+\"));\n\t\t\tTagger.main(\"../tmp/tmp.m ../example-data/sequence/test.txt ../tmp/res.txt\".split(\"\\\\s+\"));\n\t\t} catch (Exception e...
{ "fields": [], "file": "fnlp-core/src/main/java/org/fnlp/nlp/tag/Tagger.java", "identifier": "Tagger", "interfaces": "", "methods": [ { "class_method_signature": "Tagger.main(String[] args)", "constructor": false, "full_signature": "public static void main(String[] args)", "identi...
{ "body": "public static void main(String[] args) throws Exception {\n\n\t\tOptions opt = new Options();\n\n\t\topt.addOption(\"h\", false, \"Print help for this application\");\n\t\topt.addOption(\"iter\", true, \"iterative num, default 50\");\n\t\topt.addOption(\"c\", true, \"parameters C in PA algorithm, default 0...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_20
{ "fields": [ { "declarator": "label", "modifier": "static", "original_string": "static LabelAlphabetEnum<PartOfSpeech> label ;", "type": "LabelAlphabetEnum<PartOfSpeech>", "var_name": "label" } ], "file": "fnlp-core/src/test/java/org/fnlp/ml/types/alphabet/LabelAlphabetEnumT...
{ "body": "@Test\n\tpublic void test() {\n\t\tSystem.out.println(label.lookupIndex(PartOfSpeech.人称代词.name()));\n\t\tSystem.out.println(label.lookupIndex(\"人称代词\"));\n\t}", "class_method_signature": "LabelAlphabetEnumTest.test()", "constructor": false, "full_signature": "@Test public void test()", "identifier"...
{ "fields": [ { "declarator": "serialVersionUID = 1821762568866399277L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1821762568866399277L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "clazz...
{ "body": "@Override\n\tpublic int lookupIndex(String str) {\n\t\tT t;\n\t\ttry {\n\t\t\tt = Enum.valueOf(clazz, str);\n\t\t\treturn t.ordinal();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn -1;\n\t\t\n\t}", "class_method_signature": "LabelAlphabetEnum.lookupIndex(String str)", "con...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_7
{ "fields": [ { "declarator": "s1", "modifier": "static", "original_string": "static String s1;", "type": "String", "var_name": "s1" }, { "declarator": "pos", "modifier": "static", "original_string": "static POSTagger pos;", "type": "POSTagger", ...
{ "body": "@Test\n\tpublic void testTagString() {\n\t\tString o1 = pos.tag(s1);\n\t\tSystem.out.println(o1);\n\t}", "class_method_signature": "POSTaggerTest.testTagString()", "constructor": false, "full_signature": "@Test public void testTagString()", "identifier": "testTagString", "invocations": [ "tag...
{ "fields": [ { "declarator": "dictPipe = null", "modifier": "private", "original_string": "private DictPOSLabel dictPipe = null;", "type": "DictPOSLabel", "var_name": "dictPipe" }, { "declarator": "oldfeaturePipe = null", "modifier": "private", "original_st...
{ "body": "@Override\n\tpublic String tag(String src) {\n\t\tif(src==null||src.length()==0)\n\t\t\treturn src;\n\t\tif(cws==null){\n\t\t\tSystem.out.println(\"只能处理分好词的句子\");\n\t\t\treturn null;\n\t\t}\n\t\tString[] words = cws.tag2Array(src);\n\t\tif(words.length==0)\n\t\t\treturn src;\n\n\t\tInstance inst = new Inst...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_6
{ "fields": [ { "declarator": "tc", "modifier": "private", "original_string": "private ChineseTrans tc;", "type": "ChineseTrans", "var_name": "tc" } ], "file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/ChineseTransTest.java", "identifier": "ChineseTransTest", "interfaces":...
{ "body": "@Test\n\tpublic void testToHalfWidth() {\n\t\tString str;\n\t\tstr = \"http://news.bbc.co.uk/1/hi/programmes/panorama/live_forums/2124808.stm\";\n\t\tstr = tc.toHalfWidth(str);\n\t\tSystem.out.println(str);\n\t}", "class_method_signature": "ChineseTransTest.testToHalfWidth()", "constructor": false, "...
{ "fields": [ { "declarator": "s2l = null", "modifier": "", "original_string": "TCharCharHashMap s2l = null;", "type": "TCharCharHashMap", "var_name": "s2l" }, { "declarator": "l2s = null", "modifier": "", "original_string": "TCharCharHashMap l2s = null;", ...
{ "body": "public static String toHalfWidth(String input) {\n\n\t\tchar[] c = input.toCharArray();\n\t\tfor (int i = 0; i< c.length; i++) {\n\t\t\tif (c[i] == 12288) {\n\t\t\t\tc[i] = (char) 32;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (c[i]> 65280&& c[i]< 65375)\n\t\t\t\tc[i] = (char) (c[i] - 65248);\n\t\t}\n\t\treturn...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_17
{ "fields": [ { "declarator": "factory", "modifier": "", "original_string": "CNFactory factory;", "type": "CNFactory", "var_name": "factory" }, { "declarator": "tk", "modifier": "", "original_string": "TreeKernel tk;", "type": "TreeKernel", "var_...
{ "body": "@Test\n\tpublic void testCalc() throws Exception {\n\t\tVector<String[]> s = new Vector<String[]>();\n\t\ts.add(new String[]{\"听歌\",\"唱歌\"});\n\t\ts.add(new String[]{\"听歌\",\"听个歌\"});\n\t\ts.add(new String[]{\"听下面的歌\",\"听周杰伦的歌\"});\n\t\ts.add(new String[]{\"听吴世宇的歌\",\"听周杰伦的歌\"});\n\t\ts.add(new String[]{\"...
{ "fields": [ { "declarator": "serialVersionUID = 6749406907457182885L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 6749406907457182885L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "facto...
{ "body": "@Override\n\tpublic float calc(DependencyTree item1, DependencyTree item2){\n\t\tfloat score = getDepScore(item1, item2, 1);\n//\t\tfloat base = getBase(item1) * getBase(item2);\n\t\tfloat base = item1.size()*item2.size();\n\t\tbase = (float) Math.sqrt(base);\n\t\treturn (score / base);\n\t}", "class_met...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_1
{ "fields": [ { "declarator": "expr=new CNExpression()", "modifier": "", "original_string": "CNExpression expr=new CNExpression();", "type": "CNExpression", "var_name": "expr" } ], "file": "fnlp-app/src/test/java/org/fnlp/app/num/CNExpressionTest.java", "identifier": "CNExp...
{ "body": "@Test\n\tpublic void testNum2Chn() {\n\t}", "class_method_signature": "CNExpressionTest.testNum2Chn()", "constructor": false, "full_signature": "@Test public void testNum2Chn()", "identifier": "testNum2Chn", "invocations": [], "modifiers": "@Test public", "parameters": "()", "return": "void...
{ "fields": [ { "declarator": "strDigit=new String(\"一幺二两三叁四肆五伍六七八九零\");", "modifier": "private static", "original_string": "private static String strDigit=new String(\"一幺二两三叁四肆五伍六七八九零\");", "type": "String", "var_name": "strDigit" }, { "declarator": "strDigitOut=new St...
{ "body": "public String num2Chn(int num){\n\t\tchar s[]=new char[32],ch;\n\t\tint counter1,counter2;\n\t\tint chr,preChr=-1;\n\t\tint len=0;\n\t\tboolean suffixZero=true;\n\t\tcounter1=0;\n\t\tcounter2=0;\n\t\twhile(num>0){\n\t\t\tchr=num%10;\n\t\t\tif(chr!=0){\n\t\t\t\tsuffixZero=false;\n\t\t\t\tif(counter1>0){\n\t...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_10
{ "fields": [], "file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/CharsTest.java", "identifier": "CharsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIsPunc() {\n\t\tString input = \"ss\";\n\t\tboolean s = Chars.isPunc(input);\n\t\tSystem.out.println(s);\n\t}", "class_method_signature": "CharsTest.testIsPunc()", "constructor": false, "full_signature": "@Test public void testIsPunc()", "identifier": "testIsPunc", "invoc...
{ "fields": [ { "declarator": "PattLDP = Pattern.compile(\"(\\\\w|\\\\pP|\\\\pS|\\\\s)+\")", "modifier": "static", "original_string": "static Pattern PattLDP = Pattern.compile(\"(\\\\w|\\\\pP|\\\\pS|\\\\s)+\");", "type": "Pattern", "var_name": "PattLDP" }, { "declarator...
{ "body": "public static boolean isPunc(String str) {\n\n\t\t\treturn PattP.matcher(str).matches(); \n\t\t\t//TODO:可以修改为Java7中的isLetterOrDigit\n\t}", "class_method_signature": "Chars.isPunc(String str)", "constructor": false, "full_signature": "public static boolean isPunc(String str)", "identifier": "isPunc...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_11
{ "fields": [], "file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/CharsTest.java", "identifier": "CharsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIsLetterOrDigitOrPuncString() {\n\t\tString input = \"VV( [^ ]+){0,1} 。( [^ ]+){0,1} 。( [^ ]+){0,1} 。 \";\n//\t\tinput = MyString.normalizeRE(input);\n\t\tboolean s = Chars.isLetterOrDigitOrPunc(input);\n\t\tSystem.out.println(s);\n\t}", "class_method_signature": "CharsTest.testI...
{ "fields": [ { "declarator": "PattLDP = Pattern.compile(\"(\\\\w|\\\\pP|\\\\pS|\\\\s)+\")", "modifier": "static", "original_string": "static Pattern PattLDP = Pattern.compile(\"(\\\\w|\\\\pP|\\\\pS|\\\\s)+\");", "type": "Pattern", "var_name": "PattLDP" }, { "declarator...
{ "body": "public static boolean isLetterOrDigitOrPunc(char ch) {\n\t\tint i = Character.getType(ch);\n\t\treturn Character.isLowerCase(ch) || Character.isUpperCase(ch)\n\t\t || Character.isDigit(ch)\n\t\t\t\t|| (i>=20&&i<=30); \n\t\t//TODO:可以修改为Java7中的isLetterOrDigit\n\t\t\n\t\t\n\t}", "class_method_signature": "C...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_0
{ "fields": [ { "declarator": "expr=new CNExpression()", "modifier": "", "original_string": "CNExpression expr=new CNExpression();", "type": "CNExpression", "var_name": "expr" } ], "file": "fnlp-app/src/test/java/org/fnlp/app/num/CNExpressionTest.java", "identifier": "CNExp...
{ "body": "@Test\n\tpublic void testCalculate() {\n\t}", "class_method_signature": "CNExpressionTest.testCalculate()", "constructor": false, "full_signature": "@Test public void testCalculate()", "identifier": "testCalculate", "invocations": [], "modifiers": "@Test public", "parameters": "()", "return...
{ "fields": [ { "declarator": "strDigit=new String(\"一幺二两三叁四肆五伍六七八九零\");", "modifier": "private static", "original_string": "private static String strDigit=new String(\"一幺二两三叁四肆五伍六七八九零\");", "type": "String", "var_name": "strDigit" }, { "declarator": "strDigitOut=new St...
{ "body": "public int calculate(){\n\t\tif(op<0|num1<0|num2<0)\n\t\t\treturn -1;\n\t\tswitch(op){\n\t\t\tcase 0:\n\t\t\t\tans=num1+num2;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tans=num1-num2;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tans=num1*num2;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tans=num1/num2;\n\t\t\t\tbreak;\...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_3
{ "fields": [ { "declarator": "tc", "modifier": "private", "original_string": "private ChineseTrans tc;", "type": "ChineseTrans", "var_name": "tc" } ], "file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/ChineseTransTest.java", "identifier": "ChineseTransTest", "interfaces":...
{ "body": "@Test\n\tpublic void testNormalise() {\n\t\tString str;\n\t\tstr = \"。\";\n\t\tstr = tc.normalizeCAP(str, true);\n\t\tSystem.out.println(str);\n\t\tSystem.out.println(str.equals(\"。\"));\n\t}", "class_method_signature": "ChineseTransTest.testNormalise()", "constructor": false, "full_signature": "@Tes...
{ "fields": [ { "declarator": "s2l = null", "modifier": "", "original_string": "TCharCharHashMap s2l = null;", "type": "TCharCharHashMap", "var_name": "s2l" }, { "declarator": "l2s = null", "modifier": "", "original_string": "TCharCharHashMap l2s = null;", ...
{ "body": "private void normalise(char[] c) {\n\t\tfor (int i = 0; i< c.length; i++) {\n\t\t\tif (c[i] == 12288) {\n\t\t\t\tc[i] = (char) 32;\n\t\t\t\tcontinue;\n\t\t\t}else if (c[i]> 65280&& c[i]< 65375){\n\t\t\t\tc[i] = (char) (c[i] - 65248);\t\t\t\n\t\t\t}\n\t\t\telse if(c[i] > 64 && c[i] < 91){\n\t\t\t\tc[i] += 3...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_12
{ "fields": [], "file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/CharsTest.java", "identifier": "CharsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIsWhitespace() {\n\t\tString input = \"  \\t\\n1\\r\";\n\t\tfor(int i=0;i<input.length();i++){\n\t\t\tchar c = input.charAt(i);\n\t\t\tboolean b = Character.isWhitespace(c);\n\t\t\tSystem.out.println(c+String.valueOf(b));\n\t\t}\n\t\t\n\t}", "class_method_signature": "CharsTest.t...
{ "fields": [ { "declarator": "PattLDP = Pattern.compile(\"(\\\\w|\\\\pP|\\\\pS|\\\\s)+\")", "modifier": "static", "original_string": "static Pattern PattLDP = Pattern.compile(\"(\\\\w|\\\\pP|\\\\pS|\\\\s)+\");", "type": "Pattern", "var_name": "PattLDP" }, { "declarator...
{ "body": "public static boolean isWhiteSpace(String w) {\n\t\tfor(int i=0;i<w.length();i++){\n\t\t\tchar c = w.charAt(i);\n\t\t\tif(!Character.isWhitespace(c)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "class_method_signature": "Chars.isWhiteSpace(String w)", "constructor": false, "full_...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_13
{ "fields": [], "file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/CharsTest.java", "identifier": "CharsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetType() {\n\t\t\n\t}", "class_method_signature": "CharsTest.testGetType()", "constructor": false, "full_signature": "@Test public void testGetType()", "identifier": "testGetType", "invocations": [], "modifiers": "@Test public", "parameters": "()", "return": "void"...
{ "fields": [ { "declarator": "PattLDP = Pattern.compile(\"(\\\\w|\\\\pP|\\\\pS|\\\\s)+\")", "modifier": "static", "original_string": "static Pattern PattLDP = Pattern.compile(\"(\\\\w|\\\\pP|\\\\pS|\\\\s)+\");", "type": "Pattern", "var_name": "PattLDP" }, { "declarator...
{ "body": "public static CharType[] getType(String str) {\n\t\tCharType[] tag = new CharType[str.length()];\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tchar c = str.charAt(i);\n\t\t\ttag[i] = getType(c);\n\t\t}\n\t\treturn tag;\n\t}", "class_method_signature": "Chars.getType(String str)", "constructor": ...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_2
{ "fields": [ { "declarator": "tc", "modifier": "private", "original_string": "private ChineseTrans tc;", "type": "ChineseTrans", "var_name": "tc" } ], "file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/ChineseTransTest.java", "identifier": "ChineseTransTest", "interfaces":...
{ "body": "@Test\n\tpublic void testToTrad() {\n\t\tString str;\n\t\tstr = \"ddd\";\n\t\tstr = tc.toTrad(str);\n\t\tstr = tc.toTrad(str);\t\t\n\t\tstr = tc.toTrad(str);\t\t\n\t\tstr = tc.toTrad(str);\t\t\n\t\tSystem.out.println(str);\n\t}", "class_method_signature": "ChineseTransTest.testToTrad()", "constructor":...
{ "fields": [ { "declarator": "s2l = null", "modifier": "", "original_string": "TCharCharHashMap s2l = null;", "type": "TCharCharHashMap", "var_name": "s2l" }, { "declarator": "l2s = null", "modifier": "", "original_string": "TCharCharHashMap l2s = null;", ...
{ "body": "public String toTrad(String str) { \n\t\tchar[] c = str.toCharArray();\n\t\tfor (int i = 0; i < str.length(); i++) { \n\t\t\tchar cc = s2l.get(c[i]);\n\t\t\tif (cc != 0) { \n\t\t\t\tc[i] = cc; \n\t\t\t} \n\t\t} \n\t\treturn new String(c); \n\t}", "class_method_signature": "ChineseTrans.toTrad...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_14
{ "fields": [], "file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/SentenizerTest.java", "identifier": "SentenizerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testSplit() {\n\t\tString sent = \" 回顾王适娴职业生涯成长历程,2008年只参加了两站国内进行的公开赛?呵呵\";\n\t\tString[] subsents = Sentenizer.split(sent);\n\t\tSystem.out.println(MyStrings.toString(subsents,\"\\n\"));\n\t}", "class_method_signature": "SentenizerTest.testSplit()", "constructor": false, "full_...
{ "fields": [ { "declarator": "puncs = new char[] { '。', '?', '!',';' };", "modifier": "private static", "original_string": "private static char[] puncs = new char[] { '。', '?', '!',';' };", "type": "char[]", "var_name": "puncs" } ], "file": "fnlp-core/src/main/java/org/fnlp/...
{ "body": "public static String[] split(String sent) {\n\t\tList<Integer> plist = new ArrayList<Integer>();\n\t\tint p = 0;\n\t\tfor (int i = 0; i < puncs.length; i++) {\n\t\t\tp = sent.indexOf(puncs[i]);\n\t\t\twhile (p != -1) {\n\t\t\t\tplist.add(p);\n\t\t\t\tp = sent.indexOf(puncs[i], p + 1);\n\t\t\t}\n\t\t}\n\t\t...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_9
{ "fields": [], "file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/CharsTest.java", "identifier": "CharsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIsLetterOrDigitOrPunc() {\n\t\tchar input = '我';\n\t\tboolean s = Chars.isLetterOrDigitOrPunc(input);\n\t\tSystem.out.println(s);\n\t\tinput = '9';\n\t\ts = Chars.isLetterOrDigitOrPunc(input);\n\t\tSystem.out.println(s);\n\t\tinput = ':';\n\t\ts = Chars.isLetterOrDigitOrPunc(input)...
{ "fields": [ { "declarator": "PattLDP = Pattern.compile(\"(\\\\w|\\\\pP|\\\\pS|\\\\s)+\")", "modifier": "static", "original_string": "static Pattern PattLDP = Pattern.compile(\"(\\\\w|\\\\pP|\\\\pS|\\\\s)+\");", "type": "Pattern", "var_name": "PattLDP" }, { "declarator...
{ "body": "public static boolean isLetterOrDigitOrPunc(char ch) {\n\t\tint i = Character.getType(ch);\n\t\treturn Character.isLowerCase(ch) || Character.isUpperCase(ch)\n\t\t || Character.isDigit(ch)\n\t\t\t\t|| (i>=20&&i<=30); \n\t\t//TODO:可以修改为Java7中的isLetterOrDigit\n\t\t\n\t\t\n\t}", "class_method_signature": "C...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_18
{ "fields": [], "file": "fnlp-core/src/test/java/org/fnlp/nlp/corpus/fnlp/FNLPCorpusTest.java", "identifier": "FNLPCorpusTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testReadCWS() throws IOException {\n\t\tFNLPCorpus corpus = new FNLPCorpus();\n\t\tcorpus.readCWS(\"../example-data/seg-bad-case.txt\",\".txt\",\"UTF8\");\t\t\n\t\tcorpus.writeOne(\"../tmp/seg.dat\");\n//\t\tcorpus.count(\"./tmp\", true);\n\t\tSystem.out.println(\"Done!\");\n\t}", "c...
{ "fields": [ { "declarator": "docs = new LinkedList<FNLPDoc>()", "modifier": "public", "original_string": "public LinkedList<FNLPDoc> docs = new LinkedList<FNLPDoc>();", "type": "LinkedList<FNLPDoc>", "var_name": "docs" } ], "file": "fnlp-core/src/main/java/org/fnlp/nlp/co...
{ "body": "public void readCWS(String path, String suffix, String charset) throws IOException {\n\t\tList<File> files = MyFiles.getAllFiles(path, suffix);//\".txt\"\n\t\t\n\t\tIterator<File> it = files.iterator();\n\t\twhile(it.hasNext()){\n\t\t\tBufferedReader bfr =null;\n\t\t\tFile file = it.next();\n\t\t\ttry {\n\...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }
17651735_5
{ "fields": [ { "declarator": "tc", "modifier": "private", "original_string": "private ChineseTrans tc;", "type": "ChineseTrans", "var_name": "tc" } ], "file": "fnlp-core/src/test/java/org/fnlp/nlp/cn/ChineseTransTest.java", "identifier": "ChineseTransTest", "interfaces":...
{ "body": "@Test\n\tpublic void testNormalize() {\n\t\tString str;\n\n\t\tstr = \"挺【】遠徳什麽愛訊http://news.bbc.co.uk/1/hi/programmes/panorama/live_forums/2124808.stm\";\n\t\tstr = tc.normalize(str);\n\t\tSystem.out.println(str);\n\t}", "class_method_signature": "ChineseTransTest.testNormalize()", "constructor": false...
{ "fields": [ { "declarator": "s2l = null", "modifier": "", "original_string": "TCharCharHashMap s2l = null;", "type": "TCharCharHashMap", "var_name": "s2l" }, { "declarator": "l2s = null", "modifier": "", "original_string": "TCharCharHashMap l2s = null;", ...
{ "body": "public String normalize(String input) {\n\t\tchar[] c = input.toCharArray();\n\t\tnormalise(c);\n\t\treturn new String(c);\n\t}", "class_method_signature": "ChineseTrans.normalize(String input)", "constructor": false, "full_signature": "public String normalize(String input)", "identifier": "normali...
{ "created": null, "fork": null, "fork_count": 716, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 17651735, "size": 2754, "stargazer_count": 2336, "stars": null, "updates": null, "url": "https://github.com/FudanNLP/fnlp" }