bucket_logs.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. package bucket
  2. import (
  3. "fmt"
  4. "testing"
  5. "time"
  6. . "git.wecise.com/wecise/odbserver/odb"
  7. "git.wecise.com/wecise/odbserver/odb/test"
  8. "gitee.com/wecisecode/util/logger"
  9. "github.com/stretchr/testify/assert"
  10. "github.com/stretchr/testify/require"
  11. )
  12. type BucketLogsTests struct {
  13. Test *testing.T
  14. g *Gutil
  15. }
  16. func BucketLogsTest(t *testing.T) {
  17. g := test.TestG()
  18. t.Run("InitG", func(t *testing.T) {
  19. test := &BucketLogsTests{Test: t, g: g}
  20. test.InitG()
  21. })
  22. t.Run("Class", func(t *testing.T) {
  23. test := &BucketLogsTests{Test: t, g: g}
  24. test.Class()
  25. })
  26. t.Run("Data", func(t *testing.T) {
  27. test := &BucketLogsTests{Test: t, g: g}
  28. test.Data()
  29. })
  30. time.Sleep(time.Duration(1) * time.Second)
  31. t.Run("Valid", func(t *testing.T) {
  32. test := &BucketLogsTests{Test: t, g: g}
  33. test.Valid()
  34. })
  35. t.Run("Alter", func(t *testing.T) {
  36. test := &BucketLogsTests{Test: t, g: g}
  37. test.Alter()
  38. })
  39. t.Run("Drop", func(t *testing.T) {
  40. test := &BucketLogsTests{Test: t, g: g}
  41. test.Drop()
  42. })
  43. }
  44. func (t *BucketLogsTests) InitG() {
  45. require.NotNil(t.Test, t.g)
  46. }
  47. func (t *BucketLogsTests) Class() {
  48. t.g.Query(`
  49. create class if not exists /test();
  50. alter /test/ drop column bklog3;
  51. `)
  52. // alter /test/ drop column bklog3 可能报错,忽略该错误
  53. _, _, err := t.g.Query(`
  54. create class if not exists /test/bucketlog (
  55. host varchar,
  56. bklog bucket {
  57. "type" : "bitlog",
  58. "files": ["*.log"],
  59. "sample" : ["2020-05-15 00:49:59,666"],
  60. "ttl" : 365
  61. } 'full',
  62. keys(host),
  63. indexes(host)
  64. ) with key=manu, nickname='bucketlog'
  65. `)
  66. if err != nil {
  67. logger.Errorf("%v", err)
  68. }
  69. require.Nil(t.Test, err, fmt.Sprint(err))
  70. _, _, err = t.g.Query(`
  71. create class if not exists /test/bucketlog2 (
  72. host varchar,
  73. bklog2 bucket {
  74. "type" : "bitlog",
  75. "files": ["*.log"],
  76. "sample" : ["2020-05-15 00:49:59,666"],
  77. "ttl" : 365
  78. } 'full',
  79. keys(host),
  80. indexes(host)
  81. ) with key=manu, nickname='bucketlog2'
  82. `)
  83. if err != nil {
  84. logger.Errorf("%v", err)
  85. }
  86. require.Nil(t.Test, err, fmt.Sprint(err))
  87. }
  88. func (t *BucketLogsTests) Data() {
  89. var err error
  90. /*_, _, err = t.g.Query(` insert into /test/bucketlog (id) values ("linux:wecise") `)
  91. if err != nil {
  92. logger.Errorf("%v", err)
  93. }
  94. require.Nil(t.Test, err, fmt.Sprint(err))
  95. _, _, err = t.g.Query(` insert into /test/bucketlog2 (id) values ("linux:wecise2") `)
  96. if err != nil {
  97. logger.Errorf("%v", err)
  98. }
  99. require.Nil(t.Test, err, fmt.Sprint(err))
  100. */
  101. _, _, err = t.g.Query(`
  102. insert into /test/bucketlog (id, bklog['file1.log']) values ('linux:wecise', ["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  103. 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  104. 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  105. 1-4--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
  106. 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  107. 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  108. 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
  109. 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
  110. 1-9--INFO [Thread-3] 2020-06-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
  111. 1-10--INFO [Thread-8] 2020-06-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])
  112. `)
  113. if err != nil {
  114. logger.Errorf("%v", err)
  115. }
  116. require.Nil(t.Test, err, fmt.Sprint(err))
  117. _, _, err = t.g.Query(`
  118. insert into /test/bucketlog2 (id, bklog2['file1.log']) values ('linux:wecise2', ["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  119. 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  120. 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  121. 1-4--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
  122. 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  123. 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  124. 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
  125. 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
  126. 1-9--INFO [Thread-3] 2020-06-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
  127. 1-10--INFO [Thread-8] 2020-06-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])
  128. `)
  129. if err != nil {
  130. logger.Errorf("%v", err)
  131. }
  132. require.Nil(t.Test, err, fmt.Sprint(err))
  133. _, _, err = t.g.Query(`
  134. insert into /test/bucketlog (id, bklog['file1.log']) values ('linux:wecise', ["1-1--DEBUG [CompactionExecutor:584] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-2--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-3--DEBUG [CompactionExecutor:584] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-4--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables", "1-5--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-6--DEBUG [CompactionExecutor:583] 2020-07-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-7--WARN [Native-Transport-Requests-1] 2020-07-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key", "1-8--WARN [Native-Transport-Requests-1] 2020-07-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key", "1-9--INFO [Thread-3] 2020-07-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields", "1-10--INFO [Thread-8] 2020-07-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"])
  135. `)
  136. if err != nil {
  137. logger.Errorf("%v", err)
  138. }
  139. require.Nil(t.Test, err, fmt.Sprint(err))
  140. stat, errr := t.g.Prepare(` insert into /test/bucketlog (id, bklog[?]) values (?, ?) `)
  141. if errr != nil {
  142. logger.Errorf("%v", errr)
  143. }
  144. require.Nil(t.Test, errr)
  145. _, _, err = stat.Exec("file1.log", "linux:wecise", []string{"1-1--DEBUG [CompactionExecutor:584] 2020-09-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-2--DEBUG [CompactionExecutor:583] 2020-09-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-3--DEBUG [CompactionExecutor:584] 2020-09-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-4--DEBUG [CompactionExecutor:583] 2020-09-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables", "1-5--DEBUG [CompactionExecutor:583] 2020-09-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-6--DEBUG [CompactionExecutor:583] 2020-09-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables", "1-7--WARN [Native-Transport-Requests-1] 2020-09-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key", "1-8--WARN [Native-Transport-Requests-1] 2020-09-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key", "1-9--INFO [Thread-3] 2020-09-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields", "1-10--INFO [Thread-8] 2020-09-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"})
  146. require.Nil(t.Test, err, fmt.Sprint(err))
  147. _, _, err = stat.Exec("file1.log", "linux:wecise", `1-1--DEBUG [CompactionExecutor:584] 2020-11-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  148. 1-2--DEBUG [CompactionExecutor:583] 2020-11-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  149. 1-3--DEBUG [CompactionExecutor:584] 2020-11-25 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  150. 1-4--DEBUG [CompactionExecutor:583] 2020-11-25 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
  151. 1-5--DEBUG [CompactionExecutor:583] 2020-11-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  152. 1-6--DEBUG [CompactionExecutor:583] 2020-11-25 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  153. 1-7--WARN [Native-Transport-Requests-1] 2020-11-25 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
  154. 1-8--WARN [Native-Transport-Requests-1] 2020-11-25 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
  155. 1-9--INFO [Thread-3] 2020-11-25 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
  156. 1-10--INFO [Thread-8] 2020-11-25 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields`)
  157. require.Nil(t.Test, err, fmt.Sprint(err))
  158. _, _, err = t.g.Query(`
  159. insert into /test/bucketlog (id, bklog['file1.log','file1.log','file1.log']) values ('linux:wecise', [["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 01:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  160. 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 01:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  161. 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 01:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  162. 1-4--DEBUG [CompactionExecutor:583] 2020-06-25 01:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
  163. 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 01:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  164. 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 01:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  165. 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 01:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
  166. 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 01:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
  167. 1-9--INFO [Thread-3] 2020-06-25 01:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
  168. 1-10--INFO [Thread-8] 2020-06-25 01:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"], ["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 02:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  169. 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 02:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  170. 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 02:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  171. 1-4--DEBUG [CompactionExecutor:583] 2020-06-25 02:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
  172. 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 02:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  173. 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 02:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  174. 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 02:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
  175. 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 02:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
  176. 1-9--INFO [Thread-3] 2020-06-25 02:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
  177. 1-10--INFO [Thread-8] 2020-06-25 02:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"], ["1-1--DEBUG [CompactionExecutor:584] 2020-06-25 03:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  178. 1-2--DEBUG [CompactionExecutor:583] 2020-06-25 03:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  179. 1-3--DEBUG [CompactionExecutor:584] 2020-06-25 03:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  180. 1-4--DEBUG [CompactionExecutor:583] 2020-06-25 03:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
  181. 1-5--DEBUG [CompactionExecutor:583] 2020-06-25 03:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  182. 1-6--DEBUG [CompactionExecutor:583] 2020-06-25 03:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  183. 1-7--WARN [Native-Transport-Requests-1] 2020-06-25 03:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
  184. 1-8--WARN [Native-Transport-Requests-1] 2020-06-25 03:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
  185. 1-9--INFO [Thread-3] 2020-06-25 03:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
  186. 1-10--INFO [Thread-8] 2020-06-25 03:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"]])
  187. `)
  188. if err != nil {
  189. logger.Errorf("%v", err)
  190. }
  191. require.Nil(t.Test, err, fmt.Sprint(err))
  192. _, _, err = t.g.Query(`
  193. insert into /test/bucketlog (id, bklog['file1.log','file1.log','file1.log']) values ('linux:wecise', [["1-1--DEBUG [CompactionExecutor:584] 2020-06-26 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  194. 1-2--DEBUG [CompactionExecutor:583] 2020-06-26 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  195. 1-3--DEBUG [CompactionExecutor:584] 2020-06-26 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  196. 1-4--DEBUG [CompactionExecutor:583] 2020-06-26 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
  197. 1-5--DEBUG [CompactionExecutor:583] 2020-06-26 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  198. 1-6--DEBUG [CompactionExecutor:583] 2020-06-26 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  199. 1-7--WARN [Native-Transport-Requests-1] 2020-06-26 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
  200. 1-8--WARN [Native-Transport-Requests-1] 2020-06-26 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
  201. 1-9--INFO [Thread-3] 2020-06-26 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
  202. 1-10--INFO [Thread-8] 2020-06-26 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"], ["1-1--DEBUG [CompactionExecutor:584] 2020-06-27 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  203. 1-2--DEBUG [CompactionExecutor:583] 2020-06-27 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  204. 1-3--DEBUG [CompactionExecutor:584] 2020-06-27 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  205. 1-4--DEBUG [CompactionExecutor:583] 2020-06-27 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
  206. 1-5--DEBUG [CompactionExecutor:583] 2020-06-27 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  207. 1-6--DEBUG [CompactionExecutor:583] 2020-06-27 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  208. 1-7--WARN [Native-Transport-Requests-1] 2020-06-27 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
  209. 1-8--WARN [Native-Transport-Requests-1] 2020-06-27 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
  210. 1-9--INFO [Thread-3] 2020-06-27 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
  211. 1-10--INFO [Thread-8] 2020-06-27 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"],["1-1--DEBUG [CompactionExecutor:584] 2020-06-28 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  212. 1-2--DEBUG [CompactionExecutor:583] 2020-06-28 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  213. 1-3--DEBUG [CompactionExecutor:584] 2020-06-28 00:49:59,666 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  214. 1-4--DEBUG [CompactionExecutor:583] 2020-06-28 00:49:59,666 TimeWindowCompactionStrategy.java:117 - TWCS expired check sufficiently far in the past, checking for fully expired SSTables
  215. 1-5--DEBUG [CompactionExecutor:583] 2020-06-28 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  216. 1-6--DEBUG [CompactionExecutor:583] 2020-06-28 00:49:59,667 TimeWindowCompactionStrategy.java:124 - TWCS skipping check for fully expired SSTables
  217. 1-7--WARN [Native-Transport-Requests-1] 2020-06-28 00:50:01,043 SelectStatement.java:429 - Aggregation query used without partition key
  218. 1-8--WARN [Native-Transport-Requests-1] 2020-06-28 00:50:04,072 SelectStatement.java:429 - Aggregation query used without partition key
  219. 1-9--INFO [Thread-3] 2020-06-28 00:50:08,837 IndexMatrixSchema.java:143 - [object] No need to add fields
  220. 1-10--INFO [Thread-8] 2020-06-28 00:50:08,840 IndexMatrixSchema.java:143 - [vobject] No need to add fields"]])
  221. `)
  222. if err != nil {
  223. logger.Errorf("%v", err)
  224. }
  225. require.Nil(t.Test, err, fmt.Sprint(err))
  226. }
  227. func (t *BucketLogsTests) Valid() {
  228. var err error
  229. _, _, err = t.g.Query(`select bklog FROM /test/bucketlog`)
  230. assert.Nil(t.Test, err)
  231. _, _, err = t.g.Query(`SELECT bklog.time('2020-04-22', '').inst() FROM /test/bucketlog`)
  232. assert.Nil(t.Test, err)
  233. _, _, err = t.g.Query(`SELECT bklog.date("2020-06-28").inst() FROM /test/bucketlog`)
  234. assert.Nil(t.Test, err)
  235. _, _, err = t.g.Query(`SELECT bklog["file*.log"{116669996670004, 116669996680008}] FROM /test/bucketlog`)
  236. assert.Nil(t.Test, err)
  237. _, _, err = t.g.Query(`SELECT bklog["file1.log"{1,3,6,7}].time('2020-06-25 00:49:59,667', '').find( "twcs skipping" ) FROM /test/bucketlog`)
  238. assert.Nil(t.Test, err)
  239. _, _, err = t.g.Query(`SELECT bklog.time('2020-06-23 14:50','2020-06-23 15:00').find('twcs'),id FROM /test/bucketlog`)
  240. assert.Nil(t.Test, err)
  241. _, _, err = t.g.Query(`SELECT id FROM /test/bucketlog where bklog.time("2020-05-01","").find("INFO").assert() `)
  242. assert.Nil(t.Test, err)
  243. _, _, err = t.g.Query(`select bklog2 FROM /test/bucketlog2`)
  244. assert.Nil(t.Test, err)
  245. }
  246. func (t *BucketLogsTests) Alter() {
  247. var err error
  248. _, _, err = t.g.Query(`alter /test add column bklog3 bucket {
  249. "type" : "bitlog",
  250. "files": ["*.log"],
  251. "sample" : ["2020-05-15 00:49:59,666"],
  252. "ttl" : 365
  253. } 'full' `)
  254. if err != nil {
  255. fmt.Printf("%v", err)
  256. }
  257. assert.Nil(t.Test, err)
  258. }
  259. func (t *BucketLogsTests) Drop() {
  260. var err error
  261. _, _, err = t.g.Query(`delete bklog2, bklog3 from /test/bucketlog2 `)
  262. assert.Nil(t.Test, err)
  263. _, _, err = t.g.Query(`delete from /test/bucketlog2 with version`)
  264. assert.Nil(t.Test, err)
  265. _, _, err = t.g.Query(`drop class /test/bucketlog2 `)
  266. //assert.Nil(t.Test, err)
  267. }