accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BlackJack76 <justin....@gmail.com>
Subject Re: Delete All Data In Table
Date Mon, 12 May 2014 16:54:35 GMT
Josh,

Thanks for the tip!  I was able to delete the data and keep the splits using
the following code:

    String dataTableName = "dataTable";
    String iteratorName = "devNull";
    
    if(conn.tableOperations().exists(dataTableName)) 
    {
      IteratorSetting setting = new IteratorSetting(25, iteratorName,
DevNull.class);

      EnumSet<IteratorScope> scopes = EnumSet.noneOf(IteratorScope.class);
      scopes.add(IteratorScope.minc);
      scopes.add(IteratorScope.majc);
      scopes.add(IteratorScope.scan);

      conn.tableOperations().attachIterator(dataTableName, setting, scopes);
      
      conn.tableOperations().compact(dataTableName, null, null, true, true);

      conn.tableOperations().removeIterator(dataTableName, iteratorName,
scopes); 
    }

I haven't tested out the speed yet to see how it compares to BatchDeleter
but it definitely works.  Thanks for your help!





--
View this message in context: http://apache-accumulo.1065345.n5.nabble.com/Delete-All-Data-In-Table-tp9748p9774.html
Sent from the Users mailing list archive at Nabble.com.

Mime
View raw message