mychaow commented on a change in pull request #1721:
URL: https://github.com/apache/incubator-iotdb/pull/1721#discussion_r486737016
##########
File path:
server/src/test/java/org/apache/iotdb/db/integration/IoTDBCreateSnapshotIT.java
##########
@@ -156,4 +178,20 @@ private void checkShowTimeseries(Statement statement)
throws SQLException {
Assert.assertEquals(8, cnt);
}
}
+
+ private PhysicalPlan convertFromString(String str) {
+ String[] words = str.split(",");
+ if (words[0].equals("2")) {
Review comment:
ok, thanks!
##########
File path:
server/src/main/java/org/apache/iotdb/db/sync/receiver/transfer/SyncServiceImpl.java
##########
@@ -272,18 +274,25 @@ public SyncStatus checkDataMD5(String md5OfSender) throws
TException {
private void loadMetadata() {
logger.info("Start to load metadata in sync process.");
if (currentFile.get().exists()) {
- try (BufferedReader br = new BufferedReader(
- new java.io.FileReader(currentFile.get()))) {
- String metadataOperation;
- while ((metadataOperation = br.readLine()) != null) {
+ MLogReader mLogReader = null;
+ try {
+ mLogReader = new MLogReader(config.getSchemaDir(),
MetadataConstant.METADATA_LOG);
+ while (mLogReader.hasNext()) {
+ PhysicalPlan plan = mLogReader.next();
try {
- IoTDB.metaManager.operation(metadataOperation);
- } catch (IOException | MetadataException e) {
- logger.error("Can not operate metadata operation {} ",
metadataOperation, e);
+ if (plan == null) {
+ continue;
+ }
+ IoTDB.metaManager.operation(plan);
+ } catch (Exception e) {
+ logger.error("Can not operate metadata operation {} for err:{}",
plan.getOperatorType(), e);
}
}
+ mLogReader.close();
} catch (IOException e) {
logger.error("Cannot read the file {}.",
currentFile.get().getAbsoluteFile(), e);
+ } finally {
+ mLogReader.close();
Review comment:
yes!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]