accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Bob.Thor...@l-3com.com>
Subject RE: Delete All Data In Table
Date Mon, 12 May 2014 22:23:40 GMT
When/if you do the speed comparison would you mind sharing the results?

-----Original Message-----
From: BlackJack76 [mailto:justin.loy@gmail.com] 
Sent: Monday, May 12, 2014 5:22 PM
To: user@accumulo.apache.org
Subject: Re: Delete All Data In Table

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