public Memtable getMemtableFor ( OpOrder . Group opGroup , ReplayPosition replayPosition ) { // since any new memtables appended to the list after we fetch it will be for operations started // after us, we can safely assume that we will always find the memtable that 'accepts' us; // if the barrier for any memtable is set whilst we are reading the list, it must accept us. // there may be multiple memtables in the list that would 'accept' us, however we only ever choose // the oldest such memtable, as accepts() only prevents us falling behind (i.e. ensures we don't // assign operations to a memtable that was retired/queued before we started) for ( Memtable memtable : view . get ( ) . liveMemtables ) { if ( memtable . accepts ( opGroup , replayPosition ) ) return memtable ; } throw new AssertionError ( view . get ( ) . liveMemtables . toString ( ) ) ; }
get the Memtable that the ordered writeOp should be directed to