public String getDatabaseNameByDevice(final IDeviceID deviceID) {
    final List<String> databases = getDatabaseNames(null);
    for (final String database : databases) {
      if (PathUtils.isStartWith(deviceID, database)) {
        return database;
      }
    }
    return "";
  }
Only leader use this interface.

@return The DatabaseName of the specified Device. Empty String if not exists.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/schema/ClusterSchemaManager.java