-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BACKUP] define RecordWriter interface #1109
[BACKUP] define RecordWriter interface #1109
Conversation
common/src/main/java/org/astraea/common/backup/RecordWriter.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/astraea/common/backup/RecordWriter.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/astraea/common/backup/RecordWriter.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/astraea/common/backup/LocalFileWriterBuilder.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/astraea/common/backup/LocalFileWriterBuilder.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/astraea/common/backup/LocalFileWriterBuilder.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Haser0305 感謝更新,還有幾個建議請看一下
common/src/main/java/org/astraea/common/backup/FileWriterBuilder.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/astraea/common/backup/FileWriterBuilder.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/astraea/common/backup/FileWriterBuilder.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/astraea/common/backup/FileWriterBuilder.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Haser0305 感謝,剩下一個小建議
另外如果這隻PR要先完成write
的部分,那請改一下標題
common/src/main/java/org/astraea/common/backup/RecordWriterBuilder.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
#1093
目前先定義寫入資料的部分,上面的幾個都會使用到最後一個write,沒用到的參數都會帶入null,現在想到是使用 batch 來包數個 record,如果大小達到上限就會寫入到硬碟。
還有在考慮分兩個 thread,一個包裝 batch,另外一個是寫入準備好的 batch。
GC 部分目前在看怎麼操作會比較恰當,目前可能的作法應該會是要一大塊空間來暫時放置 batch 等待寫入
另外有在想 protocol 的部分有無需要額外建立一個 interface 來定義內容