Skip to content

Commit 5d4f532

Browse files
committed
Update TsTable.java
1 parent f2eb47e commit 5d4f532

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table

iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/TsTable.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,19 @@ public TsTableColumnSchema getColumnSchema(final String columnName) {
141141
}
142142
}
143143

144+
// No need to acquire lock, because the time column is fixed after table creation
145+
// And the inner name is protected by the volatile keyword
146+
public TsTableColumnSchema getTimeColumnSchema() {
147+
if (Objects.isNull(timeColumnSchema)) {
148+
timeColumnSchema =
149+
columnSchemaMap.values().stream()
150+
.filter(column -> column instanceof TimeColumnSchema)
151+
.findFirst()
152+
.orElse(null);
153+
}
154+
return timeColumnSchema;
155+
}
156+
144157
/**
145158
* Execute a write operation with optimistic lock support. This method handles the write flag and
146159
* version increment automatically.

0 commit comments

Comments
 (0)