public String getState() { switch(state) { case IN_DOUBT: return "IN_DOUBT"; case COMMIT: return "COMMIT"; case ROLLBACK: return "ROLLBACK"; default: throw Message.getInternalError("state="+state); } }
public void setPos(int pos) { if (SysProperties.CHECK && (previous != null || next != null || chained != null)) { throw Message.getInternalError("setPos too late"); } this.pos = pos; }
private void addToFront(CacheObject rec) { if (SysProperties.CHECK && rec == head) { throw Message.getInternalError("try to move head"); } rec.next = head; rec.previous = head.previous; rec.previous.next = rec; head.previous = rec; }
public void setIndexOwner(Index index) { if (this.index == index) { indexOwner = true; } else if (this.refIndex == index) { refIndexOwner = true; } else { throw Message.getInternalError(); } }
/** * INTERNAL */ public String createTempFile() throws SQLException { throw Message.getInternalError(); }
public ConditionAndOr(int andOrType, Expression left, Expression right) { this.andOrType = andOrType; this.left = left; this.right = right; if (SysProperties.CHECK && (left == null || right == null)) { throw Message.getInternalError(); } }
public static void checkPowerOf2(int len) { if ((len & (len - 1)) != 0 && len > 0) { throw Message.getInternalError("not a power of 2: " + len); } }
private void removeFromLinkedList(CacheObject rec) { if (SysProperties.CHECK && rec == head) { throw Message.getInternalError("try to remove head"); } rec.previous.next = rec.next; rec.next.previous = rec.previous; // TODO cache: mystery: why is this required? needs more memory if we // don't do this rec.next = null; rec.previous = null; }
/** * INTERNAL */ public int allocateObjectId(boolean b, boolean c) { throw Message.getInternalError(); }
public void encrypt(byte[] buff, int off, int len) { if (SysProperties.CHECK && (len % ALIGN != 0)) { throw Message.getInternalError("unaligned len " + len); } for (int i = off; i < off + len; i += 16) { encryptBlock(buff, buff, i); } }
public String getProperty(String key, String defaultValue) { if (SysProperties.CHECK && !KNOWN_SETTINGS.contains(key)) { throw Message.getInternalError(key); } String s = getProperty(key); return s == null ? defaultValue : s; }
public void encrypt(byte[] bytes, int off, int len) { if (SysProperties.CHECK && (len % ALIGN != 0)) { throw Message.getInternalError("unaligned len " + len); } for (int i = off; i < off + len; i += 8) { encryptBlock(bytes, bytes, i); } }
public void decrypt(byte[] bytes, int off, int len) { if (SysProperties.CHECK && (len % ALIGN != 0)) { throw Message.getInternalError("unaligned len " + len); } for (int i = off; i < off + len; i += 8) { decryptBlock(bytes, bytes, i); } }
public static void stopAutoDelete(Reference ref, String fileName) { FileUtils.trace("TempFileDeleter.stopAutoDelete", fileName, ref); if (ref != null) { TempFile f2 = (TempFile) REF_MAP.remove(ref); if (SysProperties.CHECK && (f2 == null || !f2.fileName.equals(fileName))) { throw Message.getInternalError("f2:" + f2 + " " + (f2 == null ? "" : f2.fileName) + " f:" + fileName); } } deleteUnused(); }
public void add(SchemaObject obj) throws SQLException { if (SysProperties.CHECK && obj.getSchema() != this) { throw Message.getInternalError("wrong schema"); } String name = obj.getName(); HashMap map = getMap(obj.getType()); if (SysProperties.CHECK && map.get(name) != null) { throw Message.getInternalError("object already exists"); } map.put(name, obj); freeUniqueName(name); }
SearchRow getFirst(Session session) throws SQLException { if (pageData.size() == 0) { if (!Constants.ALLOW_EMPTY_BTREE_PAGES && !root) { throw Message.getInternalError("Empty btree page"); } return null; } return (SearchRow) pageData.get(0); }
public void remove(Session session, SchemaObject obj) throws SQLException { String objName = obj.getName(); HashMap map = getMap(obj.getType()); if (SysProperties.CHECK && !map.containsKey(objName)) { throw Message.getInternalError("not found: " + objName); } map.remove(objName); freeUniqueName(objName); }
private void checkRowCount(Session session, Index index, int offset) { if (SysProperties.CHECK && !database.isMultiVersion()) { long rc = index.getRowCount(session); if (rc != rowCount + offset) { throw Message.getInternalError("rowCount expected " + (rowCount + offset) + " got " + rc + " " + getName() + "." + index.getName()); } } }
public void removeDistinct(Value[] values) throws SQLException { if (!distinct) { throw Message.getInternalError(); } if (distinctRows != null) { ValueArray array = ValueArray.get(values); distinctRows.remove(array); rowCount = distinctRows.size(); } else { rowCount = disk.removeRow(values); } }
private void checkMetaFree(Session session, int id) throws SQLException { SearchRow r = meta.getTemplateSimpleRow(false); r.setValue(0, ValueInt.get(id)); Cursor cursor = metaIdIndex.find(session, r, r); if (cursor.next()) { throw Message.getInternalError(); } }