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

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


The following commit(s) were added to refs/heads/modulize by this push:
     new 5d93e19  [not finished] extract MManager as interface
5d93e19 is described below

commit 5d93e19436d78149b6e69b68701a1aaa38901237
Author: xiangdong huang <[email protected]>
AuthorDate: Wed Jul 29 21:58:25 2020 +0800

    [not finished] extract MManager as interface
---
 .../apache/iotdb/db/metadata/ISchemaManager.java   | 41 ++++++++++++++++++++++
 .../iotdb/db/metadata/mnode/MeasurementMNode.java  |  2 +-
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/metadata/ISchemaManager.java 
b/server/src/main/java/org/apache/iotdb/db/metadata/ISchemaManager.java
index b52ddbe..aa32fff 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/ISchemaManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/ISchemaManager.java
@@ -466,18 +466,59 @@ public interface ISchemaManager {
    */
   Map<String, String> determineStorageGroup(String path) throws 
IllegalPathException;
 
+  /**
+   * cache a given time series schema
+   * @param path
+   * @param meta
+   */
   void cacheMeta(String path, MeasurementMeta meta);
 
+  /**
+   *
+   * @param seriesPath
+   * @param timeValuePair
+   * @param highPriorityUpdate
+   * @param latestFlushedTime
+   * @param node
+   */
   void updateLastCache(String seriesPath, TimeValuePair timeValuePair,
       boolean highPriorityUpdate, Long latestFlushedTime,
       IMeasurementMNode node);
 
+  /**
+   * get the lastest data point of the given time series
+   * @param seriesPath a full path
+   * @return
+   */
   TimeValuePair getLastCache(String seriesPath);
 
+  /**
+   * Create a schema snapshot.
+   * This is just for accerelating the speed of restarting IoTDB.
+   * If the init() is very fast, this method can be ignored.
+   */
   void createMTreeSnapshot();
 
+  /**
+   * 1. If the related time series are not registered, and the IoTDB instance 
allows auto-create-schema,
+   * then create related time series.
+   * 2. For those existing time series, check whether the data types in the 
insertPlan are correct.
+   * 2.1 if IoTDB enable partial insert, then call 
plan.markFailedMeasurementInsertion() to record
+   * which measurements have incorrect data type. Else throw MetadataException 
if there is error.
+   * 3. Getting the DeviceNode according to the deviceID, and assign it to the 
insertPlan
+   * 4. Apply for the readlock of the deviceNode.
+   * @param deviceId the device path, must be the same in the insertPlan
+   * @param measurementList the measurement names, must be the same in the 
isnertPlan
+   * @param plan
+   * @return the measurement schema of each measurement.
+   * @throws MetadataException
+   */
   MeasurementSchema[] getSeriesSchemasAndReadLockDevice(String deviceId,
       String[] measurementList, InsertPlan plan) throws MetadataException;
 
+  /**
+   * unlock the read lock of the given deviceId.
+   * @param deviceId
+   */
   void unlockDeviceReadLock(String deviceId);
 }
diff --git 
a/server/src/main/java/org/apache/iotdb/db/metadata/mnode/MeasurementMNode.java 
b/server/src/main/java/org/apache/iotdb/db/metadata/mnode/MeasurementMNode.java
index 64b31ec..19e0157 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/metadata/mnode/MeasurementMNode.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/metadata/mnode/MeasurementMNode.java
@@ -86,7 +86,7 @@ public class MeasurementMNode extends MNode implements 
IMeasurementMNode {
         cachedLastValuePair =
             new TimeValuePair(timeValuePair.getTimestamp(), 
timeValuePair.getValue());
       }
-    } else if (timeValuePair.getTimestamp() > 
cachedLastValuePair.getTimestamp()
+    } else if (timeValuePair.getTimestamp() >= 
cachedLastValuePair.getTimestamp()
         || (timeValuePair.getTimestamp() == cachedLastValuePair.getTimestamp()
         && highPriorityUpdate)) {
       cachedLastValuePair.setTimestamp(timeValuePair.getTimestamp());

Reply via email to