Skip to content

Commit

Permalink
Collect all table names.
Browse files Browse the repository at this point in the history
  • Loading branch information
YangYumings committed Nov 28, 2024
1 parent 99bcaf2 commit fe7b5f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public static void distributeDevices(
Map<Integer, List<DeviceSchema>> clientDataSchema,
List<Sensor> sensors,
Map<String, DeviceSchema> nameDataSchema,
Set<String> groups) {
Set<String> groups,
boolean collectTables) {
Map<Integer, Integer> deviceDistributionForClient =
CommonAlgorithms.distributeDevicesToClients(config.getDEVICE_NUMBER(), clientNumber);
int deviceIndex = MetaUtil.getDeviceId(0);
Expand All @@ -125,6 +126,9 @@ public static void distributeDevices(
deviceSchemasList.add(deviceSchema);
nameDataSchema.putIfAbsent(deviceSchema.getDevice(), deviceSchema);
groups.add(deviceSchema.getGroup());
if(collectTables){
MetaDataSchema.TABLES.add(deviceSchema.getTable());
}
deviceIndex++;
}
clientDataSchema.put(clientId, deviceSchemasList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ public boolean createMetaDataSchema() {
if (sensors == null) {
return false;
}
// schemaClient
// schemaClient, Collect all table names and register them at one time.
MetaUtil.distributeDevices(
config.getSCHEMA_CLIENT_NUMBER(),
SCHEMA_CLIENT_DATA_SCHEMA,
sensors,
NAME_DATA_SCHEMA,
GROUPS);
GROUPS,
true);
// dataClient
MetaUtil.distributeDevices(
config.getDATA_CLIENT_NUMBER(), DATA_CLIENT_DATA_SCHEMA, sensors, NAME_DATA_SCHEMA, GROUPS);
config.getDATA_CLIENT_NUMBER(), DATA_CLIENT_DATA_SCHEMA, sensors, NAME_DATA_SCHEMA, GROUPS, false);
return true;
}
}

0 comments on commit fe7b5f6

Please sign in to comment.