private void cacheShardValue ( TableDefinition tableDef , Integer shardNumber , Date shardStart ) { // Get or create the app name -> table map String appName = tableDef . getAppDef ( ) . getAppName ( ) ; Map < String , Map < Integer , Date > > tableShardNumberMap = m_appShardMap . get ( appName ) ; if ( tableShardNumberMap == null ) { tableShardNumberMap = new HashMap < String , Map < Integer , Date > > ( ) ; m_appShardMap . put ( appName , tableShardNumberMap ) ; } // Get or create the table name -> shard number map String tableName = tableDef . getTableName ( ) ; Map < Integer , Date > shardNumberMap = tableShardNumberMap . get ( tableName ) ; if ( shardNumberMap == null ) { shardNumberMap = new HashMap < Integer , Date > ( ) ; tableShardNumberMap . put ( tableName , shardNumberMap ) ; } // Add the shard number -> start date shardNumberMap . put ( shardNumber , shardStart ) ; m_logger . debug ( "Sharding date for {}.{} shard #{} set to: {} ({})" , new Object [ ] { appName , tableName , shardNumber , shardStart . getTime ( ) , Utils . formatDateUTC ( shardStart ) } ) ; }
Cache the given shard .