()
| 1185 | } |
| 1186 | |
| 1187 | func (ptw *partitionWriter) close() { |
| 1188 | ptw.mutex.Lock() |
| 1189 | defer ptw.mutex.Unlock() |
| 1190 | |
| 1191 | if ptw.currBatch != nil { |
| 1192 | batch := ptw.currBatch |
| 1193 | ptw.queue.Put(batch) |
| 1194 | ptw.currBatch = nil |
| 1195 | batch.trigger() |
| 1196 | } |
| 1197 | |
| 1198 | ptw.queue.Close() |
| 1199 | } |
| 1200 | |
| 1201 | type writeBatch struct { |
| 1202 | time time.Time |