accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bell, Philip S CIV SPAWARSYSCEN-PACIFIC, 81320" <philip.b...@navy.mil>
Subject FW: Deletes not commiting from custom java API but work in shell interface
Date Wed, 10 Apr 2013 22:02:22 GMT
Using the following code, rows are never deleted even when identified and submitted for deletion
to the batchwriter.
After running the code the rows still show up in search.

This has been seen in 1.4.1 and 1.4.2

The same rows can be deleted from the accumulo shell interface

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


for( Entry<Key, Value> e : mainScanner )
{				
	Text currentUUID = e.getKey().getRow();
	
	Text colFam = e.getKey().getColumnFamily();
	Text colQual = e.getKey().getColumnQualifier();
	
	String colVis = e.getKey().getColumnVisibility().toString();
	
	System.out.println( currentUUID + ":" + colFam + ":" + colQual + ":" + colVis + ":" + e.getKey().getTimestamp()
);
	
	if( colFam.toString().equalsIgnoreCase( "root" ) || colVis.length() > 0 )
	{
		Mutation delMutation = new Mutation( currentUUID );
		delMutation.putDelete( colFam, colQual, new ColumnVisibility( colVis ), e.getKey().getTimestamp()
);
		
		System.out.println( "removing" );
		
		try
		{
			bw.addMutation( delMutation );
		}
		catch( MutationsRejectedException e1 )
		{
			e1.printStackTrace();
		}
		
		count++;
		if( count % 1000000 == 0 )
		{
			System.out.println( this.getName() + ": " + count + " completed in " + getTimePassed()
);
		}
	}
}// for each entry found

try
{
	bw.flush();
	bw.close();
}
catch( Exception e1 )
{
	e1.printStackTrace();
}

Mime
View raw message