private Map < String , Map < String , String > > getCurrentScalars ( DBObjectBatch dbObjBatch ) throws IOException { Set < String > objIDSet = new HashSet <> ( ) ; Set < String > fieldNameSet = new HashSet < String > ( ) ; for ( DBObject dbObj : dbObjBatch . getObjects ( ) ) { if ( ! Utils . isEmpty ( dbObj . getObjectID ( ) ) ) { Utils . require ( objIDSet . add ( dbObj . getObjectID ( ) ) , "Cannot update the same object ID twice: " + dbObj . getObjectID ( ) ) ; fieldNameSet . addAll ( dbObj . getUpdatedScalarFieldNames ( m_tableDef ) ) ; } } if ( m_tableDef . isSharded ( ) ) { fieldNameSet . add ( m_tableDef . getShardingField ( ) . getName ( ) ) ; } return SpiderService . instance ( ) . getObjectScalars ( m_tableDef , objIDSet , fieldNameSet ) ; }
Watch and complain about updates to the same ID .