public void ensureTablesExist ( final TSDB tsdb ) { final List < Deferred < Object > > deferreds = new ArrayList < Deferred < Object > > ( forward_intervals . size ( ) * 2 ) ; for ( RollupInterval interval : forward_intervals . values ( ) ) { deferreds . add ( tsdb . getClient ( ) . ensureTableExists ( interval . getTemporalTable ( ) ) ) ; deferreds . add ( tsdb . getClient ( ) . ensureTableExists ( interval . getGroupbyTable ( ) ) ) ; } try { Deferred . group ( deferreds ) . joinUninterruptibly ( ) ; } catch ( DeferredGroupException e ) { throw new RuntimeException ( e . getCause ( ) ) ; } catch ( InterruptedException e ) { LOG . warn ( "Interrupted" , e ) ; Thread . currentThread ( ) . interrupt ( ) ; } catch ( Exception e ) { throw new RuntimeException ( "Unexpected exception" , e ) ; } }
Makes sure each of the rollup tables exists