public void close() { if(cache!=null) { cache.delete(); } if(comparator!=null){ comparator.delete(); } if(logger!=null) { logger.delete(); } } }
public NativeOptions comparator(NativeComparator comparator) { if( comparator==null ) { throw new IllegalArgumentException("comparator cannot be null"); } this.comparatorObject = comparator; this.comparator = comparator.pointer(); return this; }
public NativeComparator() { super(ComparatorJNI.create()); try { name_buffer = NativeBuffer.create(name()); globalRef = NativeDB.DBJNI.NewGlobalRef(this); if( globalRef==0 ) { throw new RuntimeException("jni call failed: NewGlobalRef"); } ComparatorJNI struct = new ComparatorJNI(); struct.compare_method = NativeDB.DBJNI.GetMethodID(this.getClass(), "compare", "(JJ)I"); if( struct.compare_method==0 ) { throw new RuntimeException("jni call failed: GetMethodID"); } struct.target = globalRef; struct.name = name_buffer.pointer(); ComparatorJNI.memmove(self, struct, ComparatorJNI.SIZEOF); } catch (RuntimeException e) { delete(); throw e; } }
public abstract int compare(byte[] key1, byte[] key2); public abstract String name();
public NativeComparator() { super(ComparatorJNI.create()); try { name_buffer = NativeBuffer.create(name()); globalRef = NativeDB.DBJNI.NewGlobalRef(this); if( globalRef==0 ) { throw new RuntimeException("jni call failed: NewGlobalRef"); } ComparatorJNI struct = new ComparatorJNI(); struct.compare_method = NativeDB.DBJNI.GetMethodID(this.getClass(), "compare", "(JJ)I"); if( struct.compare_method==0 ) { throw new RuntimeException("jni call failed: GetMethodID"); } struct.target = globalRef; struct.name = name_buffer.pointer(); ComparatorJNI.memmove(self, struct, ComparatorJNI.SIZEOF); } catch (RuntimeException e) { delete(); throw e; } }
public abstract int compare(byte[] key1, byte[] key2); public abstract String name();
public NativeComparator() { super(ComparatorJNI.create()); try { name_buffer = NativeBuffer.create(name()); globalRef = NativeDB.DBJNI.NewGlobalRef(this); if( globalRef==0 ) { throw new RuntimeException("jni call failed: NewGlobalRef"); } ComparatorJNI struct = new ComparatorJNI(); struct.compare_method = NativeDB.DBJNI.GetMethodID(this.getClass(), "compare", "(JJ)I"); if( struct.compare_method==0 ) { throw new RuntimeException("jni call failed: GetMethodID"); } struct.target = globalRef; struct.name = name_buffer.pointer(); ComparatorJNI.memmove(self, struct, ComparatorJNI.SIZEOF); } catch (RuntimeException e) { delete(); throw e; } }
public void close() { if(cache!=null) { cache.delete(); } if(comparator!=null){ comparator.delete(); } if(logger!=null) { logger.delete(); } } }
public NativeOptions comparator(NativeComparator comparator) { if( comparator==null ) { throw new IllegalArgumentException("comparator cannot be null"); } this.comparatorObject = comparator; this.comparator = comparator.pointer(); return this; }
public abstract int compare(byte[] key1, byte[] key2); public abstract String name();
public void close() { if(cache!=null) { cache.delete(); } if(comparator!=null){ comparator.delete(); } if(logger!=null) { logger.delete(); } } }
public NativeOptions comparator(NativeComparator comparator) { if( comparator==null ) { throw new IllegalArgumentException("comparator cannot be null"); } this.comparatorObject = comparator; this.comparator = comparator.pointer(); return this; }
public void close() { if( db!=null ) { db.delete(); db = null; if(cache!=null) { cache.delete(); cache = null; } if(comparator!=null){ comparator.delete(); comparator = null; } if(logger!=null) { logger.delete(); logger = null; } } }
public void close() { if( db!=null ) { db.delete(); db = null; if(cache!=null) { cache.delete(); cache = null; } if(comparator!=null){ comparator.delete(); comparator = null; } if(logger!=null) { logger.delete(); logger = null; } } }
public void close() { if( db!=null ) { db.delete(); db = null; if(cache!=null) { cache.delete(); cache = null; } if(comparator!=null){ comparator.delete(); comparator = null; } if(logger!=null) { logger.delete(); logger = null; } } }