To remove an IMDC, use the method InMemoryDataCollectionRepository::removeInMemoryDataCollection, specifying the IMDC name.
You cannot remove an IMDC during contract negotiation.
-
Call the method InMemoryDataCollectionRepository::removeInMemoryDataCollection:
import java.util.List; import java.util.ArrayList; import com.asterdata.ncluster.sqlmr.RowFunction; import com.asterdata.ncluster.sqlmr.data.RowEmitter; import com.asterdata.ncluster.sqlmr.data.RowIterator; import com.asterdata.ncluster.sqlmr.InMemoryDataCollectionRepository; import com.asterdata.ncluster.sqlmr.data.InMemoryDataCollection; import com.asterdata.ncluster.sqlmr.InMemoryDataCollectionDoesNotExistException; ... public void operateOnSomeRows(RowIterator inputIterator, outputEmitter) { ... try { //Remove IMDC "IMDC_name" //Throws InMemoryDataCollectionDoesNotExistException if IMDC is not found InMemoryDataCollectionRepository.removeInMemoryDataCollection("IMDC_name"); } catch(InMemoryDataCollectionDoesNotExistException nonExistentIMDCEx){ } ... }
Now the IMDC is nonexistent.