jixuan1989 commented on a change in pull request #32: fix sonar issues
URL: https://github.com/apache/incubator-iotdb/pull/32#discussion_r253117306
##########
File path:
iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
##########
@@ -1893,23 +1762,96 @@ private void writeStoreToDisk(FileNodeProcessorStore
fileNodeProcessorStore)
private FileNodeProcessorStore readStoreFromDisk() throws
FileNodeProcessorException {
- synchronized (fileNodeRestoreFilePath) {
+ synchronized (fileNodeRestoreLock) {
FileNodeProcessorStore processorStore;
SerializeUtil<FileNodeProcessorStore> serializeUtil = new
SerializeUtil<>();
try {
processorStore = serializeUtil.deserialize(fileNodeRestoreFilePath)
.orElse(new FileNodeProcessorStore(false, new HashMap<>(),
new IntervalFileNode(OverflowChangeType.NO_CHANGE, null),
- new ArrayList<IntervalFileNode>(),
FileNodeProcessorStatus.NONE, 0));
+ new ArrayList<>(), FileNodeProcessorStatus.NONE, 0));
} catch (IOException e) {
- e.printStackTrace();
throw new FileNodeProcessorException(e);
}
return processorStore;
}
}
- public String getFileNodeRestoreFilePath() {
+ String getFileNodeRestoreFilePath() {
return fileNodeRestoreFilePath;
}
+
+ @Override
+ public boolean equals(Object o) {
Review comment:
Do we really need to override the equals() and hashCode() method of this
class? what the Sonar said?
Remember that if we override the equals() and hashcode() functions like what
you wrote, we have to notice ourselves we need to modify these two functions if
we add (or remove) fields in this class..
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services