Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code style: add maven plugin and code style #165

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
337 changes: 337 additions & 0 deletions code-style.xml

Large diffs are not rendered by default.

21 changes: 19 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.edu.tsinghua</groupId>
<artifactId>tsfile</artifactId>
Expand Down Expand Up @@ -57,7 +58,7 @@
<connection>scm:git:git://github.com/thulab/tsfile.git</connection>
<developerConnection>scm:git:ssh://github.com:thulab/tsfile.git</developerConnection>
<url>http://github.com/thulab/tsfile/tree/master</url>
<tag>v0.8.0</tag>
<tag>v0.8.0</tag>
</scm>

<distributionManagement>
Expand Down Expand Up @@ -136,6 +137,22 @@

<build>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.7.5</version>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<configFile>${project.basedir}/code-style.xml</configFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
Expand Down
281 changes: 140 additions & 141 deletions src/main/java/cn/edu/tsinghua/tsfile/common/conf/TSFileConfig.java
Original file line number Diff line number Diff line change
@@ -1,141 +1,140 @@
package cn.edu.tsinghua.tsfile.common.conf;

/**
* TSFileConfig is a configure class. Every variables is public and has default
* value.
*
* @author kangrong
*/
public class TSFileConfig {
// Memory configuration
/**
* Memory size threshold for flushing to disk or HDFS, default value is 128MB
*/
public int groupSizeInByte = 128 * 1024 * 1024;
/**
* The memory size for each series writer to pack page, default value is 64KB
*/
public int pageSizeInByte = 64 * 1024;
/**
* The maximum number of data points in a page, defalut value is 1024 * 1024
*/
public int maxNumberOfPointsInPage = 1024 * 1024;

// Data type configuration
/**
* Data type for input timestamp, TsFile supports INT32 or INT64
*/
public String timeSeriesDataType = "INT64";
/**
* Max length limitation of input string
*/
public int maxStringLength = 128;
/**
* Floating-point precision
*/
public int floatPrecision = 2;

// Encoder configuration
/**
* Encoder of time series, TsFile supports TS_2DIFF, PLAIN and RLE(run-length encoding)
* Default value is TS_2DIFF
*/
public String timeSeriesEncoder = "TS_2DIFF";
/**
* Encoder of value series. default value is PLAIN.
* For int, long data type, TsFile also supports TS_2DIFF and RLE(run-length encoding).
* For float, double data type, TsFile also supports TS_2DIFF, RLE(run-length encoding) and GORILLA.
* For text data type, TsFile only supports PLAIN.
*/
public String valueEncoder = "PLAIN";

// RLE configuration
/**
* Default bit width of RLE encoding is 8
*/
public int rleBitWidth = 8;
public final int RLE_MIN_REPEATED_NUM = 8;
public final int RLE_MAX_REPEATED_NUM = 0x7FFF;
public final int RLE_MAX_BIT_PACKED_NUM = 63;

// Gorilla encoding configuration
public final static int FLOAT_LENGTH = 32;
public final static int FLAOT_LEADING_ZERO_LENGTH = 5;
public final static int FLOAT_VALUE_LENGTH = 6;
public final static int DOUBLE_LENGTH = 64;
public final static int DOUBLE_LEADING_ZERO_LENGTH = 6;
public final static int DOUBLE_VALUE_LENGTH = 7;

// TS_2DIFF configuration
/**
* Default block size of two-diff. delta encoding is 128
*/
public int deltaBlockSize = 128;

// Bitmap configuration
public final int BITMAP_BITWIDTH = 1;

// Freq encoder configuration
/**
* Default frequency type is SINGLE_FREQ
*/
public String freqType = "SINGLE_FREQ";
/**
* Default PLA max error is 100
*/
public double plaMaxError = 100;
/**
* Default SDT max error is 100
*/
public double sdtMaxError = 100;
/**
* Default DFT satisfy rate is 0.1
*/
public double dftSatisfyRate = 0.1;

// Compression configuration
/**
* Data compression method, TsFile supports UNCOMPRESSED or SNAPPY.
* Default value is UNCOMPRESSED which means no compression
*/
public String compressor = "UNCOMPRESSED";

// Don't change the following configuration

/**
* Line count threshold for checking page memory occupied size
*/
public int pageCheckSizeThreshold = 100;

/**
* Current version is 3
*/
public static int currentVersion = 3;

/**
* Default endian value is LITTLE_ENDIAN
*/
public String endian = "LITTLE_ENDIAN";

/**
* String encoder with UTF-8 encodes a character to at most 4 bytes.
*/
public static final int BYTE_SIZE_PER_CHAR = 4;

public static final String STRING_ENCODING = "UTF-8";

public static final String CONFIG_FILE_NAME = "tsfile-format.properties";

/**
* The default grow size of class DynamicOneColumnData
*/
public static int dynamicDataSize = 1000;

public static final String MAGIC_STRING = "TsFilev0.7.0";
/**
* only can be used by TsFileDescriptor
*/
protected TSFileConfig() {

}
}
package cn.edu.tsinghua.tsfile.common.conf;

/**
* TSFileConfig is a configure class. Every variables is public and has default value.
*
* @author kangrong
*/
public class TSFileConfig {
// Memory configuration
/**
* Memory size threshold for flushing to disk or HDFS, default value is 128MB
*/
public int groupSizeInByte = 128 * 1024 * 1024;
/**
* The memory size for each series writer to pack page, default value is 64KB
*/
public int pageSizeInByte = 64 * 1024;
/**
* The maximum number of data points in a page, defalut value is 1024 * 1024
*/
public int maxNumberOfPointsInPage = 1024 * 1024;

// Data type configuration
/**
* Data type for input timestamp, TsFile supports INT32 or INT64
*/
public String timeSeriesDataType = "INT64";
/**
* Max length limitation of input string
*/
public int maxStringLength = 128;
/**
* Floating-point precision
*/
public int floatPrecision = 2;

// Encoder configuration
/**
* Encoder of time series, TsFile supports TS_2DIFF, PLAIN and RLE(run-length encoding) Default
* value is TS_2DIFF
*/
public String timeSeriesEncoder = "TS_2DIFF";
/**
* Encoder of value series. default value is PLAIN. For int, long data type, TsFile also supports
* TS_2DIFF and RLE(run-length encoding). For float, double data type, TsFile also supports
* TS_2DIFF, RLE(run-length encoding) and GORILLA. For text data type, TsFile only supports PLAIN.
*/
public String valueEncoder = "PLAIN";

// RLE configuration
/**
* Default bit width of RLE encoding is 8
*/
public int rleBitWidth = 8;
public final int RLE_MIN_REPEATED_NUM = 8;
public final int RLE_MAX_REPEATED_NUM = 0x7FFF;
public final int RLE_MAX_BIT_PACKED_NUM = 63;

// Gorilla encoding configuration
public final static int FLOAT_LENGTH = 32;
public final static int FLAOT_LEADING_ZERO_LENGTH = 5;
public final static int FLOAT_VALUE_LENGTH = 6;
public final static int DOUBLE_LENGTH = 64;
public final static int DOUBLE_LEADING_ZERO_LENGTH = 6;
public final static int DOUBLE_VALUE_LENGTH = 7;

// TS_2DIFF configuration
/**
* Default block size of two-diff. delta encoding is 128
*/
public int deltaBlockSize = 128;

// Bitmap configuration
public final int BITMAP_BITWIDTH = 1;

// Freq encoder configuration
/**
* Default frequency type is SINGLE_FREQ
*/
public String freqType = "SINGLE_FREQ";
/**
* Default PLA max error is 100
*/
public double plaMaxError = 100;
/**
* Default SDT max error is 100
*/
public double sdtMaxError = 100;
/**
* Default DFT satisfy rate is 0.1
*/
public double dftSatisfyRate = 0.1;

// Compression configuration
/**
* Data compression method, TsFile supports UNCOMPRESSED or SNAPPY. Default value is UNCOMPRESSED
* which means no compression
*/
public String compressor = "UNCOMPRESSED";

// Don't change the following configuration

/**
* Line count threshold for checking page memory occupied size
*/
public int pageCheckSizeThreshold = 100;

/**
* Current version is 3
*/
public static int currentVersion = 3;

/**
* Default endian value is LITTLE_ENDIAN
*/
public String endian = "LITTLE_ENDIAN";

/**
* String encoder with UTF-8 encodes a character to at most 4 bytes.
*/
public static final int BYTE_SIZE_PER_CHAR = 4;

public static final String STRING_ENCODING = "UTF-8";

public static final String CONFIG_FILE_NAME = "tsfile-format.properties";

/**
* The default grow size of class DynamicOneColumnData
*/
public static int dynamicDataSize = 1000;

public static final String MAGIC_STRING = "TsFilev0.7.0";

/**
* only can be used by TsFileDescriptor
*/
protected TSFileConfig() {

}
}
Loading