Package io.milvus.bulkwriter
Class BulkWriter
java.lang.Object
io.milvus.bulkwriter.BulkWriter
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
LocalBulkWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ReentrantLockprotected longprotected CreateCollectionReq.CollectionSchemaprotected BulkFileTypeprotected ReentrantLockprotected FormatFileWriterprotected booleanprotected intprotected Stringprotected longprotected longprotected String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBulkWriter(CreateCollectionReq.CollectionSchema collectionSchema, long chunkSize, BulkFileType fileType, String localPath, Map<String, Object> config) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendRow(com.google.gson.JsonObject row) protected abstract voidcallBackIfCommitReady(List<String> filePaths) protected voidcommit()commitIfFileReady(boolean createNewFile) protected Longprotected Stringprotected FormatFileWriterprotected Longprotected FormatFileWriterverifyRow(com.google.gson.JsonObject row) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.AutoCloseable
close
-
Field Details
-
collectionSchema
-
chunkSize
protected long chunkSize -
fileType
-
localPath
-
uuid
-
flushCount
protected int flushCount -
fileWriter
-
config
-
totalSize
protected long totalSize -
totalRowCount
protected long totalRowCount -
appendLock
-
fileWriteLock
-
firstWrite
protected boolean firstWrite
-
-
Constructor Details
-
BulkWriter
protected BulkWriter(CreateCollectionReq.CollectionSchema collectionSchema, long chunkSize, BulkFileType fileType, String localPath, Map<String, Object> config) throws IOException- Throws:
IOException
-
-
Method Details
-
getTotalSize
-
getTotalRowCount
-
getChunkSize
-
getFileWriter
-
newFileWriter
- Throws:
IOException
-
appendRow
- Throws:
IOExceptionInterruptedException
-
commitIfFileReady
- Throws:
IOException
-
callBackIfCommitReady
protected abstract void callBackIfCommitReady(List<String> filePaths) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
commit
protected void commit() -
getDataPath
-
verifyRow
-