This is an automated email from the ASF dual-hosted git repository.
yuyuankang pushed a commit to branch kyy2
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/kyy2 by this push:
new 6a2da3f format
6a2da3f is described below
commit 6a2da3fcc9d690a1d13abc3e2eaa3c44651bf754
Author: Ring-k <[email protected]>
AuthorDate: Tue Jul 14 23:24:17 2020 +0800
format
---
.../cluster/server/member/MetaGroupMember.java | 105 ++++++++++++++----
.../iotdb/db/qp/physical/crud/InsertPlan.java | 6 +-
.../apache/iotdb/tsfile/write/record/Tablet.java | 117 ++++++++++-----------
3 files changed, 142 insertions(+), 86 deletions(-)
diff --git
a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
index 6c2cb04..d3b0c32 100644
---
a/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
+++
b/cluster/src/main/java/org/apache/iotdb/cluster/server/member/MetaGroupMember.java
@@ -19,8 +19,51 @@
package org.apache.iotdb.cluster.server.member;
+import static
org.apache.iotdb.cluster.utils.ClusterUtils.STARTUP_CHECK_THREAD_POOL_SIZE;
+import static
org.apache.iotdb.cluster.utils.ClusterUtils.WAIT_START_UP_CHECK_TIME;
+import static
org.apache.iotdb.cluster.utils.ClusterUtils.WAIT_START_UP_CHECK_TIME_UNIT;
+import static
org.apache.iotdb.cluster.utils.ClusterUtils.analyseStartUpCheckResult;
+import static
org.apache.iotdb.db.utils.EncodingInferenceUtils.getDefaultEncoding;
+import static org.apache.iotdb.db.utils.SchemaUtils.getAggregationType;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
import java.lang.reflect.Array;
import java.net.SocketTimeoutException;
+import java.nio.ByteBuffer;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
import org.apache.iotdb.cluster.ClusterFileFlushPolicy;
import org.apache.iotdb.cluster.client.async.AsyncClientPool;
import org.apache.iotdb.cluster.client.async.AsyncDataClient;
@@ -33,7 +76,13 @@ import org.apache.iotdb.cluster.client.sync.SyncMetaClient;
import org.apache.iotdb.cluster.client.sync.SyncMetaClient.FactorySync;
import org.apache.iotdb.cluster.config.ClusterConstant;
import org.apache.iotdb.cluster.config.ClusterDescriptor;
-import org.apache.iotdb.cluster.exception.*;
+import org.apache.iotdb.cluster.exception.AddSelfException;
+import org.apache.iotdb.cluster.exception.CheckConsistencyException;
+import org.apache.iotdb.cluster.exception.LogExecutionException;
+import org.apache.iotdb.cluster.exception.PartitionTableUnavailableException;
+import org.apache.iotdb.cluster.exception.QueryTimeOutException;
+import org.apache.iotdb.cluster.exception.RequestTimeOutException;
+import org.apache.iotdb.cluster.exception.UnsupportedPlanException;
import org.apache.iotdb.cluster.log.Log;
import org.apache.iotdb.cluster.log.LogApplier;
import org.apache.iotdb.cluster.log.applier.MetaLogApplier;
@@ -41,18 +90,49 @@ import org.apache.iotdb.cluster.log.logtypes.AddNodeLog;
import org.apache.iotdb.cluster.log.logtypes.RemoveNodeLog;
import org.apache.iotdb.cluster.log.manage.MetaSingleSnapshotLogManager;
import org.apache.iotdb.cluster.log.snapshot.MetaSimpleSnapshot;
-import org.apache.iotdb.cluster.partition.*;
+import org.apache.iotdb.cluster.partition.NodeAdditionResult;
+import org.apache.iotdb.cluster.partition.NodeRemovalResult;
+import org.apache.iotdb.cluster.partition.PartitionGroup;
+import org.apache.iotdb.cluster.partition.PartitionTable;
+import org.apache.iotdb.cluster.partition.SlotPartitionTable;
import org.apache.iotdb.cluster.query.ClusterPlanRouter;
import org.apache.iotdb.cluster.query.RemoteQueryContext;
import org.apache.iotdb.cluster.query.fill.PreviousFillArguments;
import org.apache.iotdb.cluster.query.groupby.RemoteGroupByExecutor;
import org.apache.iotdb.cluster.query.manage.QueryCoordinator;
-import org.apache.iotdb.cluster.query.reader.*;
-import org.apache.iotdb.cluster.rpc.thrift.*;
+import org.apache.iotdb.cluster.query.reader.DataSourceInfo;
+import org.apache.iotdb.cluster.query.reader.EmptyReader;
+import org.apache.iotdb.cluster.query.reader.ManagedMergeReader;
+import org.apache.iotdb.cluster.query.reader.MergedReaderByTime;
+import org.apache.iotdb.cluster.query.reader.RemoteSeriesReaderByTimestamp;
+import org.apache.iotdb.cluster.query.reader.RemoteSimpleSeriesReader;
+import org.apache.iotdb.cluster.rpc.thrift.AddNodeResponse;
+import org.apache.iotdb.cluster.rpc.thrift.AppendEntryRequest;
+import org.apache.iotdb.cluster.rpc.thrift.CheckStatusResponse;
+import org.apache.iotdb.cluster.rpc.thrift.ExecutNonQueryReq;
+import org.apache.iotdb.cluster.rpc.thrift.GetAggrResultRequest;
+import org.apache.iotdb.cluster.rpc.thrift.GroupByRequest;
+import org.apache.iotdb.cluster.rpc.thrift.HeartBeatRequest;
+import org.apache.iotdb.cluster.rpc.thrift.HeartBeatResponse;
+import org.apache.iotdb.cluster.rpc.thrift.Node;
+import org.apache.iotdb.cluster.rpc.thrift.PreviousFillRequest;
+import org.apache.iotdb.cluster.rpc.thrift.PullSchemaRequest;
+import org.apache.iotdb.cluster.rpc.thrift.PullSchemaResp;
+import org.apache.iotdb.cluster.rpc.thrift.RaftService;
import org.apache.iotdb.cluster.rpc.thrift.RaftService.Client;
+import org.apache.iotdb.cluster.rpc.thrift.SendSnapshotRequest;
+import org.apache.iotdb.cluster.rpc.thrift.SingleSeriesQueryRequest;
+import org.apache.iotdb.cluster.rpc.thrift.StartUpStatus;
+import org.apache.iotdb.cluster.rpc.thrift.TSMetaService;
import org.apache.iotdb.cluster.rpc.thrift.TSMetaService.AsyncClient;
-import org.apache.iotdb.cluster.server.*;
+import org.apache.iotdb.cluster.server.ClientServer;
+import org.apache.iotdb.cluster.server.DataClusterServer;
+import org.apache.iotdb.cluster.server.HardLinkCleaner;
+import org.apache.iotdb.cluster.server.NodeCharacter;
+import org.apache.iotdb.cluster.server.NodeReport;
import org.apache.iotdb.cluster.server.NodeReport.MetaMemberReport;
+import org.apache.iotdb.cluster.server.RaftServer;
+import org.apache.iotdb.cluster.server.Response;
import org.apache.iotdb.cluster.server.handlers.caller.AppendGroupEntryHandler;
import org.apache.iotdb.cluster.server.handlers.caller.GenericHandler;
import org.apache.iotdb.cluster.server.handlers.caller.NodeStatusHandler;
@@ -119,21 +199,6 @@ import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.*;
-import java.nio.ByteBuffer;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-
-import static org.apache.iotdb.cluster.utils.ClusterUtils.*;
-import static
org.apache.iotdb.db.utils.EncodingInferenceUtils.getDefaultEncoding;
-import static org.apache.iotdb.db.utils.SchemaUtils.getAggregationType;
-
public class MetaGroupMember extends RaftMember {
// the file contains the identifier of the local node
diff --git
a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
index 6b3d17c..3b5d577 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java
@@ -19,12 +19,8 @@
package org.apache.iotdb.db.qp.physical.crud;
-import io.jsonwebtoken.lang.Collections;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
-import org.apache.iotdb.db.cost.statistic.Measurement;
import org.apache.iotdb.db.qp.logical.Operator;
import org.apache.iotdb.db.qp.physical.PhysicalPlan;
import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
@@ -97,7 +93,7 @@ public abstract class InsertPlan extends PhysicalPlan {
* @param index failed measurement index
*/
public void markFailedMeasurementInsertion(int index, Exception e) {
- if(measurements[index] == null){
+ if (measurements[index] == null) {
return;
}
if (failedMeasurements == null) {
diff --git
a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java
b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java
index 2121db3..bb2069e 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java
@@ -27,16 +27,12 @@ import
org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
/**
* A tablet data of one device, the tablet contains multiple measurements of
this device that share
* the same time column.
- *
+ * <p>
* for example: device root.sg1.d1
- *
- * time, m1, m2, m3
- * 1, 1, 2, 3
- * 2, 1, 2, 3
- * 3, 1, 2, 3
- *
+ * <p>
+ * time, m1, m2, m3 1, 1, 2, 3 2, 1, 2, 3 3, 1, 2, 3
+ * <p>
* Notice: The tablet should not have empty cell
- *
*/
public class Tablet {
@@ -70,24 +66,22 @@ public class Tablet {
private int maxRowNumber;
/**
- * Return a tablet with default specified row number. This is the standard
- * constructor (all Tablet should be the same size).
+ * Return a tablet with default specified row number. This is the standard
constructor (all Tablet
+ * should be the same size).
*
- * @param deviceId the name of the device specified to be written in
- * @param schemas the list of measurement schemas for creating the tablet
+ * @param deviceId the name of the device specified to be written in
+ * @param schemas the list of measurement schemas for creating the tablet
*/
public Tablet(String deviceId, List<MeasurementSchema> schemas) {
this(deviceId, schemas, DEFAULT_SIZE);
}
/**
- * Return a tablet with the specified number of rows (maxBatchSize). Only
- * call this constructor directly for testing purposes. Tablet should
normally
- * always be default size.
+ * Return a tablet with the specified number of rows (maxBatchSize). Only
call this constructor
+ * directly for testing purposes. Tablet should normally always be default
size.
*
* @param deviceId the name of the device specified to be written in
- * @param schemas the list of measurement schemas for creating the row
- * batch
+ * @param schemas the list of measurement schemas for creating the row
batch
* @param maxRowNumber the maximum number of rows for this tablet
*/
public Tablet(String deviceId, List<MeasurementSchema> schemas, int
maxRowNumber) {
@@ -126,26 +120,27 @@ public class Tablet {
for (int i = 0; i < schemas.size(); i++) {
TSDataType dataType = schemas.get(i).getType();
switch (dataType) {
- case INT32:
- values[i] = new int[maxRowNumber];
- break;
- case INT64:
- values[i] = new long[maxRowNumber];
- break;
- case FLOAT:
- values[i] = new float[maxRowNumber];
- break;
- case DOUBLE:
- values[i] = new double[maxRowNumber];
- break;
- case BOOLEAN:
- values[i] = new boolean[maxRowNumber];
- break;
- case TEXT:
- values[i] = new Binary[maxRowNumber];
- break;
- default:
- throw new UnSupportedDataTypeException(String.format("Data type %s is
not supported.", dataType));
+ case INT32:
+ values[i] = new int[maxRowNumber];
+ break;
+ case INT64:
+ values[i] = new long[maxRowNumber];
+ break;
+ case FLOAT:
+ values[i] = new float[maxRowNumber];
+ break;
+ case DOUBLE:
+ values[i] = new double[maxRowNumber];
+ break;
+ case BOOLEAN:
+ values[i] = new boolean[maxRowNumber];
+ break;
+ case TEXT:
+ values[i] = new Binary[maxRowNumber];
+ break;
+ default:
+ throw new UnSupportedDataTypeException(
+ String.format("Data type %s is not supported.", dataType));
}
}
}
@@ -164,30 +159,30 @@ public class Tablet {
int valueOccupation = 0;
for (int i = 0; i < schemas.size(); i++) {
switch (schemas.get(i).getType()) {
- case BOOLEAN:
- valueOccupation += rowSize;
- break;
- case INT32:
- valueOccupation += rowSize * 4;
- break;
- case INT64:
- valueOccupation += rowSize * 8;
- break;
- case FLOAT:
- valueOccupation += rowSize * 4;
- break;
- case DOUBLE:
- valueOccupation += rowSize * 8;
- break;
- case TEXT:
- valueOccupation += rowSize * 4;
- for (Binary value : (Binary[]) values[i]) {
- valueOccupation += value.getLength();
- }
- break;
- default:
- throw new UnSupportedDataTypeException(
- String.format("Data type %s is not supported.",
schemas.get(i).getType()));
+ case BOOLEAN:
+ valueOccupation += rowSize;
+ break;
+ case INT32:
+ valueOccupation += rowSize * 4;
+ break;
+ case INT64:
+ valueOccupation += rowSize * 8;
+ break;
+ case FLOAT:
+ valueOccupation += rowSize * 4;
+ break;
+ case DOUBLE:
+ valueOccupation += rowSize * 8;
+ break;
+ case TEXT:
+ valueOccupation += rowSize * 4;
+ for (Binary value : (Binary[]) values[i]) {
+ valueOccupation += value.getLength();
+ }
+ break;
+ default:
+ throw new UnSupportedDataTypeException(
+ String.format("Data type %s is not supported.",
schemas.get(i).getType()));
}
}
return valueOccupation;