removed option to use different primary keys in kelondro tables

this option was never used and there is also no use to set other columns but the first as the primary key. as a result, access methods to the key do not need to compute key positions, and they work faster.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5711 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2009-03-13 16:52:31 +00:00
parent 7f67238f8b
commit 7dff1cba62
35 changed files with 77 additions and 99 deletions

View File

@ -104,7 +104,7 @@ public class Supporter {
//accumulateVotes(negativeHashes, positiveHashes, yacyNewsPool.OUTGOING_DB); //accumulateVotes(negativeHashes, positiveHashes, yacyNewsPool.OUTGOING_DB);
//accumulateVotes(negativeHashes, positiveHashes, yacyNewsPool.PUBLISHED_DB); //accumulateVotes(negativeHashes, positiveHashes, yacyNewsPool.PUBLISHED_DB);
final ScoreCluster<String> ranking = new ScoreCluster<String>(); // score cluster for url hashes final ScoreCluster<String> ranking = new ScoreCluster<String>(); // score cluster for url hashes
final Row rowdef = new Row("String url-255, String title-120, String description-120, String refid-" + (DateFormatter.PATTERN_SHORT_SECOND.length() + 12), NaturalOrder.naturalOrder, 0); final Row rowdef = new Row("String url-255, String title-120, String description-120, String refid-" + (DateFormatter.PATTERN_SHORT_SECOND.length() + 12), NaturalOrder.naturalOrder);
final HashMap<String, Entry> Supporter = new HashMap<String, Entry>(); // a mapping from an url hash to a kelondroRow.Entry with display properties final HashMap<String, Entry> Supporter = new HashMap<String, Entry>(); // a mapping from an url hash to a kelondroRow.Entry with display properties
accumulateSupporter(sb, Supporter, ranking, rowdef, negativeHashes, positiveHashes, yacyNewsPool.INCOMING_DB); accumulateSupporter(sb, Supporter, ranking, rowdef, negativeHashes, positiveHashes, yacyNewsPool.INCOMING_DB);
//accumulateSupporter(Supporter, ranking, rowdef, negativeHashes, positiveHashes, yacyNewsPool.OUTGOING_DB); //accumulateSupporter(Supporter, ranking, rowdef, negativeHashes, positiveHashes, yacyNewsPool.OUTGOING_DB);

View File

@ -112,7 +112,7 @@ public class Surftips {
//accumulateVotes(negativeHashes, positiveHashes, yacyNewsPool.OUTGOING_DB); //accumulateVotes(negativeHashes, positiveHashes, yacyNewsPool.OUTGOING_DB);
//accumulateVotes(negativeHashes, positiveHashes, yacyNewsPool.PUBLISHED_DB); //accumulateVotes(negativeHashes, positiveHashes, yacyNewsPool.PUBLISHED_DB);
final ScoreCluster<String> ranking = new ScoreCluster<String>(); // score cluster for url hashes final ScoreCluster<String> ranking = new ScoreCluster<String>(); // score cluster for url hashes
final Row rowdef = new Row("String url-255, String title-120, String description-120, String refid-" + (DateFormatter.PATTERN_SHORT_SECOND.length() + 12), NaturalOrder.naturalOrder, 0); final Row rowdef = new Row("String url-255, String title-120, String description-120, String refid-" + (DateFormatter.PATTERN_SHORT_SECOND.length() + 12), NaturalOrder.naturalOrder);
final HashMap<String, Entry> surftips = new HashMap<String, Entry>(); // a mapping from an url hash to a kelondroRow.Entry with display properties final HashMap<String, Entry> surftips = new HashMap<String, Entry>(); // a mapping from an url hash to a kelondroRow.Entry with display properties
accumulateSurftips(sb, surftips, ranking, rowdef, negativeHashes, positiveHashes, yacyNewsPool.INCOMING_DB); accumulateSurftips(sb, surftips, ranking, rowdef, negativeHashes, positiveHashes, yacyNewsPool.INCOMING_DB);
//accumulateSurftips(surftips, ranking, rowdef, negativeHashes, positiveHashes, yacyNewsPool.OUTGOING_DB); //accumulateSurftips(surftips, ranking, rowdef, negativeHashes, positiveHashes, yacyNewsPool.OUTGOING_DB);

View File

@ -284,7 +284,7 @@ public class dbtest {
profiler.start(); profiler.start();
// create the database access // create the database access
final Row testRow = new Row("byte[] key-" + keylength + ", byte[] dummy-" + keylength + ", value-" + valuelength, Base64Order.enhancedCoder, 0); final Row testRow = new Row("byte[] key-" + keylength + ", byte[] dummy-" + keylength + ", value-" + valuelength, Base64Order.enhancedCoder);
final ObjectIndex table_test = selectTableType(dbe_test, tablename_test, testRow); final ObjectIndex table_test = selectTableType(dbe_test, tablename_test, testRow);
final ObjectIndex table_reference = (dbe_reference == null) ? null : selectTableType(dbe_reference, tablename_reference, testRow); final ObjectIndex table_reference = (dbe_reference == null) ? null : selectTableType(dbe_reference, tablename_reference, testRow);

View File

@ -47,7 +47,7 @@ public class Balancer {
private static final int EcoFSBufferSize = 200; private static final int EcoFSBufferSize = 200;
// definition of payload for fileStack // definition of payload for fileStack
private static final Row stackrow = new Row("byte[] urlhash-" + yacySeedDB.commonHashLength, Base64Order.enhancedCoder, 0); private static final Row stackrow = new Row("byte[] urlhash-" + yacySeedDB.commonHashLength, Base64Order.enhancedCoder);
// class variables // class variables
private final ConcurrentHashMap<String, LinkedList<String>> private final ConcurrentHashMap<String, LinkedList<String>>

View File

@ -59,9 +59,8 @@ public class CrawlEntry extends serverProcessorJob {
"Cardinal loaddate-8 {b256}," + // time when the file was loaded "Cardinal loaddate-8 {b256}," + // time when the file was loaded
"Cardinal serverdate-8 {b256}," + // time when that the server returned as document date "Cardinal serverdate-8 {b256}," + // time when that the server returned as document date
"Cardinal modifiedSince-8 {b256}", // time that was given to server as ifModifiedSince "Cardinal modifiedSince-8 {b256}", // time that was given to server as ifModifiedSince
Base64Order.enhancedCoder, Base64Order.enhancedCoder
0 );
);
// a shared domainAccess map for all balancers. the key is a domain-hash (6 bytes) // a shared domainAccess map for all balancers. the key is a domain-hash (6 bytes)
public static final ConcurrentHashMap<String, domaccess> domainAccess = new ConcurrentHashMap<String, domaccess>(); public static final ConcurrentHashMap<String, domaccess> domainAccess = new ConcurrentHashMap<String, domaccess>();

View File

@ -72,8 +72,8 @@ public class IndexingStack {
"Cardinal depth-2 {b64e}, " + // the prefetch depth so far, starts at 0 "Cardinal depth-2 {b64e}, " + // the prefetch depth so far, starts at 0
"String profile-" + yacySeedDB.commonHashLength + ", " + // the name of the prefetch profile handle "String profile-" + yacySeedDB.commonHashLength + ", " + // the name of the prefetch profile handle
"String urldescr-80", "String urldescr-80",
NaturalOrder.naturalOrder, NaturalOrder.naturalOrder
0); );
public int size() { public int size() {
return (sbQueueStack == null) ? 0 : sbQueueStack.size(); return (sbQueueStack == null) ? 0 : sbQueueStack.size();

View File

@ -53,8 +53,8 @@ public class ZURL {
"Cardinal workcount-4 {b256}, " + // number of load retries "Cardinal workcount-4 {b256}, " + // number of load retries
"String anycause-132, " + // string describing load failure "String anycause-132, " + // string describing load failure
"byte[] entry-" + CrawlEntry.rowdef.objectsize, // extra space "byte[] entry-" + CrawlEntry.rowdef.objectsize, // extra space
Base64Order.enhancedCoder, Base64Order.enhancedCoder
0); );
// the class object // the class object
private final ObjectIndex urlIndex; private final ObjectIndex urlIndex;

View File

@ -42,9 +42,7 @@ public class URLFetcherStack {
private static final Row rowdef = new Row( private static final Row rowdef = new Row(
"String urlstring-256", "String urlstring-256",
Base64Order.enhancedCoder, Base64Order.enhancedCoder );
0
);
private final Stack db; private final Stack db;
private final Log log; private final Log log;

View File

@ -77,7 +77,7 @@ public class BLOBTree implements BLOB {
public BLOBTree(final File file, final boolean useNodeCache, final boolean useObjectCache, final int key, public BLOBTree(final File file, final boolean useNodeCache, final boolean useObjectCache, final int key,
final int nodesize, final char fillChar, final ByteOrder objectOrder, final boolean usetree, final boolean writebuffer, final boolean resetOnFail) { final int nodesize, final char fillChar, final ByteOrder objectOrder, final boolean usetree, final boolean writebuffer, final boolean resetOnFail) {
// creates or opens a dynamic tree // creates or opens a dynamic tree
rowdef = new Row("byte[] key-" + (key + counterlen) + ", byte[] node-" + nodesize, objectOrder, 0); rowdef = new Row("byte[] key-" + (key + counterlen) + ", byte[] node-" + nodesize, objectOrder);
this.file = file; this.file = file;
ObjectIndex fbi; ObjectIndex fbi;
if (usetree) { if (usetree) {

View File

@ -76,7 +76,7 @@ public class Cache implements ObjectIndex {
} }
private void init() { private void init() {
this.keyrow = new Row(new Column[]{index.row().column(index.row().primaryKeyIndex)}, index.row().objectOrder, 0); this.keyrow = new Row(new Column[]{index.row().column(0)}, index.row().objectOrder);
this.readHitCache = new RowSet(index.row(), 0); this.readHitCache = new RowSet(index.row(), 0);
this.readMissCache = new RowSet(this.keyrow, 0); this.readMissCache = new RowSet(this.keyrow, 0);
this.readHit = 0; this.readHit = 0;

View File

@ -43,7 +43,7 @@ public class HandleSet implements Iterable<byte[]> {
private ObjectIndex index; private ObjectIndex index;
public HandleSet(final int keylength, final ByteOrder objectOrder, final int initialspace, final int expectedspace) { public HandleSet(final int keylength, final ByteOrder objectOrder, final int initialspace, final int expectedspace) {
this.rowdef = new Row(new Column[]{new Column("key", Column.celltype_binary, Column.encoder_bytes, keylength, "key")}, objectOrder, 0); this.rowdef = new Row(new Column[]{new Column("key", Column.celltype_binary, Column.encoder_bytes, keylength, "key")}, objectOrder);
this.index = new ObjectIndexCache(rowdef, initialspace, expectedspace); this.index = new ObjectIndexCache(rowdef, initialspace, expectedspace);
} }

View File

@ -56,7 +56,7 @@ public class IntegerHandleIndex {
private ObjectIndexCache index; private ObjectIndexCache index;
public IntegerHandleIndex(final int keylength, final ByteOrder objectOrder, final int initialspace, final int expectedspace) { public IntegerHandleIndex(final int keylength, final ByteOrder objectOrder, final int initialspace, final int expectedspace) {
this.rowdef = new Row(new Column[]{new Column("key", Column.celltype_binary, Column.encoder_bytes, keylength, "key"), new Column("int c-4 {b256}")}, objectOrder, 0); this.rowdef = new Row(new Column[]{new Column("key", Column.celltype_binary, Column.encoder_bytes, keylength, "key"), new Column("int c-4 {b256}")}, objectOrder);
this.index = new ObjectIndexCache(rowdef, initialspace, expectedspace); this.index = new ObjectIndexCache(rowdef, initialspace, expectedspace);
} }

View File

@ -59,7 +59,7 @@ public class LongHandleIndex {
* @param space * @param space
*/ */
public LongHandleIndex(final int keylength, final ByteOrder objectOrder, final int initialspace, final int expectedspace) { public LongHandleIndex(final int keylength, final ByteOrder objectOrder, final int initialspace, final int expectedspace) {
this.rowdef = new Row(new Column[]{new Column("key", Column.celltype_binary, Column.encoder_bytes, keylength, "key"), new Column("long c-8 {b256}")}, objectOrder, 0); this.rowdef = new Row(new Column[]{new Column("key", Column.celltype_binary, Column.encoder_bytes, keylength, "key"), new Column("long c-8 {b256}")}, objectOrder);
this.index = new ObjectIndexCache(rowdef, initialspace, expectedspace); this.index = new ObjectIndexCache(rowdef, initialspace, expectedspace);
} }

View File

@ -46,7 +46,7 @@ public class ObjectArrayCache {
//private final kelondroOrder<kelondroRow.Entry> entryOrder; //private final kelondroOrder<kelondroRow.Entry> entryOrder;
public ObjectArrayCache(final int payloadSize, final int initSize) { public ObjectArrayCache(final int payloadSize, final int initSize) {
this.rowdef = new Row("Cardinal key-4 {b256}, byte[] payload-" + payloadSize, NaturalOrder.naturalOrder, 0); this.rowdef = new Row("Cardinal key-4 {b256}, byte[] payload-" + payloadSize, NaturalOrder.naturalOrder);
this.index0 = new RowSet(rowdef, initSize); this.index0 = new RowSet(rowdef, initSize);
this.index1 = null; this.index1 = null;
//this.entryOrder = new kelondroRow.EntryComparator(rowdef.objectOrder); //this.entryOrder = new kelondroRow.EntryComparator(rowdef.objectOrder);

View File

@ -52,10 +52,10 @@ public final class Row {
public final int[] colstart; public final int[] colstart;
public final ByteOrder objectOrder; public final ByteOrder objectOrder;
public final int objectsize; public final int objectsize;
public final int primaryKeyIndex, primaryKeyLength; public final int primaryKeyLength;
protected Map<String, Object[]> nickref = null; // a mapping from nicknames to Object[2]{kelondroColumn, Integer(colstart)} protected Map<String, Object[]> nickref = null; // a mapping from nicknames to Object[2]{kelondroColumn, Integer(colstart)}
public Row(final Column[] row, final ByteOrder objectOrder, final int primaryKey) { public Row(final Column[] row, final ByteOrder objectOrder) {
assert objectOrder != null; assert objectOrder != null;
this.objectOrder = objectOrder; this.objectOrder = objectOrder;
this.row = row; this.row = row;
@ -67,11 +67,10 @@ public final class Row {
os+= this.row[i].cellwidth; os+= this.row[i].cellwidth;
} }
this.objectsize = os; this.objectsize = os;
this.primaryKeyIndex = primaryKey; this.primaryKeyLength = row[0].cellwidth;
this.primaryKeyLength = (primaryKey < 0) ? this.objectsize : row[primaryKeyIndex].cellwidth;
} }
public Row(String structure, final ByteOrder objectOrder, final int primaryKey) { public Row(String structure, final ByteOrder objectOrder) {
assert (objectOrder != null); assert (objectOrder != null);
this.objectOrder = objectOrder; this.objectOrder = objectOrder;
// define row with row syntax // define row with row syntax
@ -102,8 +101,7 @@ public final class Row {
os += this.row[i].cellwidth; os += this.row[i].cellwidth;
} }
this.objectsize = os; this.objectsize = os;
this.primaryKeyIndex = primaryKey; this.primaryKeyLength = row[0].cellwidth;
this.primaryKeyLength = (primaryKey < 0) ? this.objectsize : row[primaryKeyIndex].cellwidth;
} }
public final ByteOrder getOrdering() { public final ByteOrder getOrdering() {
@ -119,11 +117,7 @@ public final class Row {
public final int columns() { public final int columns() {
return this.row.length; return this.row.length;
} }
/*
public final int objectsize() {
return this.objectsize;
}
*/
public final Column column(final int col) { public final Column column(final int col) {
return row[col]; return row[col];
} }
@ -567,7 +561,7 @@ public final class Row {
public final byte[] getPrimaryKeyBytes() { public final byte[] getPrimaryKeyBytes() {
final byte[] c = new byte[primaryKeyLength]; final byte[] c = new byte[primaryKeyLength];
System.arraycopy(rowinstance, offset + ((primaryKeyIndex < 0) ? 0 : colstart[primaryKeyIndex]), c, 0, primaryKeyLength); System.arraycopy(rowinstance, offset, c, 0, primaryKeyLength);
return c; return c;
} }

View File

@ -155,7 +155,7 @@ public class RowCollection implements Iterable<Row.Entry> {
"byte[] orderkey-2," + "byte[] orderkey-2," +
"int orderbound-4 {b256}," + "int orderbound-4 {b256}," +
"byte[] collection-" + chunkcachelength, "byte[] collection-" + chunkcachelength,
NaturalOrder.naturalOrder, 0 NaturalOrder.naturalOrder
); );
} }
@ -866,16 +866,14 @@ public class RowCollection implements Iterable<Row.Entry> {
assert (j >= 0) && (j < chunkcount) : "j = " + j + ", chunkcount = " + chunkcount; assert (j >= 0) && (j < chunkcount) : "j = " + j + ", chunkcount = " + chunkcount;
assert (this.rowdef.objectOrder != null); assert (this.rowdef.objectOrder != null);
if (i == j) return 0; if (i == j) return 0;
assert (this.rowdef.primaryKeyIndex == 0) : "this.sortColumn = " + this.rowdef.primaryKeyIndex;
final int colstart = (this.rowdef.primaryKeyIndex <= 0) ? 0 : this.rowdef.colstart[this.rowdef.primaryKeyIndex];
//assert (!bugappearance(chunkcache, i * this.rowdef.objectsize + colstart, this.rowdef.primaryKeyLength)); //assert (!bugappearance(chunkcache, i * this.rowdef.objectsize + colstart, this.rowdef.primaryKeyLength));
//assert (!bugappearance(chunkcache, j * this.rowdef.objectsize + colstart, this.rowdef.primaryKeyLength)); //assert (!bugappearance(chunkcache, j * this.rowdef.objectsize + colstart, this.rowdef.primaryKeyLength));
final int c = this.rowdef.objectOrder.compare( final int c = this.rowdef.objectOrder.compare(
chunkcache, chunkcache,
i * this.rowdef.objectsize + colstart, i * this.rowdef.objectsize,
this.rowdef.primaryKeyLength, this.rowdef.primaryKeyLength,
chunkcache, chunkcache,
j * this.rowdef.objectsize + colstart, j * this.rowdef.objectsize,
this.rowdef.primaryKeyLength); this.rowdef.primaryKeyLength);
return c; return c;
} }
@ -884,16 +882,13 @@ public class RowCollection implements Iterable<Row.Entry> {
assert (i >= 0) && (i < chunkcount) : "i = " + i + ", chunkcount = " + chunkcount; assert (i >= 0) && (i < chunkcount) : "i = " + i + ", chunkcount = " + chunkcount;
assert (this.rowdef.objectOrder != null); assert (this.rowdef.objectOrder != null);
assert (this.rowdef.objectOrder instanceof Base64Order); assert (this.rowdef.objectOrder instanceof Base64Order);
assert (this.rowdef.primaryKeyIndex == 0) : "this.sortColumn = " + this.rowdef.primaryKeyIndex;
final int colstart = (this.rowdef.primaryKeyIndex <= 0) ? 0 : this.rowdef.colstart[this.rowdef.primaryKeyIndex];
//assert (!bugappearance(chunkcache, i * this.rowdef.objectsize + colstart, this.rowdef.primaryKeyLength)); //assert (!bugappearance(chunkcache, i * this.rowdef.objectsize + colstart, this.rowdef.primaryKeyLength));
return ((Base64Order) this.rowdef.objectOrder).compilePivot(chunkcache, i * this.rowdef.objectsize + colstart, this.rowdef.primaryKeyLength); return ((Base64Order) this.rowdef.objectOrder).compilePivot(chunkcache, i * this.rowdef.objectsize, this.rowdef.primaryKeyLength);
} }
protected final byte[] compilePivot(final byte[] a, final int astart, final int alength) { protected final byte[] compilePivot(final byte[] a, final int astart, final int alength) {
assert (this.rowdef.objectOrder != null); assert (this.rowdef.objectOrder != null);
assert (this.rowdef.objectOrder instanceof Base64Order); assert (this.rowdef.objectOrder instanceof Base64Order);
assert (this.rowdef.primaryKeyIndex == 0) : "this.sortColumn = " + this.rowdef.primaryKeyIndex;
return ((Base64Order) this.rowdef.objectOrder).compilePivot(a, astart, alength); return ((Base64Order) this.rowdef.objectOrder).compilePivot(a, astart, alength);
} }
@ -902,13 +897,11 @@ public class RowCollection implements Iterable<Row.Entry> {
assert (j >= 0) && (j < chunkcount) : "j = " + j + ", chunkcount = " + chunkcount; assert (j >= 0) && (j < chunkcount) : "j = " + j + ", chunkcount = " + chunkcount;
assert (this.rowdef.objectOrder != null); assert (this.rowdef.objectOrder != null);
assert (this.rowdef.objectOrder instanceof Base64Order); assert (this.rowdef.objectOrder instanceof Base64Order);
assert (this.rowdef.primaryKeyIndex == 0) : "this.sortColumn = " + this.rowdef.primaryKeyIndex;
final int colstart = (this.rowdef.primaryKeyIndex <= 0) ? 0 : this.rowdef.colstart[this.rowdef.primaryKeyIndex];
//assert (!bugappearance(chunkcache, j * this.rowdef.objectsize + colstart, this.rowdef.primaryKeyLength)); //assert (!bugappearance(chunkcache, j * this.rowdef.objectsize + colstart, this.rowdef.primaryKeyLength));
final int c = ((Base64Order) this.rowdef.objectOrder).comparePivot( final int c = ((Base64Order) this.rowdef.objectOrder).comparePivot(
compiledPivot, compiledPivot,
chunkcache, chunkcache,
j * this.rowdef.objectsize + colstart, j * this.rowdef.objectsize,
this.rowdef.primaryKeyLength); this.rowdef.primaryKeyLength);
return c; return c;
} }
@ -916,7 +909,7 @@ public class RowCollection implements Iterable<Row.Entry> {
protected synchronized int compare(final byte[] a, final int astart, final int alength, final int chunknumber) { protected synchronized int compare(final byte[] a, final int astart, final int alength, final int chunknumber) {
assert (chunknumber < chunkcount); assert (chunknumber < chunkcount);
final int l = Math.min(this.rowdef.primaryKeyLength, Math.min(a.length - astart, alength)); final int l = Math.min(this.rowdef.primaryKeyLength, Math.min(a.length - astart, alength));
return rowdef.objectOrder.compare(a, astart, l, chunkcache, chunknumber * this.rowdef.objectsize + ((rowdef.primaryKeyIndex <= 0) ? 0 : this.rowdef.colstart[rowdef.primaryKeyIndex]), this.rowdef.primaryKeyLength); return rowdef.objectOrder.compare(a, astart, l, chunkcache, chunknumber * this.rowdef.objectsize, this.rowdef.primaryKeyLength);
} }
protected final boolean match(final int i, final int j) { protected final boolean match(final int i, final int j) {
@ -927,9 +920,8 @@ public class RowCollection implements Iterable<Row.Entry> {
if (j >= chunkcount) return false; if (j >= chunkcount) return false;
assert (this.rowdef.objectOrder != null); assert (this.rowdef.objectOrder != null);
if (i == j) return true; if (i == j) return true;
final int colstart = (this.rowdef.primaryKeyIndex <= 0) ? 0 : this.rowdef.colstart[this.rowdef.primaryKeyIndex]; int astart = i * this.rowdef.objectsize;
int astart = i * this.rowdef.objectsize + colstart; int bstart = j * this.rowdef.objectsize;
int bstart = j * this.rowdef.objectsize + colstart;
int k = this.rowdef.primaryKeyLength; int k = this.rowdef.primaryKeyLength;
while (k-- != 0) { while (k-- != 0) {
if (chunkcache[astart++] != chunkcache[bstart++]) return false; if (chunkcache[astart++] != chunkcache[bstart++]) return false;
@ -939,7 +931,7 @@ public class RowCollection implements Iterable<Row.Entry> {
protected synchronized boolean match(final byte[] a, int astart, final int alength, final int chunknumber) { protected synchronized boolean match(final byte[] a, int astart, final int alength, final int chunknumber) {
if (chunknumber >= chunkcount) return false; if (chunknumber >= chunkcount) return false;
int p = chunknumber * this.rowdef.objectsize + ((rowdef.primaryKeyIndex <= 0) ? 0 : this.rowdef.colstart[rowdef.primaryKeyIndex]); int p = chunknumber * this.rowdef.objectsize;
int len = Math.min(this.rowdef.primaryKeyLength, Math.min(alength, a.length - astart)); int len = Math.min(this.rowdef.primaryKeyLength, Math.min(alength, a.length - astart));
while (len-- != 0) { while (len-- != 0) {
if (a[astart++] != chunkcache[p++]) return false; if (a[astart++] != chunkcache[p++]) return false;
@ -967,7 +959,7 @@ public class RowCollection implements Iterable<Row.Entry> {
public static void test(final int testsize) { public static void test(final int testsize) {
final Row r = new Row(new Column[]{ final Row r = new Row(new Column[]{
new Column("hash", Column.celltype_string, Column.encoder_bytes, 12, "hash")}, new Column("hash", Column.celltype_string, Column.encoder_bytes, 12, "hash")},
Base64Order.enhancedCoder, 0); Base64Order.enhancedCoder);
RowCollection a = new RowCollection(r, testsize); RowCollection a = new RowCollection(r, testsize);
a.add("AAAAAAAAAAAA".getBytes()); a.add("AAAAAAAAAAAA".getBytes());

View File

@ -116,7 +116,7 @@ public class RowSet extends RowCollection implements ObjectIndex, Iterable<Row.E
if ((this.chunkcount - this.sortBound) > collectionReSortLimit) { if ((this.chunkcount - this.sortBound) > collectionReSortLimit) {
sort(); sort();
} }
int index = find(entry.bytes(), (rowdef.primaryKeyIndex < 0) ? 0 :super.rowdef.colstart[rowdef.primaryKeyIndex], super.rowdef.primaryKeyLength); int index = find(entry.bytes(), 0, super.rowdef.primaryKeyLength);
if (index < 0) { if (index < 0) {
super.addUnique(entry); super.addUnique(entry);
} else { } else {
@ -135,7 +135,7 @@ public class RowSet extends RowCollection implements ObjectIndex, Iterable<Row.E
if ((this.chunkcount - this.sortBound) > collectionReSortLimit) { if ((this.chunkcount - this.sortBound) > collectionReSortLimit) {
sort(); sort();
} }
index = find(entry.bytes(), (rowdef.primaryKeyIndex < 0) ? 0 :super.rowdef.colstart[rowdef.primaryKeyIndex], super.rowdef.primaryKeyLength); index = find(entry.bytes(), 0, super.rowdef.primaryKeyLength);
if (index < 0) { if (index < 0) {
super.addUnique(entry); super.addUnique(entry);
} else { } else {
@ -488,7 +488,7 @@ public class RowSet extends RowCollection implements ObjectIndex, Iterable<Row.E
*/ */
final String[] test = { "eins", "zwei", "drei", "vier", "fuenf", "sechs", "sieben", "acht", "neun", "zehn" }; final String[] test = { "eins", "zwei", "drei", "vier", "fuenf", "sechs", "sieben", "acht", "neun", "zehn" };
final RowSet d = new RowSet(new Row("byte[] key-10, Cardinal x-4 {b256}", NaturalOrder.naturalOrder, 0), 0); final RowSet d = new RowSet(new Row("byte[] key-10, Cardinal x-4 {b256}", NaturalOrder.naturalOrder), 0);
for (int ii = 0; ii < test.length; ii++) d.add(test[ii].getBytes()); for (int ii = 0; ii < test.length; ii++) d.add(test[ii].getBytes());
for (int ii = 0; ii < test.length; ii++) d.add(test[ii].getBytes()); for (int ii = 0; ii < test.length; ii++) d.add(test[ii].getBytes());
d.sort(); d.sort();
@ -575,7 +575,7 @@ public class RowSet extends RowCollection implements ObjectIndex, Iterable<Row.E
// remove test // remove test
final long start = System.currentTimeMillis(); final long start = System.currentTimeMillis();
final RowSet c = new RowSet(new Row("byte[] a-12, byte[] b-12", Base64Order.enhancedCoder, 0), 0); final RowSet c = new RowSet(new Row("byte[] a-12, byte[] b-12", Base64Order.enhancedCoder), 0);
byte[] key; byte[] key;
final int testsize = 5000; final int testsize = 5000;
final byte[][] delkeys = new byte[testsize / 5][]; final byte[][] delkeys = new byte[testsize / 5][];

View File

@ -588,7 +588,7 @@ public abstract class AbstractRecords implements RandomAccessRecords {
TXTPROPS[i] = new byte[TXTPROPW]; TXTPROPS[i] = new byte[TXTPROPW];
entryFile.readFully(POS_TXTPROPS + TXTPROPW * i, TXTPROPS[i], 0, TXTPROPS[i].length); entryFile.readFully(POS_TXTPROPS + TXTPROPW * i, TXTPROPS[i], 0, TXTPROPS[i].length);
} }
this.ROW = new Row(COLDEFS, readOrderType(), 0); this.ROW = new Row(COLDEFS, readOrderType());
// assign remaining values that are only present at run-time // assign remaining values that are only present at run-time
this.overhead = OHBYTEC + 4 * OHHANDLEC; this.overhead = OHBYTEC + 4 * OHHANDLEC;

View File

@ -88,13 +88,12 @@ public class EcoTable implements ObjectIndex {
this.rowdef = rowdef; this.rowdef = rowdef;
this.buffersize = buffersize; this.buffersize = buffersize;
//this.fail = 0; //this.fail = 0;
assert rowdef.primaryKeyIndex == 0;
// define the taildef, a row like the rowdef but without the first column // define the taildef, a row like the rowdef but without the first column
final Column[] cols = new Column[rowdef.columns() - 1]; final Column[] cols = new Column[rowdef.columns() - 1];
for (int i = 0; i < cols.length; i++) { for (int i = 0; i < cols.length; i++) {
cols[i] = rowdef.column(i + 1); cols[i] = rowdef.column(i + 1);
} }
this.taildef = new Row(cols, NaturalOrder.naturalOrder, -1); this.taildef = new Row(cols, NaturalOrder.naturalOrder);
// initialize table file // initialize table file
boolean freshFile = false; boolean freshFile = false;
@ -696,7 +695,7 @@ public class EcoTable implements ObjectIndex {
public static ObjectIndex testTable(final File f, final String testentities, final int testcase) throws IOException { public static ObjectIndex testTable(final File f, final String testentities, final int testcase) throws IOException {
if (f.exists()) f.delete(); if (f.exists()) f.delete();
final Row rowdef = new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder, 0); final Row rowdef = new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder);
final ObjectIndex tt = new EcoTable(f, rowdef, testcase, 100, 0); final ObjectIndex tt = new EcoTable(f, rowdef, testcase, 100, 0);
byte[] b; byte[] b;
final Row.Entry row = rowdef.newEntry(); final Row.Entry row = rowdef.newEntry();

View File

@ -168,7 +168,7 @@ public class FixedWidthArray extends FullRecords implements ObjectArray {
public static void main(final String[] args) { public static void main(final String[] args) {
//File f = new File("d:\\\\mc\\privat\\fixtest.db"); //File f = new File("d:\\\\mc\\privat\\fixtest.db");
final File f = new File("/Users/admin/fixtest.db"); final File f = new File("/Users/admin/fixtest.db");
final Row rowdef = new Row("byte[] a-12, byte[] b-4", NaturalOrder.naturalOrder, 0); final Row rowdef = new Row("byte[] a-12, byte[] b-4", NaturalOrder.naturalOrder);
try { try {
System.out.println("erster Test"); System.out.println("erster Test");
f.delete(); f.delete();

View File

@ -458,7 +458,7 @@ public class FlexTable extends FlexWidthArray implements ObjectIndex {
// open a file, add one entry and exit // open a file, add one entry and exit
final File f = new File(args[0]); final File f = new File(args[0]);
final String name = args[1]; final String name = args[1];
final Row row = new Row("Cardinal key-4 {b256}, byte[] x-64", NaturalOrder.naturalOrder, 0); final Row row = new Row("Cardinal key-4 {b256}, byte[] x-64", NaturalOrder.naturalOrder);
try { try {
final FlexTable t = new FlexTable(f, name, row, 0, true); final FlexTable t = new FlexTable(f, name, row, 0, true);
final Row.Entry entry = row.newEntry(); final Row.Entry entry = row.newEntry();

View File

@ -128,7 +128,7 @@ public class FlexWidthArray implements ObjectArray {
final Column columns[] = new Column[colend - colstart + 1]; final Column columns[] = new Column[colend - colstart + 1];
for (int j = colstart; j <= colend; j++) columns[j-colstart] = rowdef.column(j); for (int j = colstart; j <= colend; j++) columns[j-colstart] = rowdef.column(j);
col[colstart] = new FixedWidthArray(new File(tabledir, files[i]), new Row(columns, (colstart == 0) ? rowdef.objectOrder : NaturalOrder.naturalOrder, 0), 16); col[colstart] = new FixedWidthArray(new File(tabledir, files[i]), new Row(columns, (colstart == 0) ? rowdef.objectOrder : NaturalOrder.naturalOrder), 16);
for (int j = colstart; j <= colend; j++) check = check.substring(0, j) + "X" + check.substring(j + 1); for (int j = colstart; j <= colend; j++) check = check.substring(0, j) + "X" + check.substring(j + 1);
} }
} }
@ -147,7 +147,7 @@ public class FlexWidthArray implements ObjectArray {
columns[j - p] = rowdef.column(j); columns[j - p] = rowdef.column(j);
check = check.substring(0, j) + "X" + check.substring(j + 1); check = check.substring(0, j) + "X" + check.substring(j + 1);
} }
col[p] = new FixedWidthArray(new File(tabledir, colfilename(p, q)), new Row(columns, (p == 0) ? rowdef.objectOrder : NaturalOrder.naturalOrder, 0), 16); col[p] = new FixedWidthArray(new File(tabledir, colfilename(p, q)), new Row(columns, (p == 0) ? rowdef.objectOrder : NaturalOrder.naturalOrder), 16);
} }
} }
@ -374,7 +374,7 @@ public class FlexWidthArray implements ObjectArray {
public static void main(final String[] args) { public static void main(final String[] args) {
//File f = new File("d:\\\\mc\\privat\\fixtest.db"); //File f = new File("d:\\\\mc\\privat\\fixtest.db");
final File f = new File("/Users/admin/"); final File f = new File("/Users/admin/");
final Row rowdef = new Row("byte[] a-12, byte[] b-4", NaturalOrder.naturalOrder, 0); final Row rowdef = new Row("byte[] a-12, byte[] b-4", NaturalOrder.naturalOrder);
final String testname = "flextest"; final String testname = "flextest";
try { try {
System.out.println("erster Test"); System.out.println("erster Test");

View File

@ -162,7 +162,7 @@ public class Hashtable {
final Column[] newCol = new Column[rowdef.columns() + 1]; final Column[] newCol = new Column[rowdef.columns() + 1];
newCol[0] = new Column("Cardinal key-4 {b256}"); newCol[0] = new Column("Cardinal key-4 {b256}");
for (int i = 0; i < rowdef.columns(); i++) newCol[i + 1] = rowdef.column(i); for (int i = 0; i < rowdef.columns(); i++) newCol[i + 1] = rowdef.column(i);
return new Row(newCol, rowdef.objectOrder, rowdef.primaryKeyIndex); return new Row(newCol, rowdef.objectOrder);
} }
public static int power2(int x) { public static int power2(int x) {

View File

@ -62,7 +62,7 @@ public class Relations {
"long time-8" + keysize + ", " + "long time-8" + keysize + ", " +
"int ttl-4" + keysize + ", " + "int ttl-4" + keysize + ", " +
"byte[] node-" + payloadsize, "byte[] node-" + payloadsize,
NaturalOrder.naturalOrder, 0); NaturalOrder.naturalOrder);
} }
private static String filename(final String tablename, final int keysize, final int payloadsize) { private static String filename(final String tablename, final int keysize, final int payloadsize) {

View File

@ -67,7 +67,7 @@ public class SplitTable implements ObjectIndex {
// the table type can be either kelondroFlex or kelondroEco // the table type can be either kelondroFlex or kelondroEco
private static final int EcoFSBufferSize = 20; private static final int EcoFSBufferSize = 20;
static final ObjectIndex dummyIndex = new ObjectIndexCache(new Row(new Column[]{new Column("key", Column.celltype_binary, Column.encoder_bytes, 2, "key")}, NaturalOrder.naturalOrder, 0), 0, 0); static final ObjectIndex dummyIndex = new ObjectIndexCache(new Row(new Column[]{new Column("key", Column.celltype_binary, Column.encoder_bytes, 2, "key")}, NaturalOrder.naturalOrder), 0, 0);
// the thread pool for the keeperOf executor service // the thread pool for the keeperOf executor service
private ExecutorService executor; private ExecutorService executor;

View File

@ -305,7 +305,7 @@ public final class Stack extends FullRecords {
for (int i = 0; i < args.length; i++) System.out.print(args[i] + " "); for (int i = 0; i < args.length; i++) System.out.print(args[i] + " ");
System.out.println(""); System.out.println("");
byte[] ret = null; byte[] ret = null;
final Row lens = new Row("byte[] key-" + Integer.parseInt(args[1]) + ", byte[] value-" + Integer.parseInt(args[2]), NaturalOrder.naturalOrder, 0); final Row lens = new Row("byte[] key-" + Integer.parseInt(args[1]) + ", byte[] value-" + Integer.parseInt(args[2]), NaturalOrder.naturalOrder);
try { try {
if ((args.length > 4) || (args.length < 2)) { if ((args.length > 4) || (args.length < 2)) {
System.err.println("usage: kelondroStack -c|-p|-v|-g|-i|-s [file]|[key [value]] <db-file>"); System.err.println("usage: kelondroStack -c|-p|-v|-g|-i|-s [file]|[key [value]] <db-file>");

View File

@ -1280,7 +1280,7 @@ public class Tree extends CachedRecords implements ObjectIndex {
// test script // test script
final File testFile = new File("test.db"); final File testFile = new File("test.db");
while (testFile.exists()) testFile.delete(); while (testFile.exists()) testFile.delete();
final Tree fm = new Tree(testFile, true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder, 0)); final Tree fm = new Tree(testFile, true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder));
final byte[] dummy = "".getBytes(); final byte[] dummy = "".getBytes();
fm.put("abc0".getBytes(), dummy); fm.put("bcd0".getBytes(), dummy); fm.put("abc0".getBytes(), dummy); fm.put("bcd0".getBytes(), dummy);
fm.put("def0".getBytes(), dummy); fm.put("bab0".getBytes(), dummy); fm.put("def0".getBytes(), dummy); fm.put("bab0".getBytes(), dummy);
@ -1302,7 +1302,7 @@ public class Tree extends CachedRecords implements ObjectIndex {
ret = null; ret = null;
} }
} else if (args.length == 2) { } else if (args.length == 2) {
final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder, 0)); final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder));
if (args[0].equals("-v")) { if (args[0].equals("-v")) {
fm.print(); fm.print();
ret = null; ret = null;
@ -1310,11 +1310,11 @@ public class Tree extends CachedRecords implements ObjectIndex {
fm.close(); fm.close();
} else if (args.length == 3) { } else if (args.length == 3) {
if (args[0].equals("-d")) { if (args[0].equals("-d")) {
final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder, 0)); final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder));
fm.remove(args[2].getBytes()); fm.remove(args[2].getBytes());
fm.close(); fm.close();
} else if (args[0].equals("-i")) { } else if (args[0].equals("-i")) {
final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder, 0)); final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder));
final int i = fm.imp(new File(args[1]),";"); final int i = fm.imp(new File(args[1]),";");
fm.close(); fm.close();
ret = (i + " records imported").getBytes(); ret = (i + " records imported").getBytes();
@ -1337,12 +1337,12 @@ public class Tree extends CachedRecords implements ObjectIndex {
if (f != null) try {f.close();}catch(final Exception e){} if (f != null) try {f.close();}catch(final Exception e){}
} }
} else if (args[0].equals("-g")) { } else if (args[0].equals("-g")) {
final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder, 0)); final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder));
final Row.Entry ret2 = fm.get(args[2].getBytes()); final Row.Entry ret2 = fm.get(args[2].getBytes());
ret = ((ret2 == null) ? null : ret2.getColBytes(1)); ret = ((ret2 == null) ? null : ret2.getColBytes(1));
fm.close(); fm.close();
} else if (args[0].equals("-n")) { } else if (args[0].equals("-n")) {
final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder, 0)); final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder));
//byte[][] keys = fm.getSequentialKeys(args[2].getBytes(), 500, true); //byte[][] keys = fm.getSequentialKeys(args[2].getBytes(), 500, true);
final Iterator<Row.Entry> rowIt = fm.rows(true, (args[2].length() == 0) ? null : args[2].getBytes()); final Iterator<Row.Entry> rowIt = fm.rows(true, (args[2].length() == 0) ? null : args[2].getBytes());
final Vector<String> v = new Vector<String>(); final Vector<String> v = new Vector<String>();
@ -1355,11 +1355,11 @@ public class Tree extends CachedRecords implements ObjectIndex {
// create <keylen> <valuelen> <filename> // create <keylen> <valuelen> <filename>
final File f = new File(args[3]); final File f = new File(args[3]);
if (f.exists()) f.delete(); if (f.exists()) f.delete();
final Row lens = new Row("byte[] key-" + Integer.parseInt(args[1]) + ", byte[] value-" + Integer.parseInt(args[2]), NaturalOrder.naturalOrder, 0); final Row lens = new Row("byte[] key-" + Integer.parseInt(args[1]) + ", byte[] value-" + Integer.parseInt(args[2]), NaturalOrder.naturalOrder);
final Tree fm = new Tree(f, true, 10, lens); final Tree fm = new Tree(f, true, 10, lens);
fm.close(); fm.close();
} else if (args[0].equals("-u")) { } else if (args[0].equals("-u")) {
final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder, 0)); final Tree fm = new Tree(new File(args[1]), true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder));
ret = fm.put(args[1].getBytes(), args[2].getBytes()); ret = fm.put(args[1].getBytes(), args[2].getBytes());
fm.close(); fm.close();
} }
@ -1418,7 +1418,7 @@ public class Tree extends CachedRecords implements ObjectIndex {
int steps = 0; int steps = 0;
while (true) { while (true) {
if (testFile.exists()) testFile.delete(); if (testFile.exists()) testFile.delete();
tt = new Tree(testFile, true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder, 0)); tt = new Tree(testFile, true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder));
steps = 10 + ((int) System.currentTimeMillis() % 7) * (((int) System.currentTimeMillis() + 17) % 11); steps = 10 + ((int) System.currentTimeMillis() % 7) * (((int) System.currentTimeMillis() + 17) % 11);
t = s; t = s;
d = ""; d = "";
@ -1484,7 +1484,7 @@ public class Tree extends CachedRecords implements ObjectIndex {
final File f = new File("test.db"); final File f = new File("test.db");
if (f.exists()) f.delete(); if (f.exists()) f.delete();
try { try {
final Tree tt = new Tree(f, true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder, 0)); final Tree tt = new Tree(f, true, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder));
byte[] b; byte[] b;
b = testWord('B'); tt.put(b, b); //tt.print(); b = testWord('B'); tt.put(b, b); //tt.print();
b = testWord('C'); tt.put(b, b); //tt.print(); b = testWord('C'); tt.put(b, b); //tt.print();
@ -1549,7 +1549,7 @@ public class Tree extends CachedRecords implements ObjectIndex {
public static Tree testTree(final File f, final String testentities) throws IOException { public static Tree testTree(final File f, final String testentities) throws IOException {
if (f.exists()) f.delete(); if (f.exists()) f.delete();
final Tree tt = new Tree(f, false, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder, 0)); final Tree tt = new Tree(f, false, 10, new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder));
byte[] b; byte[] b;
for (int i = 0; i < testentities.length(); i++) { for (int i = 0; i < testentities.length(); i++) {
b = testWord(testentities.charAt(i)); b = testWord(testentities.charAt(i));

View File

@ -269,7 +269,7 @@ public class IndexCollection implements Index {
"int indexpos-4 {b256}," + "int indexpos-4 {b256}," +
"short lastread-2 {b256}, " + "short lastread-2 {b256}, " +
"short lastwrote-2 {b256}", "short lastwrote-2 {b256}",
payloadOrder, 0 payloadOrder
); );
} }
@ -486,9 +486,7 @@ public class IndexCollection implements Index {
final Row rowdef = new Row( final Row rowdef = new Row(
"byte[] key-" + keylength + "," + "byte[] key-" + keylength + "," +
"byte[] collection-" + (RowCollection.exportOverheadSize + load * objectsize), "byte[] collection-" + (RowCollection.exportOverheadSize + load * objectsize),
indexOrder, indexOrder );
0
);
if ((!(f.exists())) && (!create)) return null; if ((!(f.exists())) && (!create)) return null;
final FixedWidthArray a = new FixedWidthArray(f, rowdef, 0); final FixedWidthArray a = new FixedWidthArray(f, rowdef, 0);
Log.logFine("STARTUP", "opened array file " + f + " with " + a.size() + " RWIs"); Log.logFine("STARTUP", "opened array file " + f + " with " + a.size() + " RWIs");
@ -1033,7 +1031,7 @@ public class IndexCollection implements Index {
public static void main(final String[] args) { public static void main(final String[] args) {
// define payload structure // define payload structure
final Row rowdef = new Row("byte[] a-10, byte[] b-80", NaturalOrder.naturalOrder, 0); final Row rowdef = new Row("byte[] a-10, byte[] b-80", NaturalOrder.naturalOrder);
final File path = new File(args[0]); final File path = new File(args[0]);
final String filenameStub = args[1]; final String filenameStub = args[1];

View File

@ -71,8 +71,8 @@ public class MetadataRowContainer {
"Cardinal laudio-2 {b256}, " + // # of embedded audio links; for audio: track number; for video: number of audio tracks "Cardinal laudio-2 {b256}, " + // # of embedded audio links; for audio: track number; for video: number of audio tracks
"Cardinal lvideo-2 {b256}, " + // # of embedded video links "Cardinal lvideo-2 {b256}, " + // # of embedded video links
"Cardinal lapp-2 {b256}", // # of embedded links to applications "Cardinal lapp-2 {b256}", // # of embedded links to applications
Base64Order.enhancedCoder, Base64Order.enhancedCoder
0); );
/* =========================================================================== /* ===========================================================================
* Constants to access the various columns of an URL entry * Constants to access the various columns of an URL entry

View File

@ -350,8 +350,7 @@ public class ReferenceContainer extends RowSet {
final int keylength = i1.rowdef.width(0); final int keylength = i1.rowdef.width(0);
assert (keylength == i2.rowdef.width(0)); assert (keylength == i2.rowdef.width(0));
final ReferenceContainer conj = new ReferenceContainer(null, i1.rowdef, 0); // start with empty search result final ReferenceContainer conj = new ReferenceContainer(null, i1.rowdef, 0); // start with empty search result
if (!((i1.rowdef.getOrdering().signature().equals(i2.rowdef.getOrdering().signature())) && if (!((i1.rowdef.getOrdering().signature().equals(i2.rowdef.getOrdering().signature())))) return conj; // ordering must be equal
(i1.rowdef.primaryKeyIndex == i2.rowdef.primaryKeyIndex))) return conj; // ordering must be equal
final Iterator<ReferenceRow> e1 = i1.entries(); final Iterator<ReferenceRow> e1 = i1.entries();
final Iterator<ReferenceRow> e2 = i2.entries(); final Iterator<ReferenceRow> e2 = i2.entries();
int c; int c;
@ -424,8 +423,7 @@ public class ReferenceContainer extends RowSet {
assert pivot.rowdef.equals(excl.rowdef) : "i1 = " + pivot.rowdef.toString() + "; i2 = " + excl.rowdef.toString(); assert pivot.rowdef.equals(excl.rowdef) : "i1 = " + pivot.rowdef.toString() + "; i2 = " + excl.rowdef.toString();
final int keylength = pivot.rowdef.width(0); final int keylength = pivot.rowdef.width(0);
assert (keylength == excl.rowdef.width(0)); assert (keylength == excl.rowdef.width(0));
if (!((pivot.rowdef.getOrdering().signature().equals(excl.rowdef.getOrdering().signature())) && if (!((pivot.rowdef.getOrdering().signature().equals(excl.rowdef.getOrdering().signature())))) return pivot; // ordering must be equal
(pivot.rowdef.primaryKeyIndex == excl.rowdef.primaryKeyIndex))) return pivot; // ordering must be equal
final Iterator<ReferenceRow> e1 = pivot.entries(); final Iterator<ReferenceRow> e1 = pivot.entries();
final Iterator<ReferenceRow> e2 = excl.entries(); final Iterator<ReferenceRow> e2 = excl.entries();
int c; int c;

View File

@ -59,9 +59,9 @@ public final class ReferenceRow implements Reference, Cloneable {
new Column("o", Column.celltype_cardinal, Column.encoder_b256, 1, "posofphrase"), new Column("o", Column.celltype_cardinal, Column.encoder_b256, 1, "posofphrase"),
new Column("i", Column.celltype_cardinal, Column.encoder_b256, 1, "worddistance"), new Column("i", Column.celltype_cardinal, Column.encoder_b256, 1, "worddistance"),
new Column("k", Column.celltype_cardinal, Column.encoder_b256, 1, "reserve") new Column("k", Column.celltype_cardinal, Column.encoder_b256, 1, "reserve")
}, },
Base64Order.enhancedCoder, Base64Order.enhancedCoder
0); );
// available chars: b,e,j,q // available chars: b,e,j,q
// static properties // static properties

View File

@ -316,7 +316,7 @@ public class AttrSeq {
rowdef.append('-'); rowdef.append('-');
rowdef.append(seq_len[i]); rowdef.append(seq_len[i]);
} }
seqrow = new Row(new String(rowdef), null, 0); seqrow = new Row(new String(rowdef), null);
} }
public String toString() { public String toString() {

View File

@ -61,11 +61,11 @@ public class plasmaRankingCRProcess {
"Cardinal WACount-3 {b64e}, Cardinal WUCount-3 {b64e}, Cardinal Flags-1 {b64e}, " + "Cardinal WACount-3 {b64e}, Cardinal WUCount-3 {b64e}, Cardinal Flags-1 {b64e}, " +
"Cardinal FUDate-3 {b64e}, Cardinal FDDate-3 {b64e}, Cardinal LUDate-3 {b64e}, " + "Cardinal FUDate-3 {b64e}, Cardinal FDDate-3 {b64e}, Cardinal LUDate-3 {b64e}, " +
"Cardinal UCount-2 {b64e}, Cardinal PCount-2 {b64e}, Cardinal ACount-2 {b64e}, Cardinal VCount-2 {b64e}, Cardinal Vita-2 {b64e}", "Cardinal UCount-2 {b64e}, Cardinal PCount-2 {b64e}, Cardinal ACount-2 {b64e}, Cardinal VCount-2 {b64e}, Cardinal Vita-2 {b64e}",
Base64Order.enhancedCoder, 0); Base64Order.enhancedCoder);
public static final Row CRG_colrow = new Row("byte[] Anchor-12", Base64Order.enhancedCoder, 0); public static final Row CRG_colrow = new Row("byte[] Anchor-12", Base64Order.enhancedCoder);
public static final String CRG_accname = "CRG-a-attr"; public static final String CRG_accname = "CRG-a-attr";
public static final String CRG_seqname = "CRG-a-coli"; public static final String CRG_seqname = "CRG-a-coli";
public static final Row RCI_coli = new Row("byte[] RefereeDom-6", Base64Order.enhancedCoder, 0); public static final Row RCI_coli = new Row("byte[] RefereeDom-6", Base64Order.enhancedCoder);
public static final String RCI_colname = "RCI-a-coli"; public static final String RCI_colname = "RCI-a-coli";
private static boolean accumulate_upd(final File f, final AttrSeq acc) { private static boolean accumulate_upd(final File f, final AttrSeq acc) {

View File

@ -66,7 +66,7 @@ public class yacyNewsQueue {
new Column("newsid", Column.celltype_string, Column.encoder_bytes, yacyNewsRecord.idLength, "id = created + originator"), new Column("newsid", Column.celltype_string, Column.encoder_bytes, yacyNewsRecord.idLength, "id = created + originator"),
new Column("last touched", Column.celltype_string, Column.encoder_bytes, DateFormatter.PATTERN_SHORT_SECOND.length(), "") new Column("last touched", Column.celltype_string, Column.encoder_bytes, DateFormatter.PATTERN_SHORT_SECOND.length(), "")
}, },
NaturalOrder.naturalOrder, 0 NaturalOrder.naturalOrder
); );
public yacyNewsQueue(final File path, final yacyNewsDB newsDB) { public yacyNewsQueue(final File path, final yacyNewsDB newsDB) {

View File

@ -81,7 +81,7 @@ public class yacyNewsRecord {
"String rec-" + DateFormatter.PATTERN_SHORT_SECOND.length() + "," + "String rec-" + DateFormatter.PATTERN_SHORT_SECOND.length() + "," +
"short dis-2 {b64e}," + "short dis-2 {b64e}," +
"String att-" + attributesMaxLength, "String att-" + attributesMaxLength,
NaturalOrder.naturalOrder, 0 NaturalOrder.naturalOrder
); );
public static yacyNewsRecord newRecord(final String newsString) { public static yacyNewsRecord newRecord(final String newsString) {