Skip to content

Commit

Permalink
Rename BaseTable (et al) to StoredTable.
Browse files Browse the repository at this point in the history
  • Loading branch information
broneill committed Sep 24, 2024
1 parent 828e883 commit 1fcf94b
Show file tree
Hide file tree
Showing 41 changed files with 198 additions and 200 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/cojen/tupl/remote/ServerIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import org.cojen.tupl.diag.IndexStats;

import org.cojen.tupl.table.BaseTable;
import org.cojen.tupl.table.StoredTable;

/**
*
Expand Down Expand Up @@ -62,7 +62,7 @@ public RemoteTable asTable(String typeName) throws IOException {
throw new IllegalStateException(e);
}

return new ServerTable<>((BaseTable<?>) mView.asTable(clazz));
return new ServerTable<>((StoredTable<?>) mView.asTable(clazz));
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/cojen/tupl/remote/ServerTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import org.cojen.tupl.io.Utils;

import org.cojen.tupl.table.BaseTable;
import org.cojen.tupl.table.StoredTable;
import org.cojen.tupl.table.WeakCache;

/**
Expand All @@ -38,11 +38,11 @@
* @author Brian S O'Neill
*/
final class ServerTable<R> implements RemoteTable {
final BaseTable<R> mTable;
final StoredTable<R> mTable;

private final WeakCache<byte[], RemoteTableProxy, Object> mProxyCache;

ServerTable(BaseTable<R> table) throws IOException {
ServerTable(StoredTable<R> table) throws IOException {
mTable = table;

mProxyCache = new WeakCache<>() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cojen/tupl/table/AutoCommitUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
final class AutoCommitUpdater<R> extends BasicUpdater<R> {
LockResult mLockResult;

AutoCommitUpdater(BaseTable<R> table, ScanController<R> controller) {
AutoCommitUpdater(StoredTable<R> table, ScanController<R> controller) {
super(table, controller);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cojen/tupl/table/AutoUnlockScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @author Brian S O'Neill
*/
final class AutoUnlockScanner<R> extends TxnResetScanner<R> {
AutoUnlockScanner(BaseTable<R> table, ScanController<R> controller) {
AutoUnlockScanner(StoredTable<R> table, ScanController<R> controller) {
super(table, controller);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/cojen/tupl/table/BasicScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
* @author Brian S O'Neill
*/
class BasicScanner<R> implements Scanner<R> {
final BaseTable<R> mTable;
final StoredTable<R> mTable;
final ScanController<R> mController;

Cursor mCursor;
RowEvaluator<R> mEvaluator;

R mRow;

BasicScanner(BaseTable<R> table, ScanController<R> controller) {
BasicScanner(StoredTable<R> table, ScanController<R> controller) {
mTable = table;
mController = controller;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cojen/tupl/table/BasicUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
class BasicUpdater<R> extends BasicScanner<R> implements Updater<R> {
TreeSet<byte[]> mKeysToSkip;

BasicUpdater(BaseTable<R> table, ScanController<R> controller) {
BasicUpdater(StoredTable<R> table, ScanController<R> controller) {
super(table, controller);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cojen/tupl/table/DecodePartialMaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* Makes a call site which decodes rows partially.
*
* @author Brian S O'Neill
* @see BaseTable#decodePartialHandle
* @see StoredTable#decodePartialHandle
*/
public class DecodePartialMaker {
private DecodePartialMaker() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cojen/tupl/table/DynamicTableMaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class DynamicTableMaker extends TableMaker {

/**
* Return a constructor which accepts a (TableManager, Index, RowPredicateLock) and returns
* a BaseTable or BaseTableIndex implementation.
* a StoredTable or StoredTableIndex implementation.
*/
MethodHandle finish() {
String suffix = isPrimaryTable() ? "table" : "unjoined";
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/cojen/tupl/table/FilteredScanMaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
public class FilteredScanMaker<R> {
private final WeakReference<RowStore> mStoreRef;
private final byte[] mSecondaryDescriptor;
private final BaseTable<R> mTable;
private final StoredTable<R> mTable;
private final Class<?> mPrimaryTableClass;
private final SingleScanController<R> mUnfiltered;
private final Class<?> mPredicateClass;
Expand Down Expand Up @@ -104,7 +104,7 @@ public class FilteredScanMaker<R> {
* @param joinFilter the filter to apply after joining, or null if none
* @param projection null if all columns are to be decoded
*/
public FilteredScanMaker(WeakReference<RowStore> storeRef, BaseTable<R> table, RowGen rowGen,
public FilteredScanMaker(WeakReference<RowStore> storeRef, StoredTable<R> table, RowGen rowGen,
SingleScanController<R> unfiltered,
Class<? extends RowPredicate> predClass,
RowFilter lowBound, RowFilter highBound,
Expand Down Expand Up @@ -908,7 +908,7 @@ public Object apply(int schemaVersion) {
} else {
filter = mFilterRef.get();
if (filter == null) {
filter = BaseTable.parseFilter(mRowType, mFilterStr);
filter = StoredTable.parseFilter(mRowType, mFilterStr);
mFilterRef = new WeakReference<>(filter);
}
}
Expand All @@ -934,7 +934,7 @@ public Object apply(int schemaVersion) {
.invokeExact(schemaVersion);
} else {
// Obtain the MethodHandle which decodes the key and value columns.
BaseTable<?> table = store.findTable(mIndexId, mRowType);
StoredTable<?> table = store.findTable(mIndexId, mRowType);
decoder = table.decodePartialHandle(mProjectionSpec, schemaVersion);
valueDecoder = null;
}
Expand Down Expand Up @@ -1032,7 +1032,7 @@ private void addWriteRowMethod() {
var keyVar = mm.param(1);
var valueVar = mm.param(2);

BaseTable<R> table = mTable;
StoredTable<R> table = mTable;

if (mAlwaysJoin) {
table = table.joinedPrimaryTable();
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/cojen/tupl/table/IndexSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ final class IndexSelector<R> {
private boolean mMultipleSelections;

private ColumnSet[] mSelectedIndexes;
private BaseTable[] mSelectedIndexTables;
private StoredTable[] mSelectedIndexTables;
private QuerySpec[] mSelectedQueries;
private boolean[] mSelectedReverse;
private OrderBy mOrderBy;
Expand All @@ -74,7 +74,7 @@ final class IndexSelector<R> {
* verification
* @throws IOException only can be thrown if a table was provided
*/
IndexSelector(BaseTable<R> table, RowInfo primaryInfo, QuerySpec query, boolean forUpdate)
IndexSelector(StoredTable<R> table, RowInfo primaryInfo, QuerySpec query, boolean forUpdate)
throws IOException
{
mPrimaryInfo = primaryInfo;
Expand All @@ -91,7 +91,7 @@ final class IndexSelector<R> {
break;
}

BaseTable[] selectedIndexTables = new BaseTable[numSelected()];
StoredTable[] selectedIndexTables = new StoredTable[numSelected()];

for (int i=0; i<selectedIndexTables.length; i++) {
ColumnSet subIndex = selectedIndex(i);
Expand All @@ -101,7 +101,7 @@ final class IndexSelector<R> {
continue;
}

BaseTable<R> subTable;
StoredTable<R> subTable;

if (mAlternateKeys.contains(subIndex)) {
// Alternate key.
Expand Down Expand Up @@ -412,7 +412,7 @@ ColumnSet selectedIndex(int i) {
* @throws NullPointerException if no base table was provided to the constructor
*/
@SuppressWarnings("unchecked")
BaseTable<R> selectedIndexTable(int i) {
StoredTable<R> selectedIndexTable(int i) {
return mSelectedIndexTables[i];
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/cojen/tupl/table/IndexTriggerMaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ IndexBackfill<R> makeBackfill(RowStore rs, long primaryIndexId,
* @param primaryIndexId primary index id
*/
@SuppressWarnings("unchecked")
Trigger<R> makeTrigger(RowStore rs, long primaryIndexId, BaseTable<R> table) {
Trigger<R> makeTrigger(RowStore rs, long primaryIndexId, StoredTable<R> table) {
mClassMaker = mPrimaryGen.beginClassMaker(IndexTriggerMaker.class, mRowType, "trigger");
mClassMaker.extend(Trigger.class).final_();

Expand Down Expand Up @@ -633,7 +633,7 @@ public static SwitchCallSite indyDelete(MethodHandles.Lookup lookup, String name
* @param define delegate to the non-partial variant when false
* @return true if always requires a row instance
*/
private boolean addStoreMethod(String variant, boolean define, BaseTable<R> table) {
private boolean addStoreMethod(String variant, boolean define, StoredTable<R> table) {
MethodMaker mm = mClassMaker.addMethod
(null, variant, Transaction.class, Object.class,
byte[].class, byte[].class, byte[].class).public_();
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/cojen/tupl/table/JoinedTableMaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import org.cojen.tupl.table.filter.ColumnFilter;

/**
* Makes Table classes that extend BaseTableIndex for secondary index tables that can join to
* Makes Table classes that extend StoredTableIndex for secondary index tables that can join to
* the primary table.
*
* @author Brian S O'Neill
Expand Down Expand Up @@ -76,7 +76,7 @@ public class JoinedTableMaker extends TableMaker {

/**
* Return a constructor which accepts a (Index, RowPredicateLock, TableImpl primary,
* TableImpl unjoined) and returns a BaseTableIndex implementation.
* TableImpl unjoined) and returns a StoredTableIndex implementation.
*/
MethodHandle finish() {
Objects.requireNonNull(mPrimaryTableClass);
Expand Down Expand Up @@ -108,7 +108,7 @@ MethodHandle finish() {

{
MethodMaker mm = mClassMaker.addMethod
(BaseTable.class, "joinedPrimaryTable").protected_();
(StoredTable.class, "joinedPrimaryTable").protected_();
mm.return_(mm.field("primaryTable"));
}

Expand All @@ -135,14 +135,14 @@ MethodHandle finish() {

addJoinedLoadMethod();

// Override the methods inherited from the unjoined class, defined in BaseTable.
// Override the methods inherited from the unjoined class, defined in StoredTable.
addJoinedUnfilteredMethods();

// Override the methods inherited from the unjoined class, defined in ScanControllerFactory.
addPlanMethod(0b10);
addPlanMethod(0b11); // reverse option

// Override the method inherited from BaseTableIndex.
// Override the method inherited from StoredTableIndex.
MethodMaker mm = mClassMaker.addMethod
(Updater.class, "newUpdater",
Object.class, Transaction.class, ScanController.class);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cojen/tupl/table/JoinedUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class JoinedUpdater<R> extends BasicScanner<R> implements Updater<R> {

private Cursor mPrimaryCursor;

JoinedUpdater(BaseTableIndex<R> table, ScanController<R> controller,
JoinedUpdater(StoredTableIndex<R> table, ScanController<R> controller,
BasicUpdater<R> primaryUpdater)
{
super(table, controller);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @author Brian S O'Neill
*/
public final class LoadOneQueryLauncher<R> extends ScanQueryLauncher<R> {
LoadOneQueryLauncher(BaseTable<R> table, ScanControllerFactory<R> factory) {
LoadOneQueryLauncher(StoredTable<R> table, ScanControllerFactory<R> factory) {
super(table, factory);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cojen/tupl/table/MappedTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ private InverseMapper<S, T> makeInverseMapper(int mode) {

// Only attempt to check that the source columns are set if the source table type is
// expected to have the special check methods defined.
boolean checkSet = BaseTable.class.isAssignableFrom(mSource.getClass());
boolean checkSet = StoredTable.class.isAssignableFrom(mSource.getClass());

Class<?> sourceRowType = mSource.rowType();
if (checkSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
final class NonRepeatableUpdater<R> extends BasicUpdater<R> {
LockResult mLockResult;

NonRepeatableUpdater(BaseTable<R> table, ScanController<R> controller) {
NonRepeatableUpdater(StoredTable<R> table, ScanController<R> controller) {
super(table, controller);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public MethodHandle newValue(TupleKey key, RowFilter filter) {
var rowType = (Class<?>) key.get(0);
String query = key.getString(1);
if (filter == null) {
filter = BaseTable.parseFilter(rowType, query);
filter = StoredTable.parseFilter(rowType, query);
}
String filterStr = filter.toString();
if (filterStr.equals(query)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cojen/tupl/table/QueryLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public abstract void scanWrite(Transaction txn, RowWriter writer, Object... args
public abstract QueryPlan updaterPlan(Transaction txn, Object... args) throws IOException;

/**
* Is called when the BaseTable is closed, in order to close all the secondary indexes
* Is called when the StoredTable is closed, in order to close all the secondary indexes
* referenced by this query. This method must not be public.
*/
protected abstract void closeIndexes() throws IOException;
Expand Down
Loading

0 comments on commit 1fcf94b

Please sign in to comment.