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

Add micro and nano timestamp precision #285

Merged
merged 8 commits into from Jul 23, 2019

Conversation

1160300922
Copy link
Contributor

IoTDB only provide millisecond timestamp. Therefore, I make an effort to help IoTDB recognizing microsecond and nanosecond timestamp while inserting or querying.


public class IoTDBConfigCheck {

// this file is located in Data/System/Schema/system_properties.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// this file is located in Data/System/Schema/system_properties.
// this file is located in data/system/schema/system.properties

public class IoTDBConfigCheck {

// this file is located in Data/System/Schema/system_properties.
// If user delete folder "Data", system_properties can reset.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// If user delete folder "Data", system_properties can reset.
// If user delete folder "data", system.properties can reset.

// If user delete folder "Data", system_properties can reset.
public static final String DEFAULT_FILEPATH = "system.properties";
public static final String PROPERTY_HOME =
"data" + File.separator + "system" + File.separator + "schema";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"data" + File.separator + "system" + File.separator + "schema";
IoTDBDescriptor.getInstance().getConfig().getSystemDIr() + File.separator + "schema";

File dir = new File(filepath);
if (!dir.exists()) {
dir.mkdirs();
logger.info(" {} dir has been made.", PROPERTY_HOME);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.info(" {} dir has been made.", PROPERTY_HOME);
logger.info(" {} dir has been created.", PROPERTY_HOME);

// this file is located in Data/System/Schema/system_properties.
// If user delete folder "Data", system_properties can reset.
public static final String DEFAULT_FILEPATH = "system.properties";
public static final String PROPERTY_HOME =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static final String PROPERTY_HOME =
public static final String SCHEMA_DIR =

private static final Logger logger = LoggerFactory.getLogger(IoTDBDescriptor.class);
private Properties properties = new Properties();
// this is a initial parameter.
public static String TIMESTAMP_PRECISION = "ms";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use a local variable is good


// this file is located in Data/System/Schema/system_properties.
// If user delete folder "Data", system_properties can reset.
public static final String DEFAULT_FILEPATH = "system.properties";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static final String DEFAULT_FILEPATH = "system.properties";
public static final String PROPERTIES_FILE_NAME = "system.properties";

// get existed properties from system_properties.txt
File inputFile = new File(filepath + File.separator + DEFAULT_FILEPATH);
try (FileInputStream inputStream = new FileInputStream(inputFile.toString())) {
properties.load(new InputStreamReader(inputStream, "utf-8"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
properties.load(new InputStreamReader(inputStream, "utf-8"));
properties.load(new InputStreamReader(inputStream, TSFILEConfig.STRING_ENCODING));

@qiaojialin qiaojialin merged commit ab7d2db into apache:master Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants