avg.ktr 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <transformation>
  3. <info>
  4. <name>avg</name>
  5. <description/>
  6. <extended_description/>
  7. <trans_version/>
  8. <trans_type>Normal</trans_type>
  9. <trans_status>0</trans_status>
  10. <directory>/</directory>
  11. <parameters>
  12. <parameter>
  13. <name>input_db_ip</name>
  14. <default_value>172.17.0.1</default_value>
  15. <description/>
  16. </parameter>
  17. <parameter>
  18. <name>input_db_port</name>
  19. <default_value>27017</default_value>
  20. <description/>
  21. </parameter>
  22. <parameter>
  23. <name>out_db_ip</name>
  24. <default_value>172.17.0.1</default_value>
  25. <description/>
  26. </parameter>
  27. <parameter>
  28. <name>out_db_name</name>
  29. <default_value>ry</default_value>
  30. <description/>
  31. </parameter>
  32. <parameter>
  33. <name>out_db_port</name>
  34. <default_value>3306</default_value>
  35. <description/>
  36. </parameter>
  37. <parameter>
  38. <name>out_db_pwd</name>
  39. <default_value>sckjadmin</default_value>
  40. <description/>
  41. </parameter>
  42. <parameter>
  43. <name>out_db_username</name>
  44. <default_value>root</default_value>
  45. <description/>
  46. </parameter>
  47. </parameters>
  48. <log>
  49. <trans-log-table>
  50. <connection/>
  51. <schema/>
  52. <table/>
  53. <size_limit_lines/>
  54. <interval/>
  55. <timeout_days/>
  56. <field>
  57. <id>ID_BATCH</id>
  58. <enabled>Y</enabled>
  59. <name>ID_BATCH</name>
  60. </field>
  61. <field>
  62. <id>CHANNEL_ID</id>
  63. <enabled>Y</enabled>
  64. <name>CHANNEL_ID</name>
  65. </field>
  66. <field>
  67. <id>TRANSNAME</id>
  68. <enabled>Y</enabled>
  69. <name>TRANSNAME</name>
  70. </field>
  71. <field>
  72. <id>STATUS</id>
  73. <enabled>Y</enabled>
  74. <name>STATUS</name>
  75. </field>
  76. <field>
  77. <id>LINES_READ</id>
  78. <enabled>Y</enabled>
  79. <name>LINES_READ</name>
  80. <subject/>
  81. </field>
  82. <field>
  83. <id>LINES_WRITTEN</id>
  84. <enabled>Y</enabled>
  85. <name>LINES_WRITTEN</name>
  86. <subject/>
  87. </field>
  88. <field>
  89. <id>LINES_UPDATED</id>
  90. <enabled>Y</enabled>
  91. <name>LINES_UPDATED</name>
  92. <subject/>
  93. </field>
  94. <field>
  95. <id>LINES_INPUT</id>
  96. <enabled>Y</enabled>
  97. <name>LINES_INPUT</name>
  98. <subject/>
  99. </field>
  100. <field>
  101. <id>LINES_OUTPUT</id>
  102. <enabled>Y</enabled>
  103. <name>LINES_OUTPUT</name>
  104. <subject/>
  105. </field>
  106. <field>
  107. <id>LINES_REJECTED</id>
  108. <enabled>Y</enabled>
  109. <name>LINES_REJECTED</name>
  110. <subject/>
  111. </field>
  112. <field>
  113. <id>ERRORS</id>
  114. <enabled>Y</enabled>
  115. <name>ERRORS</name>
  116. </field>
  117. <field>
  118. <id>STARTDATE</id>
  119. <enabled>Y</enabled>
  120. <name>STARTDATE</name>
  121. </field>
  122. <field>
  123. <id>ENDDATE</id>
  124. <enabled>Y</enabled>
  125. <name>ENDDATE</name>
  126. </field>
  127. <field>
  128. <id>LOGDATE</id>
  129. <enabled>Y</enabled>
  130. <name>LOGDATE</name>
  131. </field>
  132. <field>
  133. <id>DEPDATE</id>
  134. <enabled>Y</enabled>
  135. <name>DEPDATE</name>
  136. </field>
  137. <field>
  138. <id>REPLAYDATE</id>
  139. <enabled>Y</enabled>
  140. <name>REPLAYDATE</name>
  141. </field>
  142. <field>
  143. <id>LOG_FIELD</id>
  144. <enabled>Y</enabled>
  145. <name>LOG_FIELD</name>
  146. </field>
  147. <field>
  148. <id>EXECUTING_SERVER</id>
  149. <enabled>N</enabled>
  150. <name>EXECUTING_SERVER</name>
  151. </field>
  152. <field>
  153. <id>EXECUTING_USER</id>
  154. <enabled>N</enabled>
  155. <name>EXECUTING_USER</name>
  156. </field>
  157. <field>
  158. <id>CLIENT</id>
  159. <enabled>N</enabled>
  160. <name>CLIENT</name>
  161. </field>
  162. </trans-log-table>
  163. <perf-log-table>
  164. <connection/>
  165. <schema/>
  166. <table/>
  167. <interval/>
  168. <timeout_days/>
  169. <field>
  170. <id>ID_BATCH</id>
  171. <enabled>Y</enabled>
  172. <name>ID_BATCH</name>
  173. </field>
  174. <field>
  175. <id>SEQ_NR</id>
  176. <enabled>Y</enabled>
  177. <name>SEQ_NR</name>
  178. </field>
  179. <field>
  180. <id>LOGDATE</id>
  181. <enabled>Y</enabled>
  182. <name>LOGDATE</name>
  183. </field>
  184. <field>
  185. <id>TRANSNAME</id>
  186. <enabled>Y</enabled>
  187. <name>TRANSNAME</name>
  188. </field>
  189. <field>
  190. <id>STEPNAME</id>
  191. <enabled>Y</enabled>
  192. <name>STEPNAME</name>
  193. </field>
  194. <field>
  195. <id>STEP_COPY</id>
  196. <enabled>Y</enabled>
  197. <name>STEP_COPY</name>
  198. </field>
  199. <field>
  200. <id>LINES_READ</id>
  201. <enabled>Y</enabled>
  202. <name>LINES_READ</name>
  203. </field>
  204. <field>
  205. <id>LINES_WRITTEN</id>
  206. <enabled>Y</enabled>
  207. <name>LINES_WRITTEN</name>
  208. </field>
  209. <field>
  210. <id>LINES_UPDATED</id>
  211. <enabled>Y</enabled>
  212. <name>LINES_UPDATED</name>
  213. </field>
  214. <field>
  215. <id>LINES_INPUT</id>
  216. <enabled>Y</enabled>
  217. <name>LINES_INPUT</name>
  218. </field>
  219. <field>
  220. <id>LINES_OUTPUT</id>
  221. <enabled>Y</enabled>
  222. <name>LINES_OUTPUT</name>
  223. </field>
  224. <field>
  225. <id>LINES_REJECTED</id>
  226. <enabled>Y</enabled>
  227. <name>LINES_REJECTED</name>
  228. </field>
  229. <field>
  230. <id>ERRORS</id>
  231. <enabled>Y</enabled>
  232. <name>ERRORS</name>
  233. </field>
  234. <field>
  235. <id>INPUT_BUFFER_ROWS</id>
  236. <enabled>Y</enabled>
  237. <name>INPUT_BUFFER_ROWS</name>
  238. </field>
  239. <field>
  240. <id>OUTPUT_BUFFER_ROWS</id>
  241. <enabled>Y</enabled>
  242. <name>OUTPUT_BUFFER_ROWS</name>
  243. </field>
  244. </perf-log-table>
  245. <channel-log-table>
  246. <connection/>
  247. <schema/>
  248. <table/>
  249. <timeout_days/>
  250. <field>
  251. <id>ID_BATCH</id>
  252. <enabled>Y</enabled>
  253. <name>ID_BATCH</name>
  254. </field>
  255. <field>
  256. <id>CHANNEL_ID</id>
  257. <enabled>Y</enabled>
  258. <name>CHANNEL_ID</name>
  259. </field>
  260. <field>
  261. <id>LOG_DATE</id>
  262. <enabled>Y</enabled>
  263. <name>LOG_DATE</name>
  264. </field>
  265. <field>
  266. <id>LOGGING_OBJECT_TYPE</id>
  267. <enabled>Y</enabled>
  268. <name>LOGGING_OBJECT_TYPE</name>
  269. </field>
  270. <field>
  271. <id>OBJECT_NAME</id>
  272. <enabled>Y</enabled>
  273. <name>OBJECT_NAME</name>
  274. </field>
  275. <field>
  276. <id>OBJECT_COPY</id>
  277. <enabled>Y</enabled>
  278. <name>OBJECT_COPY</name>
  279. </field>
  280. <field>
  281. <id>REPOSITORY_DIRECTORY</id>
  282. <enabled>Y</enabled>
  283. <name>REPOSITORY_DIRECTORY</name>
  284. </field>
  285. <field>
  286. <id>FILENAME</id>
  287. <enabled>Y</enabled>
  288. <name>FILENAME</name>
  289. </field>
  290. <field>
  291. <id>OBJECT_ID</id>
  292. <enabled>Y</enabled>
  293. <name>OBJECT_ID</name>
  294. </field>
  295. <field>
  296. <id>OBJECT_REVISION</id>
  297. <enabled>Y</enabled>
  298. <name>OBJECT_REVISION</name>
  299. </field>
  300. <field>
  301. <id>PARENT_CHANNEL_ID</id>
  302. <enabled>Y</enabled>
  303. <name>PARENT_CHANNEL_ID</name>
  304. </field>
  305. <field>
  306. <id>ROOT_CHANNEL_ID</id>
  307. <enabled>Y</enabled>
  308. <name>ROOT_CHANNEL_ID</name>
  309. </field>
  310. </channel-log-table>
  311. <step-log-table>
  312. <connection/>
  313. <schema/>
  314. <table/>
  315. <timeout_days/>
  316. <field>
  317. <id>ID_BATCH</id>
  318. <enabled>Y</enabled>
  319. <name>ID_BATCH</name>
  320. </field>
  321. <field>
  322. <id>CHANNEL_ID</id>
  323. <enabled>Y</enabled>
  324. <name>CHANNEL_ID</name>
  325. </field>
  326. <field>
  327. <id>LOG_DATE</id>
  328. <enabled>Y</enabled>
  329. <name>LOG_DATE</name>
  330. </field>
  331. <field>
  332. <id>TRANSNAME</id>
  333. <enabled>Y</enabled>
  334. <name>TRANSNAME</name>
  335. </field>
  336. <field>
  337. <id>STEPNAME</id>
  338. <enabled>Y</enabled>
  339. <name>STEPNAME</name>
  340. </field>
  341. <field>
  342. <id>STEP_COPY</id>
  343. <enabled>Y</enabled>
  344. <name>STEP_COPY</name>
  345. </field>
  346. <field>
  347. <id>LINES_READ</id>
  348. <enabled>Y</enabled>
  349. <name>LINES_READ</name>
  350. </field>
  351. <field>
  352. <id>LINES_WRITTEN</id>
  353. <enabled>Y</enabled>
  354. <name>LINES_WRITTEN</name>
  355. </field>
  356. <field>
  357. <id>LINES_UPDATED</id>
  358. <enabled>Y</enabled>
  359. <name>LINES_UPDATED</name>
  360. </field>
  361. <field>
  362. <id>LINES_INPUT</id>
  363. <enabled>Y</enabled>
  364. <name>LINES_INPUT</name>
  365. </field>
  366. <field>
  367. <id>LINES_OUTPUT</id>
  368. <enabled>Y</enabled>
  369. <name>LINES_OUTPUT</name>
  370. </field>
  371. <field>
  372. <id>LINES_REJECTED</id>
  373. <enabled>Y</enabled>
  374. <name>LINES_REJECTED</name>
  375. </field>
  376. <field>
  377. <id>ERRORS</id>
  378. <enabled>Y</enabled>
  379. <name>ERRORS</name>
  380. </field>
  381. <field>
  382. <id>LOG_FIELD</id>
  383. <enabled>N</enabled>
  384. <name>LOG_FIELD</name>
  385. </field>
  386. </step-log-table>
  387. <metrics-log-table>
  388. <connection/>
  389. <schema/>
  390. <table/>
  391. <timeout_days/>
  392. <field>
  393. <id>ID_BATCH</id>
  394. <enabled>Y</enabled>
  395. <name>ID_BATCH</name>
  396. </field>
  397. <field>
  398. <id>CHANNEL_ID</id>
  399. <enabled>Y</enabled>
  400. <name>CHANNEL_ID</name>
  401. </field>
  402. <field>
  403. <id>LOG_DATE</id>
  404. <enabled>Y</enabled>
  405. <name>LOG_DATE</name>
  406. </field>
  407. <field>
  408. <id>METRICS_DATE</id>
  409. <enabled>Y</enabled>
  410. <name>METRICS_DATE</name>
  411. </field>
  412. <field>
  413. <id>METRICS_CODE</id>
  414. <enabled>Y</enabled>
  415. <name>METRICS_CODE</name>
  416. </field>
  417. <field>
  418. <id>METRICS_DESCRIPTION</id>
  419. <enabled>Y</enabled>
  420. <name>METRICS_DESCRIPTION</name>
  421. </field>
  422. <field>
  423. <id>METRICS_SUBJECT</id>
  424. <enabled>Y</enabled>
  425. <name>METRICS_SUBJECT</name>
  426. </field>
  427. <field>
  428. <id>METRICS_TYPE</id>
  429. <enabled>Y</enabled>
  430. <name>METRICS_TYPE</name>
  431. </field>
  432. <field>
  433. <id>METRICS_VALUE</id>
  434. <enabled>Y</enabled>
  435. <name>METRICS_VALUE</name>
  436. </field>
  437. </metrics-log-table>
  438. </log>
  439. <maxdate>
  440. <connection/>
  441. <table/>
  442. <field/>
  443. <offset>0.0</offset>
  444. <maxdiff>0.0</maxdiff>
  445. </maxdate>
  446. <size_rowset>1000000</size_rowset>
  447. <sleep_time_empty>50</sleep_time_empty>
  448. <sleep_time_full>50</sleep_time_full>
  449. <unique_connections>N</unique_connections>
  450. <feedback_shown>Y</feedback_shown>
  451. <feedback_size>50000</feedback_size>
  452. <using_thread_priorities>Y</using_thread_priorities>
  453. <shared_objects_file/>
  454. <capture_step_performance>N</capture_step_performance>
  455. <step_performance_capturing_delay>1000</step_performance_capturing_delay>
  456. <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
  457. <dependencies>
  458. </dependencies>
  459. <partitionschemas>
  460. </partitionschemas>
  461. <slaveservers>
  462. </slaveservers>
  463. <clusterschemas>
  464. </clusterschemas>
  465. <created_user>-</created_user>
  466. <created_date>2020/07/21 14:23:07.666</created_date>
  467. <modified_user>-</modified_user>
  468. <modified_date>2020/07/21 14:23:07.666</modified_date>
  469. <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
  470. <is_key_private>N</is_key_private>
  471. </info>
  472. <notepads>
  473. </notepads>
  474. <connection>
  475. <name>avg</name>
  476. <server>${out_db_ip}</server>
  477. <type>MYSQL</type>
  478. <access>Native</access>
  479. <database>${out_db_name}</database>
  480. <port>${out_db_port}</port>
  481. <username>${out_db_username}</username>
  482. <password>${out_db_pwd}</password>
  483. <servername/>
  484. <data_tablespace/>
  485. <index_tablespace/>
  486. <attributes>
  487. <attribute>
  488. <code>EXTRA_OPTION_MYSQL.characterEncoding</code>
  489. <attribute>UTF-8</attribute>
  490. </attribute>
  491. <attribute>
  492. <code>EXTRA_OPTION_MYSQL.defaultFetchSize</code>
  493. <attribute>500</attribute>
  494. </attribute>
  495. <attribute>
  496. <code>EXTRA_OPTION_MYSQL.rewriteBatchedStatements </code>
  497. <attribute>true</attribute>
  498. </attribute>
  499. <attribute>
  500. <code>EXTRA_OPTION_MYSQL.useCompression </code>
  501. <attribute>true</attribute>
  502. </attribute>
  503. <attribute>
  504. <code>EXTRA_OPTION_MYSQL.useCursorFetch</code>
  505. <attribute>true</attribute>
  506. </attribute>
  507. <attribute>
  508. <code>EXTRA_OPTION_MYSQL.useServerPrepStmts </code>
  509. <attribute>false</attribute>
  510. </attribute>
  511. <attribute>
  512. <code>FORCE_IDENTIFIERS_TO_LOWERCASE</code>
  513. <attribute>N</attribute>
  514. </attribute>
  515. <attribute>
  516. <code>FORCE_IDENTIFIERS_TO_UPPERCASE</code>
  517. <attribute>N</attribute>
  518. </attribute>
  519. <attribute>
  520. <code>IS_CLUSTERED</code>
  521. <attribute>N</attribute>
  522. </attribute>
  523. <attribute>
  524. <code>PORT_NUMBER</code>
  525. <attribute>${out_db_port}</attribute>
  526. </attribute>
  527. <attribute>
  528. <code>PRESERVE_RESERVED_WORD_CASE</code>
  529. <attribute>Y</attribute>
  530. </attribute>
  531. <attribute>
  532. <code>QUOTE_ALL_FIELDS</code>
  533. <attribute>N</attribute>
  534. </attribute>
  535. <attribute>
  536. <code>STREAM_RESULTS</code>
  537. <attribute>Y</attribute>
  538. </attribute>
  539. <attribute>
  540. <code>SUPPORTS_BOOLEAN_DATA_TYPE</code>
  541. <attribute>Y</attribute>
  542. </attribute>
  543. <attribute>
  544. <code>SUPPORTS_TIMESTAMP_DATA_TYPE</code>
  545. <attribute>Y</attribute>
  546. </attribute>
  547. <attribute>
  548. <code>USE_POOLING</code>
  549. <attribute>N</attribute>
  550. </attribute>
  551. </attributes>
  552. </connection>
  553. <order>
  554. <hop>
  555. <from>MongoDB input</from>
  556. <to>更新</to>
  557. <enabled>Y</enabled>
  558. </hop>
  559. </order>
  560. <step>
  561. <name>MongoDB input</name>
  562. <type>MongoDbInput</type>
  563. <description/>
  564. <distribute>Y</distribute>
  565. <custom_distribution/>
  566. <copies>1</copies>
  567. <partitioning>
  568. <method>none</method>
  569. <schema_name/>
  570. </partitioning>
  571. <hostname>${input_db_ip}</hostname>
  572. <port>${input_db_port}</port>
  573. <use_all_replica_members>N</use_all_replica_members>
  574. <db_name>info_admin</db_name>
  575. <fields_name/>
  576. <collection>visit</collection>
  577. <json_field_name>json</json_field_name>
  578. <json_query>{$group:{_id:"$infoId",mintime:{$min:"$visitTime"},maxtime:{$max:"$visitTime"},sum:{$sum:1}}},
  579. {$project:{ avgtime:{$divide: [{$subtract: [{$toDouble:'$maxtime'},{ $toDouble: '$mintime' }]}, "$sum" ]}}},
  580. {$match:{avgtime:{$ne:0}}}</json_query>
  581. <auth_database/>
  582. <auth_user/>
  583. <auth_password>Encrypted </auth_password>
  584. <auth_mech/>
  585. <auth_kerberos>N</auth_kerberos>
  586. <connect_timeout/>
  587. <socket_timeout/>
  588. <use_ssl_socket_factory>N</use_ssl_socket_factory>
  589. <read_preference>primary</read_preference>
  590. <output_json>N</output_json>
  591. <query_is_pipeline>Y</query_is_pipeline>
  592. <execute_for_each_row>N</execute_for_each_row>
  593. <mongo_fields>
  594. <mongo_field>
  595. <field_name>avgtime</field_name>
  596. <field_path>$.avgtime</field_path>
  597. <field_type>Number</field_type>
  598. </mongo_field>
  599. <mongo_field>
  600. <field_name>_id</field_name>
  601. <field_path>$._id</field_path>
  602. <field_type>String</field_type>
  603. </mongo_field>
  604. </mongo_fields>
  605. <attributes/>
  606. <cluster_schema/>
  607. <remotesteps>
  608. <input>
  609. </input>
  610. <output>
  611. </output>
  612. </remotesteps>
  613. <GUI>
  614. <xloc>192</xloc>
  615. <yloc>96</yloc>
  616. <draw>Y</draw>
  617. </GUI>
  618. </step>
  619. <step>
  620. <name>更新</name>
  621. <type>Update</type>
  622. <description/>
  623. <distribute>Y</distribute>
  624. <custom_distribution/>
  625. <copies>1</copies>
  626. <partitioning>
  627. <method>none</method>
  628. <schema_name/>
  629. </partitioning>
  630. <connection>avg</connection>
  631. <skip_lookup>Y</skip_lookup>
  632. <commit>100</commit>
  633. <use_batch>Y</use_batch>
  634. <error_ignored>N</error_ignored>
  635. <ignore_flag_field/>
  636. <lookup>
  637. <schema>ry</schema>
  638. <table>info</table>
  639. <key>
  640. <name>_id</name>
  641. <field>oldid</field>
  642. <condition>=</condition>
  643. <name2/>
  644. </key>
  645. <value>
  646. <name>avgtime</name>
  647. <rename>avgtime</rename>
  648. </value>
  649. </lookup>
  650. <attributes/>
  651. <cluster_schema/>
  652. <remotesteps>
  653. <input>
  654. </input>
  655. <output>
  656. </output>
  657. </remotesteps>
  658. <GUI>
  659. <xloc>384</xloc>
  660. <yloc>96</yloc>
  661. <draw>Y</draw>
  662. </GUI>
  663. </step>
  664. <step_error_handling>
  665. </step_error_handling>
  666. <slave-step-copy-partition-distribution>
  667. </slave-step-copy-partition-distribution>
  668. <slave_transformation>N</slave_transformation>
  669. <attributes/>
  670. </transformation>