Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public interface IDeviceID extends Comparable<IDeviceID>, Accountable, Serializa

boolean isEmpty();

boolean isTableModel();

/**
* @return the table name associated with the device. For a path-DeviceId, like "root.a.b.c.d", it
* is converted according to a fixed rule, like assuming the first three levels ("root.a.b")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ public boolean isEmpty() {
return deviceID.isEmpty();
}

@Override
public boolean isTableModel() {
return false;
}

@Override
public long ramBytesUsed() {
long size = INSTANCE_SIZE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import java.util.Arrays;
import java.util.Objects;

import static org.apache.tsfile.common.constant.TsFileConstant.PATH_ROOT;
import static org.apache.tsfile.common.constant.TsFileConstant.PATH_SEPARATOR;

public class StringArrayDeviceID implements IDeviceID {
Expand Down Expand Up @@ -222,11 +221,6 @@ public boolean isEmpty() {
return segments == null || segments.length == 0;
}

@Override
public boolean isTableModel() {
return !segments[0].startsWith(PATH_ROOT + PATH_SEPARATOR);
}

@Override
public String toString() {
return String.join(PATH_SEPARATOR, segments);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public void endCurrentChunk() {
chunkMetadataCount++;
if (recordTablePointCount
&& currentChunkGroupDeviceId != null
&& currentChunkGroupDeviceId.isTableModel()
&& schema.getTableSchemaMap().containsKey(currentChunkGroupDeviceId.getTableName())
&& (currentChunkMetadata.getMask() & TsFileConstant.TIME_COLUMN_MASK) == 0) {
tablePointCountMap.merge(
currentChunkGroupDeviceId.getTableName(),
Expand Down Expand Up @@ -956,7 +956,7 @@ private void updateTableSize(IDeviceID currentStartChunkGroupDeviceId) throws IO
// endFile
boolean endFile = currentStartChunkGroupDeviceId == null;
if (endFile
|| (currentStartChunkGroupDeviceId.isTableModel()
|| (schema.getTableSchemaMap().containsKey(currentStartChunkGroupDeviceId.getTableName())
&& !currentStartChunkGroupDeviceId.getTableName().equals(currentTable))) {
if (currentTable != null) {
long size = currentPosition - currentTableStartOffset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ public void testStartWith() {
assertTrue(deviceID.startWith("root.a"));
}

@Test
public void testIsTableModel() {
IDeviceID deviceID = Factory.DEFAULT_FACTORY.create("root.a.b.c.d");
assertFalse(deviceID.isTableModel());
deviceID = Factory.DEFAULT_FACTORY.create("root.b.c");
assertFalse(deviceID.isTableModel());
deviceID = Factory.DEFAULT_FACTORY.create("roota.b.c.d");
assertTrue(deviceID.isTableModel());
}

@Test
public void testMatchDatabaseName() {
IDeviceID deviceID = Factory.DEFAULT_FACTORY.create("root.a.b.c.d");
Expand Down
Loading