An error occurred while HBase was performing a bulk delete:
Exception in thread "main" Java.lang.UnsupportedOperationExceptionat Java.util.AbstractList.remove ( Abstractlist.java:161) at Org.apache.hadoop.hbase.client.HTable.delete (Htable.java:852)
This exception is very common, the remove operation is not supported, why do not support the situation? When checking the code, we found that the parameter list was created by Arrays.aslist ().
Obviously, the problem is this place, arrays.aslist () return is actually an implementation arraylist inside the Arrays class:
/** * @serialinclude*/ Private Static classArraylist<e>extendsAbstractlist<e>Implementsrandomaccess, java.io.Serializable {Private Static Final LongSerialversionuid = -2764017481108945198l; Private Finale[] A; ArrayList (e[] array) {if(array==NULL) Throw NewNullPointerException (); A=Array; } Public intsize () {returna.length; } Publicobject[] ToArray () {returnA.clone (); } Public<T>t[] ToArray (t[] a) {intSize =size (); if(A.length <size)returnArrays.copyof ( This. A, size, (Class<?extendsT[]>) A.getclass ()); System.arraycopy ( This. A, 0, a, 0, size); if(A.length >size) A[size]=NULL; returnA; } PublicE Get (intindex) { returnA[index]; } PublicE Set (intindex, E Element) {E OldValue=A[index]; A[index]=element; returnOldValue; } Public intindexOf (Object o) {if(o==NULL) { for(inti=0; i<a.length; i++) if(a[i]==NULL) returni; } Else { for(inti=0; i<a.length; i++) if(O.equals (A[i]))returni; } return-1; } Public Booleancontains (Object o) {returnIndexOf (o)! =-1; } }
Arrays.arraylist inheritance to abstractlist,abstractlist itself does not support delete operations, and arrays.arraylist does not reproduce the Remove method, so if you pass Arrays.aslist () Creates a ArrayList, and if the Remove method is called, a unsupportedoperationexception exception occurs.
Common exceptions encountered by Hbase Delete: Exception in thread "main" java.lang.UnsupportedOperationException