Skip to content

Commit

Permalink
rename BaseIndex to IndexBase
Browse files Browse the repository at this point in the history
  • Loading branch information
codefollower committed May 6, 2015
1 parent 15fba58 commit 5f5fb9b
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 35 deletions.
Expand Up @@ -17,7 +17,7 @@
*/
package org.lealone.command.router;

import org.lealone.dbobject.index.BaseIndex;
import org.lealone.dbobject.index.IndexBase;
import org.lealone.dbobject.index.Cursor;
import org.lealone.dbobject.index.IndexType;
import org.lealone.dbobject.table.IndexColumn;
Expand All @@ -30,13 +30,13 @@
import org.lealone.result.SearchRow;
import org.lealone.result.SortOrder;

public class MergedIndex extends BaseIndex {
public class MergedIndex extends IndexBase {
private final ResultInterface result;

public MergedIndex(ResultInterface result, Table table, int id, IndexColumn[] columns, IndexType indexType) {
super();
this.result = result;
initBaseIndex(table, id, table.getName() + "_DATA", columns, indexType);
initIndexBase(table, id, table.getName() + "_DATA", columns, indexType);
}

@Override
Expand Down
Expand Up @@ -25,12 +25,12 @@
* An index for a function that returns a result set. This index can only scan
* through all rows, search is not supported.
*/
public class FunctionIndex extends BaseIndex {
public class FunctionIndex extends IndexBase {

private final FunctionTable functionTable;

public FunctionIndex(FunctionTable functionTable, IndexColumn[] columns) {
initBaseIndex(functionTable, 0, null, columns, IndexType.createNonUnique(true));
initIndexBase(functionTable, 0, null, columns, IndexType.createNonUnique(true));
this.functionTable = functionTable;
}

Expand Down
Expand Up @@ -30,7 +30,7 @@
/**
* Most index implementations extend the base index.
*/
public abstract class BaseIndex extends SchemaObjectBase implements Index {
public abstract class IndexBase extends SchemaObjectBase implements Index {

protected IndexColumn[] indexColumns;
protected Column[] columns;
Expand All @@ -49,7 +49,7 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
* not yet known
* @param newIndexType the index type
*/
protected void initBaseIndex(Table newTable, int id, String name, IndexColumn[] newIndexColumns,
protected void initIndexBase(Table newTable, int id, String name, IndexColumn[] newIndexColumns,
IndexType newIndexType) {
initSchemaObjectBase(newTable.getSchema(), id, name, Trace.INDEX);
this.indexType = newIndexType;
Expand Down
Expand Up @@ -20,13 +20,13 @@
/**
* The index implementation for meta data tables.
*/
public class MetaIndex extends BaseIndex {
public class MetaIndex extends IndexBase {

private final MetaTable meta;
private final boolean scan;

public MetaIndex(MetaTable meta, IndexColumn[] columns, boolean scan) {
initBaseIndex(meta, 0, null, columns, IndexType.createNonUnique(true));
initIndexBase(meta, 0, null, columns, IndexType.createNonUnique(true));
this.meta = meta;
this.scan = scan;
}
Expand Down
Expand Up @@ -20,12 +20,12 @@
* An index for the SYSTEM_RANGE table.
* This index can only scan through all rows, search is not supported.
*/
public class RangeIndex extends BaseIndex {
public class RangeIndex extends IndexBase {

private final RangeTable rangeTable;

public RangeIndex(RangeTable table, IndexColumn[] columns) {
initBaseIndex(table, 0, "RANGE_INDEX", columns, IndexType.createNonUnique(true));
initIndexBase(table, 0, "RANGE_INDEX", columns, IndexType.createNonUnique(true));
this.rangeTable = table;
}

Expand Down
Expand Up @@ -38,7 +38,7 @@
* This object represents a virtual index for a query.
* Actually it only represents a prepared SELECT statement.
*/
public class ViewIndex extends BaseIndex {
public class ViewIndex extends IndexBase {

private final TableView view;
private final String querySQL;
Expand All @@ -52,7 +52,7 @@ public class ViewIndex extends BaseIndex {
private final Session createSession;

public ViewIndex(TableView view, String querySQL, ArrayList<Parameter> originalParameters, boolean recursive) {
initBaseIndex(view, 0, null, null, IndexType.createNonUnique(false));
initIndexBase(view, 0, null, null, IndexType.createNonUnique(false));
this.view = view;
this.querySQL = querySQL;
this.originalParameters = originalParameters;
Expand All @@ -63,7 +63,7 @@ public ViewIndex(TableView view, String querySQL, ArrayList<Parameter> originalP
}

public ViewIndex(TableView view, ViewIndex index, Session session, int[] masks) {
initBaseIndex(view, 0, null, null, IndexType.createNonUnique(false));
initIndexBase(view, 0, null, null, IndexType.createNonUnique(false));
this.view = view;
this.querySQL = index.querySQL;
this.originalParameters = index.originalParameters;
Expand Down
Expand Up @@ -8,7 +8,7 @@
import java.util.List;

import org.lealone.cbase.dbobject.table.CBaseTable;
import org.lealone.dbobject.index.BaseIndex;
import org.lealone.dbobject.index.IndexBase;
import org.lealone.dbobject.index.Cursor;
import org.lealone.dbobject.index.IndexType;
import org.lealone.dbobject.table.Column;
Expand All @@ -23,13 +23,13 @@
/**
* An index that delegates indexing to another index.
*/
public class CBaseDelegateIndex extends BaseIndex implements CBaseIndex {
public class CBaseDelegateIndex extends IndexBase implements CBaseIndex {

private final CBasePrimaryIndex mainIndex;

public CBaseDelegateIndex(CBaseTable table, int id, String name, CBasePrimaryIndex mainIndex, IndexType indexType) {
IndexColumn[] cols = IndexColumn.wrap(new Column[] { table.getColumn(mainIndex.getMainIndexColumn()) });
this.initBaseIndex(table, id, name, cols, indexType);
this.initIndexBase(table, id, name, cols, indexType);
this.mainIndex = mainIndex;
if (id < 0) {
throw DbException.throwInternalError("" + name);
Expand Down
Expand Up @@ -13,7 +13,7 @@

import org.lealone.api.ErrorCode;
import org.lealone.cbase.dbobject.table.CBaseTable;
import org.lealone.dbobject.index.BaseIndex;
import org.lealone.dbobject.index.IndexBase;
import org.lealone.dbobject.index.Cursor;
import org.lealone.dbobject.index.IndexType;
import org.lealone.dbobject.table.Column;
Expand All @@ -36,7 +36,7 @@
/**
* A table stored in a MVStore.
*/
public class CBasePrimaryIndex extends BaseIndex {
public class CBasePrimaryIndex extends IndexBase {

/**
* The minimum long value.
Expand All @@ -62,7 +62,7 @@ public class CBasePrimaryIndex extends BaseIndex {
public CBasePrimaryIndex(Session session, CBaseTable table, int id, IndexColumn[] columns, IndexType indexType) {
Database db = session.getDatabase();
this.mvTable = table;
initBaseIndex(table, id, table.getName() + "_DATA", columns, indexType);
initIndexBase(table, id, table.getName() + "_DATA", columns, indexType);
int[] sortTypes = new int[columns.length];
for (int i = 0; i < columns.length; i++) {
sortTypes[i] = SortOrder.ASCENDING;
Expand Down
Expand Up @@ -15,7 +15,7 @@
import org.lealone.api.ErrorCode;
import org.lealone.cbase.dbobject.table.CBaseTable;
import org.lealone.cbase.engine.CBaseStorageEngine;
import org.lealone.dbobject.index.BaseIndex;
import org.lealone.dbobject.index.IndexBase;
import org.lealone.dbobject.index.Cursor;
import org.lealone.dbobject.index.IndexType;
import org.lealone.dbobject.table.Column;
Expand All @@ -39,7 +39,7 @@
/**
* A table stored in a MVStore.
*/
public class CBaseSecondaryIndex extends BaseIndex implements CBaseIndex {
public class CBaseSecondaryIndex extends IndexBase implements CBaseIndex {

/**
* The multi-value table.
Expand All @@ -54,7 +54,7 @@ public CBaseSecondaryIndex(Session session, CBaseTable table, int id, String ind
IndexType indexType) {
Database db = session.getDatabase();
this.mvTable = table;
initBaseIndex(table, id, indexName, columns, indexType);
initIndexBase(table, id, indexName, columns, indexType);
if (!database.isStarting()) {
checkIndexColumnTypes(columns);
}
Expand Down
Expand Up @@ -6,7 +6,7 @@
*/
package org.lealone.cbase.dbobject.index;

import org.lealone.dbobject.index.BaseIndex;
import org.lealone.dbobject.index.IndexBase;
import org.lealone.dbobject.index.Cursor;
import org.lealone.dbobject.index.IndexCondition;
import org.lealone.dbobject.index.IndexType;
Expand All @@ -24,7 +24,7 @@
/**
* An unique index based on an in-memory hash map.
*/
public class HashIndex extends BaseIndex {
public class HashIndex extends IndexBase {

/**
* The index of the indexed column.
Expand All @@ -35,7 +35,7 @@ public class HashIndex extends BaseIndex {
private ValueHashMap<Long> rows;

public HashIndex(TableBase table, int id, String indexName, IndexColumn[] columns, IndexType indexType) {
initBaseIndex(table, id, indexName, columns, indexType);
initIndexBase(table, id, indexName, columns, indexType);
this.indexColumn = columns[0].column.getColumnId();
this.tableData = table;
reset();
Expand Down
Expand Up @@ -17,7 +17,7 @@
*/
package org.lealone.wiredtiger.dbobject.index;

import org.lealone.dbobject.index.BaseIndex;
import org.lealone.dbobject.index.IndexBase;
import org.lealone.dbobject.index.Cursor;
import org.lealone.dbobject.index.IndexType;
import org.lealone.dbobject.table.Column;
Expand All @@ -31,15 +31,15 @@
import org.lealone.result.SortOrder;
import org.lealone.wiredtiger.dbobject.table.WiredTigerTable;

public class WiredTigerDelegateIndex extends BaseIndex {
public class WiredTigerDelegateIndex extends IndexBase {

private final WiredTigerPrimaryIndex mainIndex;

public WiredTigerDelegateIndex(WiredTigerTable table, int id, String name, IndexColumn[] cols,
WiredTigerPrimaryIndex mainIndex, IndexType indexType) {
if (id < 0)
throw DbException.throwInternalError(name);
this.initBaseIndex(table, id, name, cols, indexType);
this.initIndexBase(table, id, name, cols, indexType);
this.mainIndex = mainIndex;
}

Expand Down
Expand Up @@ -18,7 +18,7 @@
package org.lealone.wiredtiger.dbobject.index;

import org.lealone.api.ErrorCode;
import org.lealone.dbobject.index.BaseIndex;
import org.lealone.dbobject.index.IndexBase;
import org.lealone.dbobject.index.Cursor;
import org.lealone.dbobject.index.IndexType;
import org.lealone.dbobject.table.Column;
Expand All @@ -37,7 +37,7 @@
import org.lealone.value.ValueString;
import org.lealone.wiredtiger.dbobject.table.WiredTigerTable;

public class WiredTigerPrimaryIndex extends BaseIndex {
public class WiredTigerPrimaryIndex extends IndexBase {
private final WiredTigerTable table;
private long lastKey;
private int mainIndexColumn = -1;
Expand All @@ -49,7 +49,7 @@ public class WiredTigerPrimaryIndex extends BaseIndex {
public WiredTigerPrimaryIndex(Database db, WiredTigerTable table, int id, //
IndexColumn[] columns, IndexType indexType, com.wiredtiger.db.Session wtSession) {
this.table = table;
initBaseIndex(table, id, table.getName() + "_DATA", columns, indexType);
initIndexBase(table, id, table.getName() + "_DATA", columns, indexType);
int[] sortTypes = new int[columns.length];
for (int i = 0; i < columns.length; i++) {
sortTypes[i] = SortOrder.ASCENDING;
Expand Down
Expand Up @@ -18,7 +18,7 @@
package org.lealone.wiredtiger.dbobject.index;

import org.lealone.api.ErrorCode;
import org.lealone.dbobject.index.BaseIndex;
import org.lealone.dbobject.index.IndexBase;
import org.lealone.dbobject.index.Cursor;
import org.lealone.dbobject.index.IndexType;
import org.lealone.dbobject.table.Column;
Expand All @@ -34,7 +34,7 @@
import org.lealone.value.ValueString;
import org.lealone.wiredtiger.dbobject.table.WiredTigerTable;

public class WiredTigerSecondaryIndex extends BaseIndex {
public class WiredTigerSecondaryIndex extends IndexBase {
private final com.wiredtiger.db.Cursor wtCursor;
private final char[] indexColumnFormat;
private final int indexColumnLength;
Expand All @@ -43,7 +43,7 @@ public class WiredTigerSecondaryIndex extends BaseIndex {
public WiredTigerSecondaryIndex(WiredTigerTable table, int id, String indexName, //
IndexColumn[] columns, IndexType indexType, com.wiredtiger.db.Session wtSession) {
this.table = table;
initBaseIndex(table, id, indexName, columns, indexType);
initIndexBase(table, id, indexName, columns, indexType);
if (!database.isStarting()) {
checkIndexColumnTypes(columns);
}
Expand Down

0 comments on commit 5f5fb9b

Please sign in to comment.