提交 0f76639b authored 作者: Noel Grandin's avatar Noel Grandin

remove some dead code

上级 abd6e502
......@@ -7,13 +7,10 @@ package org.h2.command.ddl;
import org.h2.api.ErrorCode;
import org.h2.command.CommandInterface;
import org.h2.engine.Right;
import org.h2.engine.Session;
import org.h2.message.DbException;
import org.h2.schema.Schema;
import org.h2.table.Table;
import org.h2.table.TableSynonym;
import org.h2.table.TableType;
/**
* This class represents the statement
......
......@@ -14,10 +14,8 @@ import java.nio.charset.Charset;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
import java.util.Map;
import org.h2.engine.Constants;
import org.h2.util.New;
......@@ -741,17 +739,6 @@ public class DataUtils {
return new UnsupportedOperationException(formatMessage(0, message));
}
/**
* Create a new ConcurrentModificationException.
*
* @param message the message
* @return the exception
*/
public static ConcurrentModificationException
newConcurrentModificationException(String message) {
return new ConcurrentModificationException(formatMessage(0, message));
}
/**
* Create a new IllegalStateException.
*
......
......@@ -14,7 +14,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import org.h2.mvstore.type.DataType;
import org.h2.mvstore.type.ObjectDataType;
import org.h2.util.New;
......@@ -128,23 +127,6 @@ public class MVMap<K, V> extends AbstractMap<K, V>
return (V) result;
}
/**
* Add or replace a key-value pair in a branch.
*
* @param root the root page
* @param key the key (may not be null)
* @param value the value (may not be null)
* @return the new root page
*/
synchronized Page putBranch(Page root, K key, V value) {
DataUtils.checkArgument(value != null, "The value may not be null");
long v = writeVersion;
Page p = root.copy(v);
p = splitRootIfNeeded(p, v);
put(p, v, key, value);
return p;
}
/**
* Split the root page if necessary.
*
......@@ -484,30 +466,6 @@ public class MVMap<K, V> extends AbstractMap<K, V>
return get(key) != null;
}
/**
* Get the value for the given key, or null if not found.
*
* @param p the parent page
* @param key the key
* @return the page or null
*/
protected Page binarySearchPage(Page p, Object key) {
int x = p.binarySearch(key);
if (!p.isLeaf()) {
if (x < 0) {
x = -x - 1;
} else {
x++;
}
p = p.getChildPage(x);
return binarySearchPage(p, key);
}
if (x >= 0) {
return p;
}
return null;
}
/**
* Remove all entries.
*/
......
......@@ -916,17 +916,6 @@ public final class MVStore {
}
}
/**
* Whether the chunk at the given position is live.
*
* @param chunkId the chunk id
* @return true if it is live
*/
boolean isChunkLive(int chunkId) {
String s = meta.get(Chunk.getMetaKey(chunkId));
return s != null;
}
/**
* Get the chunk for the given position.
*
......
......@@ -7,8 +7,6 @@ package org.h2.mvstore;
import java.nio.ByteBuffer;
import java.util.HashSet;
import java.util.Set;
import org.h2.compress.Compressor;
import org.h2.mvstore.type.DataType;
import org.h2.util.New;
......@@ -1121,18 +1119,6 @@ public class Page {
}
}
/**
* Collect the set of chunks referenced directly by this page.
*
* @param target the target set
*/
void collectReferencedChunks(Set<Integer> target) {
target.add(DataUtils.getPageChunkId(pos));
for (long p : children) {
target.add(DataUtils.getPageChunkId(p));
}
}
private void removeChild(int index) {
if (index == 0 && children.length == 1) {
children = EMPTY_ARRAY;
......
......@@ -48,11 +48,6 @@ public class MVPrimaryIndex extends BaseIndex {
*/
static final ValueLong MAX = ValueLong.get(Long.MAX_VALUE);
/**
* The zero long value.
*/
static final ValueLong ZERO = ValueLong.get(0);
private final MVTable mvTable;
private final String mapName;
private TransactionMap<Value, Value> dataMap;
......
......@@ -1239,10 +1239,6 @@ public class TransactionStore {
}
}
Object getUndoLog() {
return transaction.store.undoLog;
}
/**
* Get the versioned value for the given key.
*
......
......@@ -11,7 +11,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import org.h2.api.ErrorCode;
import org.h2.jdbc.JdbcSQLException;
import org.h2.test.TestBase;
import org.h2.util.IOUtils;
......
......@@ -274,7 +274,6 @@ class FileReorderWrites extends FileBase {
@Override
public int write(ByteBuffer src, long position) throws IOException {
if (FilePathReorderWrites.isPartialWrites() && src.remaining() > 2) {
final int tmp = src.remaining();
ByteBuffer buf1 = src.slice();
ByteBuffer buf2 = src.slice();
int len1 = src.remaining() / 2;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论