@Override public long getRowCount(Session session) { TransactionMap<SpatialKey, Value> map = getMap(session); return map.sizeAsLong(); }
@Override public void truncate(Session session) { TransactionMap<SpatialKey, Value> map = getMap(session); map.clear(); }
@Override public void remove(Session session) { TransactionMap<SpatialKey, Value> map = getMap(session); if (!map.isClosed()) { Transaction t = session.getTransaction(); t.removeMap(map); } }
private Cursor find(Session session) { Iterator<SpatialKey> cursor = spatialMap.keyIterator(null); TransactionMap<SpatialKey, Value> map = getMap(session); Iterator<SpatialKey> it = map.wrapIterator(cursor, false); return new MVStoreCursor(session, it); }
@Override public Cursor findByGeometry(TableFilter filter, SearchRow first, SearchRow last, SearchRow intersection) { Session session = filter.getSession(); if (intersection == null) { return find(session, first, last); } Iterator<SpatialKey> cursor = spatialMap.findIntersectingKeys(getKey(intersection)); TransactionMap<SpatialKey, Value> map = getMap(session); Iterator<SpatialKey> it = map.wrapIterator(cursor, false); return new MVStoreCursor(session, it); }
@Override public void remove(Session session, Row row) { SpatialKey key = getKey(row); if (key.isNull()) { return; } TransactionMap<SpatialKey, Value> map = getMap(session); try { Value old = map.remove(key); if (old == null) { old = map.remove(key); throw DbException.get(ErrorCode.ROW_NOT_FOUND_WHEN_DELETING_1, getSQL() + ": " + row.getKey()); } } catch (IllegalStateException e) { throw mvTable.convertException(e); } }
@Override public void add(Session session, Row row) { TransactionMap<SpatialKey, Value> map = getMap(session); SpatialKey key = getKey(row);
@Override public long getRowCount(Session session) { TransactionMap<SpatialKey, Value> map = getMap(session); return map.sizeAsLong(); }
@Override public long getRowCount(Session session) { TransactionMap<SpatialKey, Value> map = getMap(session); return map.sizeAsLong(); }
@Override public void truncate(Session session) { TransactionMap<SpatialKey, Value> map = getMap(session); map.clear(); }
@Override public void truncate(Session session) { TransactionMap<SpatialKey, Value> map = getMap(session); map.clear(); }
private Cursor find(Session session) { Iterator<SpatialKey> cursor = spatialMap.keyIterator(null); TransactionMap<SpatialKey, Value> map = getMap(session); Iterator<SpatialKey> it = map.wrapIterator(cursor, false); return new MVStoreCursor(session, it); }
@Override public void remove(Session session) { TransactionMap<SpatialKey, Value> map = getMap(session); if (!map.isClosed()) { Transaction t = mvTable.getTransaction(session); t.removeMap(map); } }
private Cursor find(Session session) { Iterator<SpatialKey> cursor = spatialMap.keyIterator(null); TransactionMap<SpatialKey, Value> map = getMap(session); Iterator<SpatialKey> it = map.wrapIterator(cursor, false); return new MVStoreCursor(session, it); }
@Override public void remove(Session session) { TransactionMap<SpatialKey, Value> map = getMap(session); if (!map.isClosed()) { Transaction t = mvTable.getTransaction(session); t.removeMap(map); } }
@Override public Cursor findByGeometry(TableFilter filter, SearchRow first, SearchRow last, SearchRow intersection) { Session session = filter.getSession(); if (intersection == null) { return find(session, first, last); } Iterator<SpatialKey> cursor = spatialMap.findIntersectingKeys(getKey(intersection)); TransactionMap<SpatialKey, Value> map = getMap(session); Iterator<SpatialKey> it = map.wrapIterator(cursor, false); return new MVStoreCursor(session, it); }
@Override public Cursor findByGeometry(TableFilter filter, SearchRow first, SearchRow last, SearchRow intersection) { Session session = filter.getSession(); if (intersection == null) { return find(session, first, last); } Iterator<SpatialKey> cursor = spatialMap.findIntersectingKeys(getKey(intersection)); TransactionMap<SpatialKey, Value> map = getMap(session); Iterator<SpatialKey> it = map.wrapIterator(cursor, false); return new MVStoreCursor(session, it); }
@Override public void remove(Session session, Row row) { SpatialKey key = getKey(row); TransactionMap<SpatialKey, Value> map = getMap(session); try { Value old = map.remove(key); if (old == null) { old = map.remove(key); throw DbException.get(ErrorCode.ROW_NOT_FOUND_WHEN_DELETING_1, getSQL() + ": " + row.getKey()); } } catch (IllegalStateException e) { throw mvTable.convertException(e); } }
@Override public void remove(Session session, Row row) { SpatialKey key = getKey(row); if (key.isNull()) { return; } TransactionMap<SpatialKey, Value> map = getMap(session); try { Value old = map.remove(key); if (old == null) { old = map.remove(key); throw DbException.get(ErrorCode.ROW_NOT_FOUND_WHEN_DELETING_1, getSQL() + ": " + row.getKey()); } } catch (IllegalStateException e) { throw mvTable.convertException(e); } }
@Override public void add(Session session, Row row) { TransactionMap<SpatialKey, Value> map = getMap(session); SpatialKey key = getKey(row); if (indexType.isUnique()) {