This is an automated email from the ASF dual-hosted git repository.
yuyuankang pushed a commit to branch kyy
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/kyy by this push:
new 27541ca remove appendInternal
27541ca is described below
commit 27541caf7a511cc5cb0da3da818e624e7cea6fe4
Author: Ring-k <[email protected]>
AuthorDate: Wed Jul 29 10:33:06 2020 +0800
remove appendInternal
---
.../serializable/SyncLogDequeSerializer.java | 35 +---------------------
1 file changed, 1 insertion(+), 34 deletions(-)
diff --git
a/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java
b/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java
index b54e07b..ba2ed17 100644
---
a/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java
+++
b/cluster/src/main/java/org/apache/iotdb/cluster/log/manage/serializable/SyncLogDequeSerializer.java
@@ -85,7 +85,7 @@ public class SyncLogDequeSerializer implements
StableEntryManager {
private ByteBuffer logBuffer = ByteBuffer
.allocate(ClusterDescriptor.getInstance().getConfig().getRaftLogBufferSize());
- private int flushRaftLogThreshold =
ClusterDescriptor.getInstance().getConfig()
+ private final int flushRaftLogThreshold =
ClusterDescriptor.getInstance().getConfig()
.getFlushRaftLogThreshold();
private int bufferedLogNum = 0;
@@ -400,39 +400,6 @@ public class SyncLogDequeSerializer implements
StableEntryManager {
return logFile;
}
- public void appendInternal(List<Log> logs) {
- int bufferSize = 0;
- List<ByteBuffer> bufferList = new ArrayList<>(logs.size());
- lock.writeLock().lock();
- try {
- for (Log log : logs) {
- ByteBuffer data = log.serialize();
- int size = data.capacity() + Integer.BYTES;
- logSizeDeque.addLast(size);
- bufferSize += size;
-
- bufferList.add(data);
- }
- } finally {
- lock.writeLock().unlock();
- }
-
- ByteBuffer finalBuffer = ByteBuffer.allocate(bufferSize);
- for (ByteBuffer byteBuffer : bufferList) {
- finalBuffer.putInt(byteBuffer.capacity());
- finalBuffer.put(byteBuffer.array());
- }
-
- // write into disk
- try {
- checkStream();
- ReadWriteIOUtils.writeWithoutSize(finalBuffer, currentLogOutputStream);
- } catch (IOException e) {
- logger.error("Error in appending {} logs serialization: ", logs.size(),
e);
- }
-
- }
-
@SuppressWarnings("unused") // to support serialization of uncommitted logs
public void truncateLog(int count, LogManagerMeta meta) {
truncateLogIntern(count);