|
|
@ -344,7 +344,7 @@ public class SplitTable implements Index, Iterable<Row.Entry> {
|
|
|
|
|
|
|
|
|
|
|
|
public Row.Entry replace(final Row.Entry row) throws IOException, RowSpaceExceededException {
|
|
|
|
public Row.Entry replace(final Row.Entry row) throws IOException, RowSpaceExceededException {
|
|
|
|
assert row.objectsize() <= this.rowdef.objectsize;
|
|
|
|
assert row.objectsize() <= this.rowdef.objectsize;
|
|
|
|
Index keeper = keeperOf(row.getColBytes(0, true));
|
|
|
|
Index keeper = keeperOf(row.getPrimaryKeyBytes());
|
|
|
|
if (keeper != null) return keeper.replace(row);
|
|
|
|
if (keeper != null) return keeper.replace(row);
|
|
|
|
synchronized (this.tables) {
|
|
|
|
synchronized (this.tables) {
|
|
|
|
assert this.current == null || this.tables.get(this.current) != null : "this.current = " + this.current;
|
|
|
|
assert this.current == null || this.tables.get(this.current) != null : "this.current = " + this.current;
|
|
|
@ -363,8 +363,9 @@ public class SplitTable implements Index, Iterable<Row.Entry> {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public boolean put(final Row.Entry row) throws IOException, RowSpaceExceededException {
|
|
|
|
public boolean put(final Row.Entry row) throws IOException, RowSpaceExceededException {
|
|
|
|
assert row.objectsize() <= this.rowdef.objectsize;
|
|
|
|
assert row.objectsize() <= this.rowdef.objectsize;
|
|
|
|
|
|
|
|
byte[] key = row.getPrimaryKeyBytes();
|
|
|
|
synchronized (this.tables) {
|
|
|
|
synchronized (this.tables) {
|
|
|
|
Index keeper = keeperOf(row.getColBytes(0, true));
|
|
|
|
Index keeper = keeperOf(key);
|
|
|
|
if (keeper != null) return keeper.put(row);
|
|
|
|
if (keeper != null) return keeper.put(row);
|
|
|
|
assert this.current == null || this.tables.get(this.current) != null : "this.current = " + this.current;
|
|
|
|
assert this.current == null || this.tables.get(this.current) != null : "this.current = " + this.current;
|
|
|
|
keeper = (this.current == null) ? newTable() : checkTable(this.tables.get(this.current));
|
|
|
|
keeper = (this.current == null) ? newTable() : checkTable(this.tables.get(this.current));
|
|
|
|