You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2019/02/27 02:53:05 UTC

[incubator-iotdb] branch refactor_fileNode updated: remove incorrect javadoc

This is an automated email from the ASF dual-hosted git repository.

hxd pushed a commit to branch refactor_fileNode
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/refactor_fileNode by this push:
     new 427631d  remove incorrect javadoc
427631d is described below

commit 427631d22e37d43b364e65933689819e11765bbf
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Wed Feb 27 10:52:52 2019 +0800

    remove incorrect javadoc
---
 .../db/engine/filenode/FileNodeProcessor.java      |   5 +-
 .../db/engine/filenode/TimeIntervalTsFile.java     | 287 ---------------------
 2 files changed, 1 insertion(+), 291 deletions(-)

diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
index e4e8403..7cdeecb 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
@@ -430,7 +430,7 @@ public class FileNodeProcessor extends Processor implements IStatistic {
   }
 
   /**
-   * execute filenode recovery. and finally release the write lock this processor.
+   * execute filenode recovery.
    */
   public void fileNodeRecovery() throws FileNodeProcessorException {
     // restore bufferwrite
@@ -462,8 +462,6 @@ public class FileNodeProcessor extends Processor implements IStatistic {
         bufferWriteProcessor = new BufferWriteProcessor(baseDir, getProcessorName(),
             fileNames[fileNames.length - 1], parameters, versionController, fileSchema);
       } catch (BufferWriteProcessorException e) {
-        // unlock
-        //writeUnlock();
         LOGGER.error(
             "The filenode processor {} failed to recovery the bufferwrite processor, "
                 + "the last bufferwrite file is {}.",
@@ -480,7 +478,6 @@ public class FileNodeProcessor extends Processor implements IStatistic {
       overflowProcessor = new OverflowProcessor(getProcessorName(), parameters, fileSchema,
           versionController);
     } catch (IOException e) {
-      //writeUnlock();
       LOGGER.error("The filenode processor {} failed to recovery the overflow processor.",
           getProcessorName());
       throw new FileNodeProcessorException(e);
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/TimeIntervalTsFile.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/TimeIntervalTsFile.java
deleted file mode 100644
index 8dea600..0000000
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/TimeIntervalTsFile.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.db.engine.filenode;
-
-import java.io.File;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import org.apache.iotdb.db.conf.directories.Directories;
-
-/**
- * This class is used to store the TsFile status.<br>
- */
-public class TimeIntervalTsFile implements Serializable {
-
-  private static final long serialVersionUID = -4309683416067212549L;
-  public OverflowChangeType overflowChangeType;
-  private int baseDirIndex;
-  private String relativePath;
-  private Map<String, Long> startTimeMap;
-  private Map<String, Long> endTimeMap;
-  private Set<String> mergeChanged = new HashSet<>();
-
-  /**
-   * construct function for TimeIntervalTsFile.
-   */
-  public TimeIntervalTsFile(Map<String, Long> startTimeMap, Map<String, Long> endTimeMap,
-      OverflowChangeType type,
-      int baseDirIndex, String relativePath) {
-
-    this.overflowChangeType = type;
-    this.baseDirIndex = baseDirIndex;
-    this.relativePath = relativePath;
-
-    this.startTimeMap = startTimeMap;
-    this.endTimeMap = endTimeMap;
-
-  }
-
-  /**
-   * This is just used to construct a new TsFile.
-   */
-  public TimeIntervalTsFile(OverflowChangeType type, String relativePath) {
-
-    this.overflowChangeType = type;
-    this.relativePath = relativePath;
-
-    startTimeMap = new HashMap<>();
-    endTimeMap = new HashMap<>();
-  }
-
-  public void setStartTime(String deviceId, long startTime) {
-
-    startTimeMap.put(deviceId, startTime);
-  }
-
-  /**
-   * get start time.
-   *
-   * @param deviceId -Map key
-   * @return -start time
-   */
-  public long getStartTime(String deviceId) {
-
-    if (startTimeMap.containsKey(deviceId)) {
-      return startTimeMap.get(deviceId);
-    } else {
-      return -1;
-    }
-  }
-
-  public Map<String, Long> getStartTimeMap() {
-
-    return startTimeMap;
-  }
-
-  public void setStartTimeMap(Map<String, Long> startTimeMap) {
-
-    this.startTimeMap = startTimeMap;
-  }
-
-  public void setEndTime(String deviceId, long timestamp) {
-
-    this.endTimeMap.put(deviceId, timestamp);
-  }
-
-  /**
-   * get end time for given device.
-   *
-   * @param deviceId -id of device
-   * @return -end time of the device
-   */
-  public long getEndTime(String deviceId) {
-
-    if (endTimeMap.get(deviceId) == null) {
-      return -1;
-    }
-    return endTimeMap.get(deviceId);
-  }
-
-  public Map<String, Long> getEndTimeMap() {
-
-    return endTimeMap;
-  }
-
-  public void setEndTimeMap(Map<String, Long> endTimeMap) {
-
-    this.endTimeMap = endTimeMap;
-  }
-
-  /**
-   * remove given device'startTime start time and end time.
-   *
-   * @param deviceId -id of the device
-   */
-  public void removeTime(String deviceId) {
-
-    startTimeMap.remove(deviceId);
-    endTimeMap.remove(deviceId);
-  }
-
-  /**
-   * get file path.
-   */
-  public String getFilePath() {
-
-    if (relativePath == null) {
-      return relativePath;
-    }
-    return new File(Directories.getInstance().getTsFileFolder(baseDirIndex), relativePath)
-        .getPath();
-  }
-
-  public String getRelativePath() {
-
-    return relativePath;
-  }
-
-  public void setRelativePath(String relativePath) {
-
-    this.relativePath = relativePath;
-  }
-
-  public boolean checkEmpty() {
-
-    return startTimeMap.isEmpty() && endTimeMap.isEmpty();
-  }
-
-  /**
-   * clear the member variable of the given object.
-   */
-  public void clear() {
-
-    startTimeMap.clear();
-    endTimeMap.clear();
-    mergeChanged.clear();
-    overflowChangeType = OverflowChangeType.NO_CHANGE;
-    relativePath = null;
-  }
-
-  /**
-   * change file type corresponding to the given param.
-   */
-  public void changeTypeToChanged(FileNodeProcessorStatus fileNodeProcessorState) {
-
-    if (fileNodeProcessorState == FileNodeProcessorStatus.MERGING_WRITE) {
-      overflowChangeType = OverflowChangeType.MERGING_CHANGE;
-    } else {
-      overflowChangeType = OverflowChangeType.CHANGED;
-    }
-  }
-
-  public void addMergeChanged(String deviceId) {
-
-    mergeChanged.add(deviceId);
-  }
-
-  public Set<String> getMergeChanged() {
-
-    return mergeChanged;
-  }
-
-  public void clearMergeChanged() {
-
-    mergeChanged.clear();
-  }
-
-  /**
-   * judge whether the time interval is closed.
-   */
-  public boolean isClosed() {
-
-    return !endTimeMap.isEmpty();
-
-  }
-
-  /**
-   * back up the time interval of tsfile.
-   */
-  public TimeIntervalTsFile backUp() {
-
-    Map<String, Long> startTimeMap = new HashMap<>(this.startTimeMap);
-    Map<String, Long> endTimeMap = new HashMap<>(this.endTimeMap);
-    return new TimeIntervalTsFile(startTimeMap, endTimeMap, overflowChangeType, baseDirIndex,
-        relativePath);
-  }
-
-  @Override
-  public int hashCode() {
-
-    final int prime = 31;
-    int result = 1;
-    result = prime * result + ((endTimeMap == null) ? 0 : endTimeMap.hashCode());
-    result = prime * result + ((relativePath == null) ? 0 : relativePath.hashCode());
-    result = prime * result + ((overflowChangeType == null) ? 0 : overflowChangeType.hashCode());
-    result = prime * result + ((startTimeMap == null) ? 0 : startTimeMap.hashCode());
-    return result;
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-
-    if (this == obj) {
-      return true;
-    }
-    if (obj == null) {
-      return false;
-    }
-    if (getClass() != obj.getClass()) {
-      return false;
-    }
-    TimeIntervalTsFile other = (TimeIntervalTsFile) obj;
-    if (endTimeMap == null) {
-      if (other.endTimeMap != null) {
-        return false;
-      }
-    } else if (!endTimeMap.equals(other.endTimeMap)) {
-      return false;
-    }
-    if (relativePath == null) {
-      if (other.relativePath != null) {
-        return false;
-      }
-    } else if (!relativePath.equals(other.relativePath)) {
-      return false;
-    }
-    if (overflowChangeType != other.overflowChangeType) {
-      return false;
-    }
-    if (startTimeMap == null) {
-      if (other.startTimeMap != null) {
-        return false;
-      }
-    } else if (!startTimeMap.equals(other.startTimeMap)) {
-      return false;
-    }
-    return true;
-  }
-
-  @Override
-  public String toString() {
-    return "TimeIntervalTsFile [relativePath=" + relativePath + ", overflowChangeType="
-        + overflowChangeType
-        + ", startTimeMap=" + startTimeMap + ", endTimeMap=" + endTimeMap + ", mergeChanged="
-        + mergeChanged
-        + "]";
-  }
-
-}