Skip to content

Instantly share code, notes, and snippets.

@emsi
Last active April 26, 2022 13:54
Show Gist options
  • Save emsi/ba2402544bbd0a23692e23a92ba90a29 to your computer and use it in GitHub Desktop.
Save emsi/ba2402544bbd0a23692e23a92ba90a29 to your computer and use it in GitHub Desktop.
import io
import pandas as pd
df_txt=',source,rule.id\n458093,"\tpublic static void main(String[] args) {\n\t\tlong t = System.currentTimeMillis();\n\t\ttry {\n\t\t\n\t\t\tlogger.info(""distributed transaction manager init....."");\n\t\t\tSystem.setProperty(""dubbo.application.logger"", ""slf4j"");\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//\udcc0\udcad\udcc6\udcf0spring\udcb7\udcfe\udcce\udcf1\udcd6\udcf7\udcc5\udce4\udcd6\udcc3\udcceļ\udcfe\udcba\udccddb-service module\udcd6е\udcc4\udcd2\udcd4spring-\udcbf\udcaaͷ\udcb5\udcc4mybatis\udcc5\udce4\udcd6\udcc3\udcceļ\udcfe:spring-dbservice-mybatis.xml\n\t\t\tfinal ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\n\t\t\t\t\t""classpath*:distributed-transaction-service.xml"");\n\t\t\t\n\t\t\t\n\t\t\tlogger.info(""user.dir: "" + System.getProperty(""user.dir""));\n\t\t\t\n\t\t\tif (""true"".equals(System.getProperty(SHUTDOWN_HOOK_KEY))) {\n\t\t\t\tRuntime.getRuntime().addShutdownHook(new Thread() {\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcontext.stop();\n\t\t\t\t\t\t\tlogger.warn(""server stopped!!!"");\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tlogger.error(e.getMessage(), e);\n\t\t\t\t\t\t} catch (Throwable t) {\n\t\t\t\t\t\t\tlogger.error(t.getMessage());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsynchronized (TransactionServiceLauncher.class) {\n\t\t\t\t\t\t\trunning = false;\n\t\t\t\t\t\t\tTransactionServiceLauncher.class.notify();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t//\udcc0\udcad\udcc6\udcf0\udcb7\udcfe\udcce\udcf1\n\t\t\tcontext.start();\n\t\t\tlogger.info(""distributed transaction manager Started! take "" + (System.currentTimeMillis() - t) + "" ms"");\n\t\t} catch (RuntimeException e) {\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tsynchronized (TransactionServiceLauncher.class) {\n\t\t\twhile (running) {\n\t\t\t\ttry {\n\t\t\t\t\tTransactionServiceLauncher.class.wait();\n\t\t\t\t} catch (Throwable e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n",NAMING.UUVN\n458094,"\tpublic static void main(String[] args) {\n\t\tlong t = System.currentTimeMillis();\n\t\ttry {\n\t\t\n\t\t\tlogger.info(""distributed transaction manager init....."");\n\t\t\tSystem.setProperty(""dubbo.application.logger"", ""slf4j"");\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//\udcc0\udcad\udcc6\udcf0spring\udcb7\udcfe\udcce\udcf1\udcd6\udcf7\udcc5\udce4\udcd6\udcc3\udcceļ\udcfe\udcba\udccddb-service module\udcd6е\udcc4\udcd2\udcd4spring-\udcbf\udcaaͷ\udcb5\udcc4mybatis\udcc5\udce4\udcd6\udcc3\udcceļ\udcfe:spring-dbservice-mybatis.xml\n\t\t\tfinal ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\n\t\t\t\t\t""classpath*:distributed-transaction-service.xml"");\n\t\t\t\n\t\t\t\n\t\t\tlogger.info(""user.dir: "" + System.getProperty(""user.dir""));\n\t\t\t\n\t\t\tif (""true"".equals(System.getProperty(SHUTDOWN_HOOK_KEY))) {\n\t\t\t\tRuntime.getRuntime().addShutdownHook(new Thread() {\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcontext.stop();\n\t\t\t\t\t\t\tlogger.warn(""server stopped!!!"");\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tlogger.error(e.getMessage(), e);\n\t\t\t\t\t\t} catch (Throwable t) {\n\t\t\t\t\t\t\tlogger.error(t.getMessage());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsynchronized (TransactionServiceLauncher.class) {\n\t\t\t\t\t\t\trunning = false;\n\t\t\t\t\t\t\tTransactionServiceLauncher.class.notify();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t//\udcc0\udcad\udcc6\udcf0\udcb7\udcfe\udcce\udcf1\n\t\t\tcontext.start();\n\t\t\tlogger.info(""distributed transaction manager Started! take "" + (System.currentTimeMillis() - t) + "" ms"");\n\t\t} catch (RuntimeException e) {\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tsynchronized (TransactionServiceLauncher.class) {\n\t\t\twhile (running) {\n\t\t\t\ttry {\n\t\t\t\t\tTransactionServiceLauncher.class.wait();\n\t\t\t\t} catch (Throwable e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n",TRS.NSYN\n458131,"\tpublic static void main(String[] args) {\n\t\tlong t = System.currentTimeMillis();\n\t\ttry {\n\t\t\n\t\t\tlogger.info(""DubboWithDistributedTransactionAgentService1Launcher init....."");\n\t\t\tSystem.setProperty(""dubbo.application.logger"", ""slf4j"");\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//\udcc0\udcad\udcc6\udcf0spring\udcb7\udcfe\udcce\udcf1\udcd6\udcf7\udcc5\udce4\udcd6\udcc3\udcceļ\udcfe\udcba\udccddb-service module\udcd6е\udcc4\udcd2\udcd4spring-\udcbf\udcaaͷ\udcb5\udcc4mybatis\udcc5\udce4\udcd6\udcc3\udcceļ\udcfe:spring-dbservice-mybatis.xml\n\t\t\tfinal ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\n\t\t\t\t\t""classpath*:test-dubbo-service1.xml"");\n\t\t\t\n\t\t\t\n\t\t\tlogger.info(""user.dir: "" + System.getProperty(""user.dir""));\n\t\t\t\n\t\t\tif (""true"".equals(System.getProperty(SHUTDOWN_HOOK_KEY))) {\n\t\t\t\tRuntime.getRuntime().addShutdownHook(new Thread() {\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcontext.stop();\n\t\t\t\t\t\t\tlogger.warn(""server stopped!!!"");\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tlogger.error(e.getMessage(), e);\n\t\t\t\t\t\t} catch (Throwable t) {\n\t\t\t\t\t\t\tlogger.error(t.getMessage());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsynchronized (TestService1Launcher.class) {\n\t\t\t\t\t\t\trunning = false;\n\t\t\t\t\t\t\tTestService1Launcher.class.notify();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t//\udcc0\udcad\udcc6\udcf0\udcb7\udcfe\udcce\udcf1\n\t\t\tcontext.start();\n\t\t\tlogger.info(""DubboWithDistributedTransactionAgentService1Launcher Started! take "" + (System.currentTimeMillis() - t) + "" ms"");\n\t\t} catch (RuntimeException e) {\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tsynchronized (TestService1Launcher.class) {\n\t\t\twhile (running) {\n\t\t\t\ttry {\n\t\t\t\t\tTestService1Launcher.class.wait();\n\t\t\t\t} catch (Throwable e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n",NAMING.UUVN\n458132,"\tpublic static void main(String[] args) {\n\t\tlong t = System.currentTimeMillis();\n\t\ttry {\n\t\t\n\t\t\tlogger.info(""DubboWithDistributedTransactionAgentService1Launcher init....."");\n\t\t\tSystem.setProperty(""dubbo.application.logger"", ""slf4j"");\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//\udcc0\udcad\udcc6\udcf0spring\udcb7\udcfe\udcce\udcf1\udcd6\udcf7\udcc5\udce4\udcd6\udcc3\udcceļ\udcfe\udcba\udccddb-service module\udcd6е\udcc4\udcd2\udcd4spring-\udcbf\udcaaͷ\udcb5\udcc4mybatis\udcc5\udce4\udcd6\udcc3\udcceļ\udcfe:spring-dbservice-mybatis.xml\n\t\t\tfinal ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\n\t\t\t\t\t""classpath*:test-dubbo-service1.xml"");\n\t\t\t\n\t\t\t\n\t\t\tlogger.info(""user.dir: "" + System.getProperty(""user.dir""));\n\t\t\t\n\t\t\tif (""true"".equals(System.getProperty(SHUTDOWN_HOOK_KEY))) {\n\t\t\t\tRuntime.getRuntime().addShutdownHook(new Thread() {\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcontext.stop();\n\t\t\t\t\t\t\tlogger.warn(""server stopped!!!"");\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tlogger.error(e.getMessage(), e);\n\t\t\t\t\t\t} catch (Throwable t) {\n\t\t\t\t\t\t\tlogger.error(t.getMessage());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsynchronized (TestService1Launcher.class) {\n\t\t\t\t\t\t\trunning = false;\n\t\t\t\t\t\t\tTestService1Launcher.class.notify();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t//\udcc0\udcad\udcc6\udcf0\udcb7\udcfe\udcce\udcf1\n\t\t\tcontext.start();\n\t\t\tlogger.info(""DubboWithDistributedTransactionAgentService1Launcher Started! take "" + (System.currentTimeMillis() - t) + "" ms"");\n\t\t} catch (RuntimeException e) {\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tsynchronized (TestService1Launcher.class) {\n\t\t\twhile (running) {\n\t\t\t\ttry {\n\t\t\t\t\tTestService1Launcher.class.wait();\n\t\t\t\t} catch (Throwable e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n",TRS.NSYN\n'
df = pd.read_csv(io.StringIO(df_txt), encoding_errors="surrogateescape", index_col=0)
print(pd.Series([len(df[df.duplicated(subset=["source", "rule.id"], keep=False)]) for _ in range(100000)]).describe())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment