public static Pair<List<Table>, Set<String>>
    getSnapshotableTables(Database catalog, boolean isReplicated) {
        List<Table> tables = new ArrayList<>();
        Set<String> optionalTableNames = new HashSet<>();
        for (Table table : catalog.getTables()) {
            if (table.getIsreplicated() != isReplicated) {
                // We handle replicated tables and partitioned tables separately.
                continue;
            }
            if (isTableExportOnly(catalog, table)) {
                // Streamed tables are not considered as "normal" tables here.
                continue;
            }
            if (table.getMaterializer() != null) {
                if (isSnapshotablePersistentTableView(catalog, table)) {
                    // Some persistent table views are added to the snapshot starting from
                    // V8.2, they are since then considered as "normal" tables, too.
                    // But their presence in the snapshot is not compulsory for backward
                    // compatibility reasons.
                    optionalTableNames.add(table.getTypeName());
                }
                else if (! isSnapshotableStreamedTableView(catalog, table)) {
                    continue;
                }
            }
            tables.add(table);
        }
        return new Pair<List<Table>, Set<String>>(tables, optionalTableNames);
    }
public static Pair < List < Table > , Set < String > > getSnapshotableTables ( Database catalog , boolean isReplicated ) { List < Table > tables = new ArrayList < > ( ) ; Set < String > optionalTableNames = new HashSet < > ( ) ; for ( Table table : catalog . getTables ( ) ) { if ( table . getIsreplicated ( ) != isReplicated ) { continue ; } if ( isTableExportOnly ( catalog , table ) ) { continue ; } if ( table . getMaterializer ( ) != null ) { if ( isSnapshotablePersistentTableView ( catalog , table ) ) { optionalTableNames . add ( table . getTypeName ( ) ) ; } else if ( ! isSnapshotableStreamedTableView ( catalog , table ) ) { continue ; } } tables . add ( table ) ; } return new Pair < List < Table > , Set < String > > ( tables , optionalTableNames ) ; }
Get all snapshot-able tables from the catalog. A snapshot-able table is one
that's neither an export table nor an implicitly partitioned view.
@param catalog         Catalog database
@param isReplicated    true to return only replicated tables,
false to return all partitioned tables
@return A pair that contains a complete list of snapshot-able tables and a list
of names of optional <strong>single persistent table views</strong> without
which the snapshot is still considered as complete (ENG-11578, ENG-14145).