You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2019/11/06 02:59:33 UTC

[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request #467: online upgrade from v0.8.0 to current version

jt2594838 commented on a change in pull request #467: online upgrade  from v0.8.0 to current version
URL: https://github.com/apache/incubator-iotdb/pull/467#discussion_r342891254
 
 

 ##########
 File path: server/src/main/java/org/apache/iotdb/db/engine/upgrade/UpgradeTask.java
 ##########
 @@ -30,40 +33,82 @@
 
   private final TsFileResource upgradeResource;
   private static final Logger logger = LoggerFactory.getLogger(UpgradeTask.class);
+  private static final String DOT_SEPERATOR = ",";
 
   public UpgradeTask(TsFileResource upgradeResource) {
     this.upgradeResource = upgradeResource;
   }
 
+
+  private static boolean writeUpgradeLogFile(RandomAccessFile upgradeLog, String content,
+      long position) {
+    UpgradeUtils.getUpgradeLogLock().writeLock().lock();
+    try {
+      upgradeLog.seek(position);
+      upgradeLog.write(content.getBytes());
+      upgradeLog.write(System.getProperty("line.separator").getBytes());
+      return true;
+    } catch (IOException e) {
+      logger.error("write upgrade log file failed, the log file:{}", upgradeLog);
 
 Review comment:
   Record the exception to help to debug.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services