This list is closed, nobody may subscribe to it.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(139) |
Aug
(94) |
Sep
(232) |
Oct
(143) |
Nov
(138) |
Dec
(55) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(127) |
Feb
(90) |
Mar
(101) |
Apr
(74) |
May
(148) |
Jun
(241) |
Jul
(169) |
Aug
(121) |
Sep
(157) |
Oct
(199) |
Nov
(281) |
Dec
(75) |
2012 |
Jan
(107) |
Feb
(122) |
Mar
(184) |
Apr
(73) |
May
(14) |
Jun
(49) |
Jul
(26) |
Aug
(103) |
Sep
(133) |
Oct
(61) |
Nov
(51) |
Dec
(55) |
2013 |
Jan
(59) |
Feb
(72) |
Mar
(99) |
Apr
(62) |
May
(92) |
Jun
(19) |
Jul
(31) |
Aug
(138) |
Sep
(47) |
Oct
(83) |
Nov
(95) |
Dec
(111) |
2014 |
Jan
(125) |
Feb
(60) |
Mar
(119) |
Apr
(136) |
May
(270) |
Jun
(83) |
Jul
(88) |
Aug
(30) |
Sep
(47) |
Oct
(27) |
Nov
(23) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <tho...@us...> - 2010-07-27 20:24:57
|
Revision: 3324 http://bigdata.svn.sourceforge.net/bigdata/?rev=3324&view=rev Author: thompsonbry Date: 2010-07-27 20:24:50 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Removed the unused ParallelismLimitedExecutorService and its test suite (which was failing). Modified TestLeafSplitShortestSeparatorKey to use assertTrue() rather than 'assert' and removed the fail("write tests") at the end of the test. The entire B+Tree package should be green with this change. Modified Paths: -------------- trunk/bigdata/src/test/com/bigdata/btree/TestLeafSplitShortestSeparatorKey.java trunk/bigdata/src/test/com/bigdata/btree/keys/AbstractUnicodeKeyBuilderTestCase.java trunk/bigdata/src/test/com/bigdata/util/concurrent/TestAll.java Removed Paths: ------------- trunk/bigdata/src/test/com/bigdata/util/concurrent/ParallelismLimitedExecutorService.java trunk/bigdata/src/test/com/bigdata/util/concurrent/TestParallelismLimitedExecutorService.java Modified: trunk/bigdata/src/test/com/bigdata/btree/TestLeafSplitShortestSeparatorKey.java =================================================================== --- trunk/bigdata/src/test/com/bigdata/btree/TestLeafSplitShortestSeparatorKey.java 2010-07-27 19:31:00 UTC (rev 3323) +++ trunk/bigdata/src/test/com/bigdata/btree/TestLeafSplitShortestSeparatorKey.java 2010-07-27 20:24:50 UTC (rev 3324) @@ -117,7 +117,6 @@ final BTree btree = BTree.create(new SimpleMemoryRawStore(), metadata); - btree.insert(new byte[] { 1 }, (byte[]) null); // System.out.println("----------------------"); // assert btree.dump(Level.DEBUG,System.out); @@ -133,21 +132,19 @@ // causes split. btree.insert(new byte[] { 20 }, (byte[]) null); System.out.println("----------------------"); - assert btree.dump(Level.DEBUG,System.out); + assertTrue( btree.dump(Level.DEBUG,System.out) ); // add to right edge of right sibling btree.insert(new byte[] { 20, 20 }, (byte[]) null); // remove left edge of right sibling (EQ to separator key). btree.remove(new byte[] { 20}); System.out.println("----------------------"); - assert btree.dump(Level.DEBUG,System.out); + assertTrue( btree.dump(Level.DEBUG,System.out)); // insert deleted key -- causes split for existing separator key. btree.insert(new byte[] { 20 }, (byte[]) null); System.out.println("----------------------"); - assert btree.dump(Level.DEBUG,System.out); - - fail("write test"); + assertTrue( btree.dump(Level.DEBUG,System.out) ); } Modified: trunk/bigdata/src/test/com/bigdata/btree/keys/AbstractUnicodeKeyBuilderTestCase.java =================================================================== --- trunk/bigdata/src/test/com/bigdata/btree/keys/AbstractUnicodeKeyBuilderTestCase.java 2010-07-27 19:31:00 UTC (rev 3323) +++ trunk/bigdata/src/test/com/bigdata/btree/keys/AbstractUnicodeKeyBuilderTestCase.java 2010-07-27 20:24:50 UTC (rev 3324) @@ -182,29 +182,33 @@ } - /** - * Test verifies that the <code>nul</code> byte is not part of the key when - * a unicode string is appended to an {@link IKeyBuilder}. - * <p> - * Note: The {@link SparseRowStore} assumes that Unicode sort keys do not - * contain embedded <code>nul</code>s. + /* + * Note: This test has been disabled. The SparseRowStore no longer makes + * this assumption in order to be compatible with the JDK collator. */ - public void test_keyBuilder_unicode_String_noEmbeddedNuls() { +// /** +// * Test verifies that the <code>nul</code> byte is not part of the key when +// * a unicode string is appended to an {@link IKeyBuilder}. +// * <p> +// * Note: The {@link SparseRowStore} assumes that Unicode sort keys do not +// * contain embedded <code>nul</code>s. +// */ +// public void test_keyBuilder_unicode_String_noEmbeddedNuls() { +// +// final IKeyBuilder keyBuilder = KeyBuilder +// .newUnicodeInstance(getProperties()); +// +// keyBuilder.append("Hello World!"); +// +// final byte[] key = keyBuilder.getKey(); +// +// for (int i = 0; i < key.length; i++) { +// if (key[i] == 0) +// fail("Embedded nuls: key=" + BytesUtil.toString(key)); +// } +// +// } - final IKeyBuilder keyBuilder = KeyBuilder - .newUnicodeInstance(getProperties()); - - keyBuilder.append("Hello World!"); - - final byte[] key = keyBuilder.getKey(); - - for (int i = 0; i < key.length; i++) { - if (key[i] == 0) - fail("Embedded nuls: key=" + BytesUtil.toString(key)); - } - - } - /** * Test of the ability to normalize trailing pad characters. */ Deleted: trunk/bigdata/src/test/com/bigdata/util/concurrent/ParallelismLimitedExecutorService.java =================================================================== --- trunk/bigdata/src/test/com/bigdata/util/concurrent/ParallelismLimitedExecutorService.java 2010-07-27 19:31:00 UTC (rev 3323) +++ trunk/bigdata/src/test/com/bigdata/util/concurrent/ParallelismLimitedExecutorService.java 2010-07-27 20:24:50 UTC (rev 3324) @@ -1,1506 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ -/* - * Created on Oct 29, 2008 - */ - -package com.bigdata.util.concurrent; - -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.AbstractExecutorService; -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Callable; -import java.util.concurrent.CancellationException; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Executor; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Future; -import java.util.concurrent.FutureTask; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.RunnableFuture; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; - -import org.apache.log4j.Logger; - -import com.bigdata.journal.CompactTask; -import com.bigdata.relation.rule.eval.pipeline.JoinMasterTask; -import com.bigdata.service.DataService; - -/** - * A lightweight class that may be used to impose a parallelism limit on tasks - * submitted to a delegate {@link Executor}. Typically, the delegate will be an - * {@link ExecutorService} that is shared among multiple facets of the - * application and which does not impose an inherent parallelism limit. This - * class may be useful when you want to limit the #of concurrent tasks submitted - * by some aspect of the application to a common {@link Executor}. For example, - * this class can be used to realize parallelism limits designs such as - * map/reduce, concurrent data load, JOIN algorithms, etc. - * <p> - * Note: Some effort has been made to define methods parallel to those declared - * by {@link ThreadPoolExecutor}, including {@link #getQueue()}, - * {@link #getActiveCount()}, {@link #getSuccessCount()}, etc. In addition, - * {@link #getMaxActiveCount()} reports the maximum observed parallelism for - * this service. - * <p> - * Note: This class is designed to delegate the actual execute of tasks to an - * {@link Executor}, which is often an {@link ExecutorService}. As such the - * {@link #shutdown()} and related methods pertain only to an instance of - * <em>this</em> class and the tasks submitted by that instance for execution - * by the delegate. In particular, {@link #shutdown()} and - * {@link #shutdownNow()} DO NOT shutdown the delegate {@link Executor}. - * <p> - * Note: The advantage of this class over a {@link ThreadPoolExecutor} with a - * maximum pool size are two fold. First, you can have many instances of this - * class which each target the same {@link ThreadPoolExecutor}. Second, while - * you can layer one {@link Executor} over another, this design would require - * twice as many threads to accomplish the same limit. In contrast, this class - * requires a single {@link Thread} per instance (for its inner - * {@link SubmitTask}) and all worker {@link Thread}s are hosted by the - * delegate. - * <p> - * Note: Since {@link AbstractExecutorService} does not provide a factory for - * the {@link FutureTask}s which it creates we have to override most of the - * methods on that class, which is a bit of a pain. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - * - * FIXME There are incompatable API changes for {@link ExecutorService} as of - * java 6. In order to work for both Java 5 and java 6 we need to write - * {@link #invokeAll(Collection)} and friends using the raw type (no generics). - * However, changes to {@link AbstractExecutorService} (factory methods that can - * be override in the subclass) and {@link RunnableFuture} (nice for proxying) - * mean that we will probably lock in on Java 6 in any case. This means that - * code which relies on the {@link ParallelismLimitedExecutorService} will not - * compile/execute under java 5 going foward. Currently, this is restricted to - * the {@link CompactTask} and the {@link JoinMasterTask} so there is really no - * hinderance for people stuck in Java 5 -- for now. - * - * @see http://osdir.com/ml/java.jsr.166-concurrency/2007-06/msg00030.html - * @see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6267833 - * - * @todo Refactor or write a variant that is capable of single-threaded - * execution when the executor is a remote service, e.g., a - * {@link DataService}. For this context, something that plays the same - * role as {@link FutureTask} needs to be proxied and sent to the - * {@link DataService} (or we need to unbundle the task and its future and - * send both, which is essentially what {@link FutureTask} is doing - * anyway). This means that the client exports the {@link Future} and that - * the {@link DataService} will notify the client when the {@link Future} - * is complete and use the proxy to set the result on the future as well. - * This means that the Future on the client can signal the - * {@link SubmitTask} when its future is ready, perhaps placing its - * {@link Future} onto a queue of futures that have been completed. This - * design will allow the {@link ParallelismLimitedExecutorService} to be - * used for map/reduce style processing. A client should be able to manage - * 1000s of concurrent tasks without trouble. - * - * FIXME The ParallelismLimitedExecutorService is broken (11/10/08). This can be - * demonstrated if it is enabled for the pipeline join. Therefore it has been - * taken out of service until it can be fixed. Users include the - * {@link CompactTask} and the {@link JoinMasterTask}. Prospective users - * include the ConcurrentDataLoader (RDF DB) and map/reduce processing. - * - * @deprecated It is easier to use a purpose specific {@link ExecutorService}. - */ -public class ParallelismLimitedExecutorService extends AbstractExecutorService { - - protected static final Logger log = Logger.getLogger(ParallelismLimitedExecutorService.class); - - protected static final boolean INFO = log.isInfoEnabled(); - - protected static final boolean DEBUG = log.isDebugEnabled(); - - /** - * Used to assign JVM local unique {@link #id}s. The only purpose of the - * #id is to show up in logging messages. - */ - private static final AtomicLong idfactory = new AtomicLong(0); - - /** - * Set from the {@link #idfactory}. - */ - private final long id; - - /** - * The service that is used to execute the submitted tasks. - */ - private final Executor executor; - - /** - * The maximum task parallelism that may be imposed on the {@link #executor} - * by this instance. - */ - private final int maxParallel; - - /** - * A {@link BlockingQueue} of tasks awaiting executing by the - * {@link #executor}. - */ - private final BlockingQueue<Runnable> workQueue; - - /** - * The queue of tasks submitted to this service that are pending submission - * to the delegate {@link Executor}. - */ - public BlockingQueue<Runnable> getQueue() { - - return workQueue; - - } - - /** - * The tasks that are currently running. - */ - private final QueueingFuture[] running; - - /** - * add() overwrites the first <code>null</code> entry in the - * {@link #running} table. - * - * @param f - * The future. - */ - private final void addRunning(final QueueingFuture f) { - - if (f == null) - throw new IllegalArgumentException(); - - synchronized (running) { - - for (int i = 0; i < running.length; i++) { - - if (running[i] == null) { - - running[i] = f; - - // #of tasks executing concurrently. - activeCount++; - - if (activeCount > maxActiveCount) { - - // update the maximum observed parallelism. - maxActiveCount = activeCount; - - } - - if (DEBUG) - log.debug("add : " + dumpRunning().toString() + ", taskCount=" - + activeCount); - - return; - - } - - } - - log.error(dumpRunning().toString()); - - throw new AssertionError("No room in running table?"); - - } - - } - - /** - * Scans the {@link #running} table and clears the first slot having the - * same reference. - * - * @param f - * The future. - */ - private final void removeRunning(final QueueingFuture f) { - - if (f == null) - throw new IllegalArgumentException(); - - synchronized (running) { - - for (int i = 0; i < running.length; i++) { - - if (running[i] == f) { - - running[i] = null; - - /* - * Decrement the counter tracking the #of tasks executing - * concurrently. - */ - - activeCount--; - - if (DEBUG) - log.debug("remove: " + dumpRunning().toString() - + ", taskCount=" + activeCount); - - return; - - } - - } - - log.error(dumpRunning().toString()); - - throw new AssertionError("Not found in running table?"); - - } - - } - - /** - * Formats the table as a string with spaces for empty slots and markers for - * filled slots. - * - * @return - */ - private final StringBuilder dumpRunning() { - - final StringBuilder sb = new StringBuilder(running.length + 20); - - sb.append("table=["); - - for (int i = 0; i < running.length; i++) { - - sb.append(running[i] == null ? ' ' : '|'); - - } - - sb.append("]"); - - return sb; - - } - - /** - * The maximum parallelism with which this object will drive the delegate - * {@link Executor} (this is the value specified to the ctor). - */ - final public int getMaxParallel() { - - return maxParallel; - - } - - /** - * {@link Lock} used to coordinate various things. - */ - private final ReentrantLock lock; - - /** - * Used by {@link SubmitTask} to wait until the #of executing tasks falls - * below the parallelism limit. Signalled each time a task submitted to the - * delegate {@link #executor} completes. - */ - private final Condition taskDone; - - /** - * Used by {@link #awaitTermination(long, TimeUnit)}. Signalled by - * {@link SubmitTask#run()} once the {@link #runState} is such that no more - * tasks will be executed and there are no more tasks running. - */ - private final Condition terminated; - - /** - * Run state. - */ - private volatile int runState = RUNNING; - - /** - * Paranoid gateway for state change. - * - * @param newState - * The new state. - */ - private final void setRunState(int newState) { - - final int oldState = runState; - - assert oldState >= RUNNING && oldState <= TERMINATED : "oldState=" - + oldState; - - assert newState >= RUNNING && newState <= TERMINATED : "newState=" - + newState; - - assert oldState < newState; - -// assert lock.isHeldByCurrentThread(); - - runState = newState; - - if (INFO) - log.info("id="+id+", oldState=" + oldState + ", newState=" + runState); - - } - - /** - * The initial mode on startup. In this mode the service will accept new - * tasks and will execute tasks that are already in its {@link #workQueue}. - */ - static private final int RUNNING = 0; - - /** - * The mode for normal shutdown. In this mode the service WILL NOT accept - * new tasks but it will continue to execute tasks that are already in its - * {@link #workQueue}. This contraint is imposed by - * {@link #execute(Runnable)}. Once all tasks in the {@link #workQueue} - * have been submitted the {@link #runState} is changed to - * {@link #TERMINATED} by {@link SubmitTask#run()}. - */ - static private final int SHUTDOWN = 1; - - /** - * The mode for immediate shutdown. In this mode the service WILL NOT accept - * new tasks and it WILL NOT submit any tasks that are already its - * {@link #workQueue} for execution by the delegate {@link #executor}. The - * {@link #runState} will be changed to {@link #TERMINATED} by - * {@link SubmitTask#run()} as soon as it notices the {@link #STOPPED} - * runState. - */ - static private final int STOPPED = 2; - - /** - * Terminal state. In this mode the service WILL NOT accept new tasks and - * all tasks which it has submitted have either completed successfully or - * been cancelled. - */ - static private final int TERMINATED = 3; - - public boolean isShutdown() { - - return runState != RUNNING; - - } - - public boolean isTerminating() { - - return runState == STOPPED; - - } - - public boolean isTerminated() { - - return runState == TERMINATED; - - } - - /** - * Variant using a workQueue with a default capacity. - * - * @param executor - * The {@link Executor} that will run the tasks. - * @param maxParallel - * The maximum #of tasks submitted by this instance that may - * execute concurrently on that {@link Executor}. - */ - public ParallelismLimitedExecutorService(final Executor executor, - final int maxParallel) { - - this(executor, maxParallel, 16/* default */); - - } - - /** - * Variant using a {@link ArrayBlockingQueue} with a caller specified - * capacity. - * - * @param executor - * The {@link Executor} that will run the tasks. - * @param maxParallel - * The maximum #of tasks submitted by this instance that may - * execute concurrently on that {@link Executor}. - * @param capacity - * The maximum #of tasks that may be queued by this instance - * awaiting execution by that {@link Executor}. - */ - public ParallelismLimitedExecutorService(final Executor executor, - final int maxParallel, final int capacity) { - - this(executor, maxParallel, new ArrayBlockingQueue<Runnable>(capacity)); - - } - - /** - * Core ctor. - * - * @param executor - * The {@link Executor} that will run the tasks. - * @param maxParallel - * The maximum #of tasks submitted by this instance that may - * execute concurrently on that {@link Executor}. - * @param workQueue - * A queue that will be used to hold tasks which have been - * submitted to this instance but have not yet been submitted to - * that {@link Executor}. - */ - public ParallelismLimitedExecutorService(final Executor executor, - final int maxParallel, final BlockingQueue<Runnable> workQueue) { - - if (executor == null) - throw new IllegalArgumentException(); - - if (maxParallel <= 0) - throw new IllegalArgumentException(); - - if (workQueue == null) - throw new IllegalArgumentException(); - - this.id = idfactory.incrementAndGet(); - - this.executor = executor; - - this.maxParallel = maxParallel; - - this.workQueue = workQueue; - - this.lock = new ReentrantLock(); - - this.taskDone = lock.newCondition(); - - this.terminated = lock.newCondition(); - - this.running = new QueueingFuture[maxParallel]; - - if (INFO) - log.info("Starting: id=" + id); - - /* - * Now that everything is initialized, start the task to drain the - * workQueue. - */ - - executor.execute(new SubmitTask()); - - } - - /** - * Task this imposes the parallelism constraint. It waits until the #of - * tasks which it has submitted and which are still executing falls below - * the parallelism limit and then submits the next task. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - */ - private class SubmitTask implements Runnable { - - /** - * Timeout limiting how long we will block on the workQueue or - * underCapacity condition. This essentially controls how long it will - * take this task to notice that the runState has changed when it would - * otherwise be blocked. - */ - final long timeout = TimeUnit.NANOSECONDS.convert(1L, - TimeUnit.MILLISECONDS); - - public void run() { - - if (INFO) - log.info("Started: id=" + id); - - try { - - /* - * Submit new tasks while until STOP or TERMINATED - */ - while (runState < STOPPED) { - - if(DEBUG) - log.debug("runState=" + runState + ", taskCount=" - + activeCount + ", workQueue is empty"); - - /* - * Poll w/ timeout if nothing available so that we will - * notice runState changes in a timely manner. - */ - - final Runnable task = workQueue.poll(timeout, - TimeUnit.NANOSECONDS); - - if (task == null) { - - // There is nothing available right now. - - if (runState == SHUTDOWN) { - - /* - * There is nothing available and we have been - * instructed to shutdown the service. Therefore we - * change the runState to STOPPED in order to - * prevent any new tasks from executing (this breaks - * us out of the loop). - */ - - if (INFO) - log.info("Service is shutdown and workQueue is empty."); - - setRunState(STOPPED); - - } - - continue; // while(runState<STOPPED) - - } - - if(DEBUG) - log.debug("Awaiting lock"); - - assert task != null; - - lock.lock(); - - try { - - while (runState < STOPPED && activeCount >= maxParallel) { - - /* - * Await condition indicating that we are within the - * parallelism limit and may submit another task. - */ - - if (INFO) - log.info("Waiting to execute: runState=" - + runState + ", taskCount=" - + activeCount + ", task=" + task); - - taskDone.await(timeout, TimeUnit.NANOSECONDS); - - } - - if (runState < STOPPED) { - - /* - * We have a task and we are under capacity so - * submit that task to the delegate Executor. - */ - - if (INFO) - log.info("Executing: id=" + id + ", task=" - + task); - - addRunning((QueueingFuture) task); - - executor.execute(task); - - } else { - - /* - * Note: The task will not be submitted because of - * the runState. - */ - - if (INFO) - log.info("Will not execute: id=" + id - + ", runState=" + runState - + ", taskCount=" + activeCount - + ", task=" + task); - - } - - } finally { - - lock.unlock(); - - } - - } // while(runState<STOPPED) - - } catch (InterruptedException t) { - - // terminated by interrupt - return; - - } catch (Throwable t) { - - log.error(t, t); - - } finally { - - if (DEBUG) - log.debug("Exit logic."); - - if (runState != TERMINATED) { - - // wait for running tasks to complete. - terminate(); - - } - - } - - } - - /** - * Service termination logic. - * - * @throws InterruptedException - */ - private void terminate() { - - if (INFO) - log.info("Will terminate: runState=" + runState); - - lock.lock(); - - try { - - // wait until no more tasks are running. - while (activeCount > 0) { - - if (INFO) - log.info("runState=" + runState + ", taskCount=" - + activeCount); - - try { - - // wait until another task completes. - taskDone.await(); - - } catch (InterruptedException ex) { - - log.warn("Interrupted awaiting termination: taskCount=" - + activeCount); - - /* - * Note: This continues to await the termination of the - * running tasks. Without this, awaitTermination() we - * would never terminated.signal() and - * awaitTermination() would not complete. - */ - - continue; - - } - - } - - if (INFO) - log.info("No more tasks are running: "+this); - - setRunState(TERMINATED); - - /* - * Note: Only awaitTermination() uses this signal so we do not - * use signalAll(). - */ - terminated.signal(); - - if (INFO) - log.info("Did terminate: "+this); - - } finally { - - lock.unlock(); - - } - - } - - /** - * Delegates to the outer class. - */ - public String toString() { - - return ParallelismLimitedExecutorService.this.toString(); - - } - - } - - /** - * #of tasks submitted by this instance that are executing concurrently - * (fluctuates with the current actual parallelism). - * <p> - * This is updated by {@link #addRunning(QueueingFuture)} and decremented by - * {@link #removeRunning(QueueingFuture)}. Anyone is allowed to peek, but - * you can only trust the value if hold the {@link #lock} since that governs - * access (indirectly) to those methods. - */ - private volatile int activeCount = 0; - - /** - * The maximum #of tasks submitted to this service that were executing - * concurrently on the delegate {@link Executor} (strictly increasing). - */ - private volatile int maxActiveCount = 0; - - /** - * #of tasks which have been submitted for execution (strictly increasing). - */ - private volatile long taskCount = 0L; - - /** - * #of tasks which have completed execution regardless of their outcome - * (strictly increasing). - */ - private volatile long completedTaskCount = 0L; - - /** - * #of submitted tasks which were cancelled (strictly increasing). - */ - private volatile long cancelCount = 0L; - - /** - * #of submitted tasks which resulted in an error (strictly increasing). - */ - private volatile long errorCount = 0L; - - /** - * #of submitted tasks which were completed successfully (strictly - * increasing). - */ - private volatile long successCount = 0L; - - /** - * The approximate #of tasks submitting by this service that are - * concurrently executing. This method is very fast and returns current - * value of an internal counter. - */ - public int getActiveCount() { - - return activeCount; - - } - - /** - * The approximate maximum #of tasks submitted to this service that were - * executing concurrently on the delegate {@link Executor} (that is, the - * maximum observed parallelism of this service). This method is very fast - * and returns current value of an internal counter. - */ - public int getMaxActiveCount() { - - return maxActiveCount; - - } - - /** - * The approximate #of tasks which have been submitted for execution by this - * service. Such tasks may be the queue for this service, on the queue for - * the delegate {@link Executor}, currently executing, or completed. This - * method is very fast and returns current value of an monotonically - * increasing internal counter. - */ - public long getTaskCount() { - - return taskCount; - - } - - /** - * The approximate #of tasks that have completed execution (regardless or - * whether they were cancelled, resulted in an error, or executed - * successfully). This method is very fast and returns current value of an - * monotonically increasing internal counter. - */ - public long getCompletedTaskCount() { - - return completedTaskCount; - - } - - /** - * The approximate #of submitted tasks which were cancelled. This method is - * very fast and returns current value of an monotonically increasing - * internal counter. - */ - public long getCancelCount() { - - return cancelCount; - - } - - /** - * The approximate #of submitted tasks which resulted in an error (does not - * include any tasks which have been cancelled). This method is very fast - * and returns current value of an monotonically increasing internal - * counter. - */ - public long getErrorCount() { - - return errorCount; - - } - - /** - * The approximate #of submitted tasks which were completed successfully. - * This method is very fast and returns current value of an monotonically - * increasing internal counter. - */ - public long getSuccessCount() { - - return successCount; - - } - - /** - * Returns an instantenous snapshot of the service counters. No lock is - * obtained so the counters are NOT guarenteed to be mutually consistent. In - * particular, errorCount+successCount+cancelCount is NOT guarenteed to be - * equal to the completedTaskCount. - */ - public String toString() { - - StringBuilder sb = new StringBuilder(getClass().getSimpleName()); - - sb.append("{ id=" + id); - - sb.append(", maxParallel=" + maxParallel); - - sb.append(", taskCount=" + taskCount); - - sb.append(", activeCount="+activeCount); - - sb.append(", maxActiveCount="+maxActiveCount); - - sb.append(", completedTaskCount="+completedTaskCount); - - sb.append(", cancelCount="+cancelCount); - - sb.append(", errorCount="+errorCount); - - sb.append(", successCount="+successCount); - - sb.append(", runState="+runState); - - sb.append("}"); - - return sb.toString(); - - } - - /** - * Extends {@link FutureTask} to track the #of concurrently executing tasks - * and also track the references for those tasks so that they may be - * cancelled if the outer service is shutdown. - */ - private class QueueingFuture<V> extends FutureTask<V> { - - private final Object task; - - QueueingFuture(Callable<V> c) { - super(c); - task = c; - } - - QueueingFuture(Runnable t, V r) { - super(t, r); - task = r; - } - -// public void run() { -// -// /* -// * Note: We can not wait until the task is bound to a worker task -// * and executing since that allows more than [maxParallel] tasks to -// * exist on the delegate [executor] between its queue and its worker -// * tasks. -// */ -// -//// addRunning(this); -// -// super.run(); -// -// } - - /** - * Extended to decrement the #of concurrently running tasks. - */ - protected void done() { - - /* - * Note: the entry must be removed from the table before - * taskDone.signal() since otherwise it is possible for SubmitTask - * to submit another task for execution before the entry has been - * cleared from the table. - */ - removeRunning(this); - - super.done(); - - lock.lock(); - try { - - /* - * Track #of completed tasks, #of cancelled, errored, and - * successful tasks, etc. - */ - - completedTaskCount++; - - if(isCancelled()) { - - cancelCount++; - - if(INFO) - log.info("cancelled: "+task); - - } else { - - try { - get(); - successCount++; - if(INFO) - log.info("succeeded: "+task); - } catch (InterruptedException e) { - throw new AssertionError( - "Should not wait for completed task"); - } catch (ExecutionException e) { - if(INFO) - log.info("failed: "+task, e); - errorCount++; - } - - } - - /* - * Signal now that this task has completed. - * - * Note: Only the SubmitTask await()s this signal so we do not - * use signalAll(). - */ - - taskDone.signal(); - - } finally { - - lock.unlock(); - - } - - } - - public String toString() { - - if (INFO) - return super.toString() + "{ task=" + task + "}"; - - return super.toString(); - - } - - } - - /** - * Invoked if a command is rejected for execution. - * - * @param command - * The command. - */ - private void reject(Runnable command) { - - throw new RejectedExecutionException(); - - } - - /** - * Initiates an orderly shutdown in which previously submitted tasks are - * executed, but no new tasks will be accepted. Invocation has no additional - * effect if already invoked. - */ - public void shutdown() { - - lock.lock(); - - try { - - if (runState == RUNNING) { - - setRunState( SHUTDOWN ); - - } - - } finally { - - lock.unlock(); - - } - - } - - public List<Runnable> shutdownNow() { - - lock.lock(); - - try { - - if (runState < STOPPED) { - - /* - * Prevent any tasks in the workQueue from executing. - */ - - setRunState( STOPPED ); - - } - - /* - * Collect the pending tasks from the workQueue. - */ - - final LinkedList<Runnable> pending = new LinkedList<Runnable>(); - - workQueue.drainTo(pending); - - /* - * Interrupt any executing tasks that we submitted to the delegate - * Executor. - */ - { - - final QueueingFuture[] a = running.clone(); - - for (QueueingFuture f : a) { - - if (f != null && !f.isDone()) { - - f.cancel(true/* mayInterruptIfRunning */); - - } - - } - - } - - // return the pending tasks. - return pending; - - } finally { - - lock.unlock(); - - } - - } - - /** - * Makes the factory pattern easier. - * - * @param futureTask - * A task to be executed. - * - * @return The task. - */ - final private <T> FutureTask<T> execute2(final FutureTask<T> futureTask) { - - /* - * Note: lock gives us an atomic view of the runState. - */ - lock.lock(); - - try { - - if (runState != RUNNING) { - - reject(futureTask); - - return futureTask; - - } - - try { - - // put to the workQueue (may block). - workQueue.put(futureTask); - - // #of tasks submitted for execution. - taskCount++; - - } catch (InterruptedException ex) { - - if (INFO) - log.info("Interrupted"); - - reject(futureTask); - - return futureTask; - - } - - } finally { - - lock.unlock(); - - } - - return futureTask; - - } - -// /** -// * Returns a RunnableFuture for the given callable task. -// * -// * @since 1.6 -// */ -// protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { -// -// return super.newTaskFor(callable); -// -// } -// -// /** -// * Returns a RunnableFuture for the given runnable and default value. -// * -// * @since 1.6 -// */ -// protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) { -// -// return super.newTaskFor(runnable, value); -// -// } - - /** - * {@link FutureTask} factory. - * - * @param task - * A task. - * - * @return A {@link FutureTask} for that task. - * - * - * FIXME replace in 1.6 with {@link #newTaskFor(Callable)}. Also includes - * the {@link RunnableFuture} abstraction which will make life much easier. - */ - protected <T> FutureTask<T> newFuture(final Callable<T> task) { - - if (task == null) - throw new NullPointerException(); - - return new QueueingFuture<T>(task); - - } - - /** - * {@link FutureTask} factory. - * - * @param task - * A task. - * @param result - * The result for that tas. - * - * @return A {@link FutureTask} for that task. - * - * FIXME replace in 1.6 with {@link #newTaskFor(Runnable, Object)}. - */ - protected <T> FutureTask<T> newFuture(Runnable task, T result) { - - if (task == null) - throw new NullPointerException(); - - if(INFO) - log.info("task="+task); - - return new QueueingFuture<T>(task, result); - - } - - public void execute(final Runnable command) { - - if (command == null) - throw new IllegalArgumentException(); - - if(DEBUG) - log.debug("task: "+command); - - execute2(newFuture(command, null)); - - } - - @Override - public Future<?> submit(final Runnable task) { - - if(DEBUG) - log.debug("task: "+task); - - return execute2(newFuture(task, null)); - - } - - @Override - public <T> Future<T> submit(final Runnable task, final T result) { - - if(DEBUG) - log.debug("task: "+task); - - return execute2(newFuture(task, result)); - - } - - @Override - public <T> Future<T> submit(final Callable<T> task) { - - if(DEBUG) - log.debug("task: "+task); - - return execute2(newFuture(task)); - - } - - /** - * Await termination of this service (not the delegate service). - */ - public boolean awaitTermination(final long timeout, final TimeUnit unit) - throws InterruptedException { - - if (INFO) - log.info("id="+id+", timeout=" + timeout + ", unit=" + unit); - - long remaining = unit.toNanos(timeout); - - lock.lock(); - - try { - - while (runState < TERMINATED && remaining > 0L) { - - remaining = terminated.awaitNanos(remaining); - - if (DEBUG) - log.debug("id="+id+", runState=" + runState + ", taskCount=" - + activeCount + ", remaining=" + remaining); - - } - - final boolean terminated = runState == TERMINATED; - - if (INFO) - log.info("id="+id+", terminated="+terminated); - - return terminated; - - } finally { - - lock.unlock(); - - } - - } - - /** - * FIXME As of Java 1.6 the method signature is changed and you need to - * modify the method signature here in the source code to use - * - * <pre> - * Collection<? extends Callable<T>> tasks - * </pre> - * - * rather than - * - * <pre> - * Collection < Callable < T >> tasks - * </pre> - * - * I love generics. - * - * @see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6267833 - */ - @Override - public <T> List<Future<T>> invokeAll(final Collection<? extends Callable<T>> tasks) - throws InterruptedException { - - final List<Future<T>> futures = new LinkedList<Future<T>>(); - - boolean done = false; - - try { - - // submit all. - - for (Callable<T> task : tasks) { - - futures.add(submit(task)); - - } - - // await all futures. - - for (Future<T> f : futures) { - - if (!f.isDone()) { - - try { - - f.get(); - - } catch (ExecutionException ex) { - - // ignore. - - } catch (CancellationException ex) { - - // ignore. - - } - - } - - } - - done = true; - - return futures; - - } finally { - - if (!done) { - - // At least one future did not complete. - - for (Future<T> f : futures) { - - if(!f.isDone()) { - - f.cancel(true/* mayInterruptIfRunning */); - - } - - } - - } - - } - - } - - /** - * This is just a variant of the method above but we also have to count down - * the nanos remaining and then cancel any tasks which are not yet complete - * if there is a timeout. - * - * FIXME As of Java 1.6 the method signature is changed and you need to - * modify the method signature here in the source code to use - * - * <pre> - * Collection<? extends Callable<T>> tasks - * </pre> - * - * rather than - * - * <pre> - * Collection < Callable < T >> tasks - * </pre> - * - * I love generics. - * - * @see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6267833 - */ - @Override - public <T> List<Future<T>> invokeAll(final Collection<? extends Callable<T>> tasks, - final long timeout, final TimeUnit unit) - throws InterruptedException { - - final long begin = System.nanoTime(); - - long remaining = unit.toNanos(timeout); - - final List<Future<T>> futures = new LinkedList<Future<T>>(); - - boolean done = false; - - try { - - // submit all, even before we consider the timeout. - for (Callable<T> task : tasks) { - - futures.add(submit(task)); - - } - - // await all futures, but no longer than the timeout. - for (Future<T> f : futures) { - - remaining = System.nanoTime() - begin; - - if (remaining < 0) { - - return cancelAll(futures); - - } - - if (!f.isDone()) { - - try { - - f.get(remaining, TimeUnit.NANOSECONDS); - - } catch (ExecutionException ex) { - - // ignore. - - } catch (CancellationException ex) { - - // ignore. - - } catch(TimeoutException ex) { - - return cancelAll(futures); - - } - - } - - } - - done = true; - - return futures; - - } finally { - - if (!done) { - - // At least one future did not complete. - return cancelAll(futures); - - } - - } - - } - - private <T> List<Future<T>> cancelAll(final List<Future<T>> futures) { - - for (Future<T> f : futures) { - - if (!f.isDone()) { - - f.cancel(true/* mayInterruptIfRunning */); - - } - - } - - return futures; - - } - -} Modified: trunk/bigdata/src/test/com/bigdata/util/concurrent/TestAll.java =================================================================== --- trunk/bigdata/src/test/com/bigdata/util/concurrent/TestAll.java 2010-07-27 19:31:00 UTC (rev 3323) +++ trunk/bigdata/src/test/com/bigdata/util/concurrent/TestAll.java 2010-07-27 20:24:50 UTC (rev 3324) @@ -61,8 +61,6 @@ final TestSuite suite = new TestSuite("com.bigdata.util.concurrent"); - suite.addTestSuite( TestParallelismLimitedExecutorService.class ); - suite.addTestSuite( TestLatch.class ); return suite; Deleted: trunk/bigdata/src/test/com/bigdata/util/concurrent/TestParallelismLimitedExecutorService.java =================================================================== --- trunk/bigdata/src/test/com/bigdata/util/concurrent/TestParallelismLimitedExecutorService.java 2010-07-27 19:31:00 UTC (rev 3323) +++ trunk/bigdata/src/test/com/bigdata/util/concurrent/TestParallelismLimitedExecutorService.java 2010-07-27 20:24:50 UTC (rev 3324) @@ -1,398 +0,0 @@ -/* - -Copyright (C) SYSTAP, LLC 2006-2008. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ -/* - * Created on Oct 29, 2008 - */ - -package com.bigdata.util.concurrent; - -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; - -import junit.framework.TestCase2; - -/** - * Test suite for {@link ParallelismLimitedExecutorService}. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id$ - * - * @deprecated It is easier to use a purpose specific {@link ExecutorService}. - */ -public class TestParallelismLimitedExecutorService extends TestCase2 { - - /** - * - */ - public TestParallelismLimitedExecutorService() { - - } - - /** - * @param arg0 - */ - public TestParallelismLimitedExecutorService(String arg0) { - - super(arg0); - - } - - /** - * Test the ability to create and shutdown the service. - * - * @throws InterruptedException - */ - public void test_lifeCycle_shutdown() throws InterruptedException { - - final ExecutorService delegate = Executors.newCachedThreadPool(); - - try { - - final ParallelismLimitedExecutorService service = new ParallelismLimitedExecutorService( - delegate, 1/* maxParallel */, 1/* queueCapacity */); - - service.shutdown(); - - if (!service.awaitTermination(1L, TimeUnit.SECONDS)) { - - fail("Service is not shutdown."); - - } - - assertEquals(0,service.getTaskCount()); - assertEquals(0,service.getCompletedTaskCount()); - assertEquals(0,service.getErrorCount()); - assertEquals(0,service.getCancelCount()); - assertEquals(0,service.getSuccessCount()); - assertEquals(0,service.getActiveCount()); - assertEquals(0,service.getMaxActiveCount()); - assertEquals(1,service.getQueue().remainingCapacity()); - - } finally { - - delegate.shutdownNow(); - - } - - } - - /** - * Test ability to create a service, submit a task, and shutdown the - * service. - * - * @throws InterruptedException - */ - public void test_lifeCycle_submit1_shutdown() throws InterruptedException { - - final ExecutorService delegate = Executors.newCachedThreadPool(); - - try { - - final ParallelismLimitedExecutorService service = new ParallelismLimitedExecutorService( - delegate, 1/* maxParallel */, 1/*queueCapacity*/); - - service.submit(new Runnable() { - public void run() { - } - }); - - service.shutdown(); - - if (!service.awaitTermination(1L, TimeUnit.SECONDS)) { - - fail("Service is not shutdown."); - - } - - assertEquals(1,service.getTaskCount()); - assertEquals(1,service.getCompletedTaskCount()); - assertEquals(0,service.getErrorCount()); - assertEquals(0,service.getCancelCount()); - assertEquals(1,service.getSuccessCount()); - assertEquals(0,service.getActiveCount()); - assertEquals(1,service.getMaxActiveCount()); - assertEquals(1,service.getQueue().remainingCapacity()); - - } finally { - - delegate.shutdownNow(); - - } - } - - public void test_lifeCycle_shutdownNow() throws InterruptedException { - - final ExecutorService delegate = Executors.newCachedThreadPool(); - - try { - final ParallelismLimitedExecutorService service = new ParallelismLimitedExecutorService( - delegate, 1/* maxParallel */, 1/*queueCapacity*/); - - final List<Runnable> pending = service.shutdownNow(); - - assertEquals(0, pending.size()); - - if (!service.awaitTermination(1L, TimeUnit.SECONDS)) { - - fail("Service is not shutdown."); - - } - - assertEquals(0,service.getTaskCount()); - assertEquals(0,service.getCompletedTaskCount()); - assertEquals(0,service.getErrorCount()); - assertEquals(0,service.getCancelCount()); - assertEquals(0,service.getSuccessCount()); - assertEquals(0,service.getActiveCount()); - assertEquals(0,service.getMaxActiveCount()); - assertEquals(1,service.getQueue().remainingCapacity()); - - } finally { - - delegate.shutdownNow(); - - } - - } - - public void test_lifeCycle_submitAndWait_shutdownNow() - throws InterruptedException { - - final ExecutorService delegate = Executors.newCachedThreadPool(); - - try { - - final ParallelismLimitedExecutorService service = new ParallelismLimitedExecutorService( - delegate, 1/* maxParallel */, 1/*queueCapacity*/); - - final AtomicBoolean started = new AtomicBoolean(false); - - service.submit(new Runnable() { - public void run() { - started.set(true); - // run until interupted (aka until cancelled). - while (!Thread.interrupted()) { - try { - Thread.sleep(10/* ms */); - } catch (InterruptedException e) { - // exit. - break; - } - } - } - }); - - final long begin = System.currentTimeMillis(); - while (!started.get() - && (System.currentTimeMillis() - begin) < 1000) { - // twiddle thumbs. - } - - assertTrue(started.get()); - - final List<Runnable> pending = service.shutdownNow(); - - assertEquals(0, pending.size()); - - if (!service.awaitTermination(1L, TimeUnit.SECONDS)) { - - fail("Service is not shutdown."); - - } - - assertEquals(1,service.getTaskCount()); - assertEquals(1,service.getCompletedTaskCount()); - assertEquals(0,service.getErrorCount()); - assertEquals(1,service.getCancelCount()); - assertEquals(0,service.getSuccessCount()); - assertEquals(0,service.getActiveCount()); - assertEquals(1,service.getMaxActiveCount()); - assertEquals(1,service.getQueue().remainingCapacity()); - - } finally { - - delegate.shutdownNow(); - - } - - } - - public void test_lifeCycle_rejectAfterShutdown() - throws InterruptedException { - - final ExecutorService delegate = Executors.newCachedThreadPool(); - - try { - - final ParallelismLimitedExecutorService service = new ParallelismLimitedExecutorService( - delegate, 1/* maxParallel */, 1/*queueCapacity*/); - - service.shutdown(); - - try { - - service.submit(new Runnable() { - public void run() { - } - }); - - fail("Expecting: " + RejectedExecutionException.class); - - } catch (RejectedExecutionException ex) { - - log.info("Ignoring expected exception: " + ex); - - } - - assertEquals(0,service.getTaskCount()); - assertEquals(0,service.getCompletedTaskCount()); - assertEquals(0,service.getErrorCount()); - assertEquals(0,service.getCancelCount()); - assertEquals(0,service.getSuccessCount()); - assertEquals(0,service.getActiveCount()); - assertEquals(0,service.getMaxActiveCount()); - assertEquals(1,service.getQueue().remainingCapacity()); - - } finally { - - delegate.shutdownNow(); - - } - - } - - /** - * Stress test that explores: (a) whether we can reach the maximum - * parallelism; and (b) makes sure that we do not ... [truncated message content] |
From: <tho...@us...> - 2010-07-27 19:31:09
|
Revision: 3323 http://bigdata.svn.sourceforge.net/bigdata/?rev=3323&view=rev Author: thompsonbry Date: 2010-07-27 19:31:00 +0000 (Tue, 27 Jul 2010) Log Message: ----------- rename bigdata-pref/bigdata-bsbm -> bigdata-perf/bsbm. Added Paths: ----------- trunk/bigdata-perf/bsbm/ Removed Paths: ------------- trunk/bigdata-perf/bigdata-bsbm/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 19:29:17
|
Revision: 3322 http://bigdata.svn.sourceforge.net/bigdata/?rev=3322&view=rev Author: thompsonbry Date: 2010-07-27 19:29:11 +0000 (Tue, 27 Jul 2010) Log Message: ----------- rename bigdata-pref/bigdata-lubm -> bigdata-perf/lubm. Added Paths: ----------- trunk/bigdata-perf/lubm/ Removed Paths: ------------- trunk/bigdata-perf/bigdata-lubm/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 19:20:12
|
Revision: 3321 http://bigdata.svn.sourceforge.net/bigdata/?rev=3321&view=rev Author: thompsonbry Date: 2010-07-27 19:20:06 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Renabled the DiskOnlyStrategy test suite since some things still use that class (scale-out). Modified Paths: -------------- trunk/bigdata/src/test/com/bigdata/journal/TestAll.java Modified: trunk/bigdata/src/test/com/bigdata/journal/TestAll.java =================================================================== --- trunk/bigdata/src/test/com/bigdata/journal/TestAll.java 2010-07-27 19:12:15 UTC (rev 3320) +++ trunk/bigdata/src/test/com/bigdata/journal/TestAll.java 2010-07-27 19:20:06 UTC (rev 3321) @@ -108,7 +108,8 @@ // } -// suite.addTest( TestDiskJournal.suite() ); + // @todo remove when we remove the DiskOnlyStrategy impl. + suite.addTest( TestDiskJournal.suite() ); suite.addTest( TestWORMStrategy.suite() ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 19:12:21
|
Revision: 3320 http://bigdata.svn.sourceforge.net/bigdata/?rev=3320&view=rev Author: thompsonbry Date: 2010-07-27 19:12:15 +0000 (Tue, 27 Jul 2010) Log Message: ----------- It turns out that the StoreManager for scale-out has a dependency on the specific class used to represent the performance counters on the DiskOnlyStrategy. I therefore had to restore the ability to select the DiskOnlyStrategy class (rather than WORMStrategy) using BufferMode.Disk. Modified Paths: -------------- trunk/bigdata/src/java/com/bigdata/journal/AbstractJournal.java trunk/bigdata/src/java/com/bigdata/resources/StoreManager.java Modified: trunk/bigdata/src/java/com/bigdata/journal/AbstractJournal.java =================================================================== --- trunk/bigdata/src/java/com/bigdata/journal/AbstractJournal.java 2010-07-27 18:51:29 UTC (rev 3319) +++ trunk/bigdata/src/java/com/bigdata/journal/AbstractJournal.java 2010-07-27 19:12:15 UTC (rev 3320) @@ -1027,33 +1027,33 @@ } -// case Disk: { -// -// /* -// * Setup the buffer strategy. -// */ -// -// fileMetadata = new FileMetadata(file, BufferMode.Disk, -// useDirectBuffers, initialExtent, maximumExtent, create, -// isEmptyFile, deleteOnExit, readOnly, forceWrites, -// offsetBits, //readCacheCapacity, readCacheMaxRecordSize, -// //readOnly ? null : writeCache, -// writeCacheEnabled, -// validateChecksum, -// createTime, checker, alternateRootBlock); -// -// _bufferStrategy = new DiskOnlyStrategy( -// 0L/* soft limit for maximumExtent */, -//// minimumExtension, -// fileMetadata); -// -// this._rootBlock = fileMetadata.rootBlock; -// -// break; -// -// } + case Disk: { - case Disk: + /* + * Setup the buffer strategy. + */ + + fileMetadata = new FileMetadata(file, BufferMode.Disk, + useDirectBuffers, initialExtent, maximumExtent, create, + isEmptyFile, deleteOnExit, readOnly, forceWrites, + offsetBits, //readCacheCapacity, readCacheMaxRecordSize, + //readOnly ? null : writeCache, + writeCacheEnabled, + validateChecksum, + createTime, checker, alternateRootBlock); + + _bufferStrategy = new DiskOnlyStrategy( + 0L/* soft limit for maximumExtent */, +// minimumExtension, + fileMetadata); + + this._rootBlock = fileMetadata.rootBlock; + + break; + + } + +// case Disk: case DiskWORM: { /* Modified: trunk/bigdata/src/java/com/bigdata/resources/StoreManager.java =================================================================== --- trunk/bigdata/src/java/com/bigdata/resources/StoreManager.java 2010-07-27 18:51:29 UTC (rev 3319) +++ trunk/bigdata/src/java/com/bigdata/resources/StoreManager.java 2010-07-27 19:12:15 UTC (rev 3320) @@ -2446,7 +2446,8 @@ * the "historical" journals managed by this data service. * * FIXME Must also roll the counters forward for the other journal - * buffer strategies! + * buffer strategies! (The implementation class is different for the + * WORMStrategy, which is causing complications right now.) */ if (getBufferStrategy() instanceof DiskOnlyStrategy) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 18:51:36
|
Revision: 3319 http://bigdata.svn.sourceforge.net/bigdata/?rev=3319&view=rev Author: thompsonbry Date: 2010-07-27 18:51:29 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Added release notes for 0.83.0 (still beta). Added Paths: ----------- trunk/bigdata/src/releases/RELEASE_0_83_0.txt Added: trunk/bigdata/src/releases/RELEASE_0_83_0.txt =================================================================== --- trunk/bigdata/src/releases/RELEASE_0_83_0.txt (rev 0) +++ trunk/bigdata/src/releases/RELEASE_0_83_0.txt 2010-07-27 18:51:29 UTC (rev 3319) @@ -0,0 +1,64 @@ +This is a bigdata (R) snapshot release. This release is capable of loading 1B +triples in under one hour on a 15 node cluster and has been used to load up to +13B triples on the same cluster. JDK 1.6 is required. + +See [1] for instructions on installing bigdata(R), [2] for the javadoc and [3] +and [4] for news, questions, and the latest developments. For more information +about SYSTAP, LLC and bigdata, see [5]. + +Please note that we recommend checking out the code from SVN using the tag for +this release. The code will build automatically under eclipse. You can also +build the code using the ant script. The cluster installer requires the use of +the ant script. You can checkout this release from the following URL: + + https://bigdata.svn.sourceforge.net/svnroot/bigdata/tags/RELEASE_0.83.0 + +This tag corresponds to revision XXXX. + +New features: + +- Inlining XSD numerics, xsd:boolean, or custom datatype extensions + into the statement indices. Inlining provides a smaller footprint + and faster queries for data using XSD numeric datatypes. In order + to introduce inlining we were forced to make a change in the + physical schema for the RDF database which breaks binary + compatibility for existing stores. The recommended migration path + is to export the data and import it into a new bigdata instance. + +- Refactor of the dynamic sharding mechanism for higher performance. + +- The SparseRowStore has been modified to make Unicode primary keys + decodable by representing Unicode primary keys using UTF8 rather + than Unicode sort keys. This change also allows the SparseRowStore + to work with the JDK collator option which embeds nul bytes into + Unicode sort keys. This change breaks binary compatibility, but + there is an option for historical compatibility. + +The roadmap for the next releases include: + +- Query optimizations; + +- Support for high-volume analytic query workloads and SPARQL aggregations; + +- High availability for the journal and the cluster; + +- Simplified deployment, configuration, and administration for clusters. + +For more information, please see the following links: + +[1] http://bigdata.wiki.sourceforge.net/GettingStarted +[2] http://www.bigdata.com/bigdata/docs/api/ +[3] http://sourceforge.net/projects/bigdata/ +[4] http://www.bigdata.com/blog +[5] http://www.systap.com/bigdata.htm + +About bigdata: + +Bigdata\xAE is a horizontally-scaled, general purpose storage and computing fabric +for ordered data (B+Trees), designed to operate on either a single server or a +cluster of commodity hardware. Bigdata\xAE uses dynamically partitioned key-range +shards in order to remove any realistic scaling limits - in principle, bigdata\xAE +may be deployed on 10s, 100s, or even thousands of machines and new capacity may +be added incrementally without requiring the full reload of all data. The bigdata\xAE +RDF database supports RDFS and OWL Lite reasoning, high-level query (SPARQL), +and datum level provenance. Property changes on: trunk/bigdata/src/releases/RELEASE_0_83_0.txt ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 18:37:05
|
Revision: 3318 http://bigdata.svn.sourceforge.net/bigdata/?rev=3318&view=rev Author: thompsonbry Date: 2010-07-27 18:36:58 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Modified the Checkpoint record to use fixed length fields in the record in order to better support unversioned updates. Visited more of the tuple serializers to make sure that they are also versioned. Modified Paths: -------------- trunk/bigdata/src/java/com/bigdata/btree/Checkpoint.java trunk/bigdata/src/java/com/bigdata/btree/DefaultTupleSerializer.java trunk/bigdata/src/java/com/bigdata/btree/NOPTupleSerializer.java trunk/bigdata/src/java/com/bigdata/journal/CommitRecordIndex.java trunk/bigdata/src/java/com/bigdata/journal/Name2Addr.java trunk/bigdata/src/java/com/bigdata/mdi/MetadataIndex.java trunk/bigdata/src/java/com/bigdata/resources/JournalIndex.java trunk/bigdata/src/java/com/bigdata/service/CommitTimeIndex.java trunk/bigdata/src/java/com/bigdata/sparse/TPSTupleSerializer.java trunk/bigdata/src/test/com/bigdata/btree/TestBigdataMap.java trunk/bigdata/src/test/com/bigdata/journal/TestAll.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Id2TermTupleSerializer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/JustificationTupleSerializer.java Modified: trunk/bigdata/src/java/com/bigdata/btree/Checkpoint.java =================================================================== --- trunk/bigdata/src/java/com/bigdata/btree/Checkpoint.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata/src/java/com/bigdata/btree/Checkpoint.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -6,8 +6,6 @@ import java.io.ObjectOutput; import java.nio.ByteBuffer; -import org.CognitiveWeb.extser.LongPacker; - import com.bigdata.io.SerializerUtil; import com.bigdata.rawstore.IRawStore; @@ -316,19 +314,24 @@ this.counter = counter; } - + /** * Initial serialization version. + * <p> + * Note: The fields of the {@link Checkpoint} record use fixed length + * representations in order to support the possibility that we might do an + * in place update of a {@link Checkpoint} record as part of a data + * migration strategy. For the same reason, the {@link Checkpoint} record + * includes some unused fields. Those fields are available for future + * version changes without requiring us to change the length of the + * {@link Checkpoint} record. */ private static transient final int VERSION0 = 0x0; - + /** - * This serialization version adds the field recording the address of the - * optional bloom filter. That address defaults to zero (0L) for earlier - * versions, indicating that no bloom filter is stored for the - * {@link Checkpoint}. + * The current version. */ - private static transient final int VERSION1 = 0x1; + private static transient final int VERSION = VERSION0; /** * Write the {@link Checkpoint} record on the store, setting @@ -381,58 +384,57 @@ public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { - final int version = (int) LongPacker.unpackLong(in); + final int version = in.readInt(); - if (version != VERSION0 && version != VERSION1) + if (version != VERSION0) throw new IOException("Unknown version: " + version); this.addrMetadata = in.readLong(); this.addrRoot = in.readLong(); - if (version == VERSION1) { - - this.addrBloomFilter = in.readLong(); - - } else { - - this.addrBloomFilter = 0L; - - } + this.addrBloomFilter = in.readLong(); - this.height = (int) LongPacker.unpackLong(in); + this.height = in.readInt(); - this.nnodes = (int) LongPacker.unpackLong(in); + this.nnodes = in.readInt(); - this.nleaves = (int) LongPacker.unpackLong(in); + this.nleaves = in.readInt(); - this.nentries = (int) LongPacker.unpackLong(in); + this.nentries = in.readInt(); - this.counter = LongPacker.unpackLong(in); + this.counter = in.readLong(); + in.readLong(); // unused. + + in.readLong(); // unused. + } public void writeExternal(final ObjectOutput out) throws IOException { - LongPacker.packLong(out, VERSION1); + out.writeInt(VERSION); out.writeLong(addrMetadata); out.writeLong(addrRoot); - // Note: added in VERSION1. out.writeLong(addrBloomFilter); - LongPacker.packLong(out, height); + out.writeInt(height); - LongPacker.packLong(out, nnodes); + out.writeInt(nnodes); - LongPacker.packLong(out, nleaves); + out.writeInt(nleaves); - LongPacker.packLong(out, nentries); + out.writeInt(nentries); - LongPacker.packLong(out, counter); + out.writeLong(counter); + + out.writeLong(0L/*unused*/); + out.writeLong(0L/*unused*/); + } } Modified: trunk/bigdata/src/java/com/bigdata/btree/DefaultTupleSerializer.java =================================================================== --- trunk/bigdata/src/java/com/bigdata/btree/DefaultTupleSerializer.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata/src/java/com/bigdata/btree/DefaultTupleSerializer.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -314,17 +314,17 @@ * Note: Explicit versioning for the {@link DefaultTupleSerializer} was * introduced with inlining of datatype literals for the RDF database. */ - private final static transient int VERSION0 = 0; + private final static transient byte VERSION0 = 0; /** * The current version. */ - private final static transient int VERSION = VERSION0; + private final static transient byte VERSION = VERSION0; public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { - final short version = in.readShort(); + final byte version = in.readByte(); switch (version) { case VERSION0: delegateKeyBuilderFactory = (IKeyBuilderFactory) in.readObject(); @@ -342,7 +342,7 @@ public void writeExternal(final ObjectOutput out) throws IOException { - out.writeShort(VERSION); + out.writeByte(VERSION); out.writeObject(delegateKeyBuilderFactory); Modified: trunk/bigdata/src/java/com/bigdata/btree/NOPTupleSerializer.java =================================================================== --- trunk/bigdata/src/java/com/bigdata/btree/NOPTupleSerializer.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata/src/java/com/bigdata/btree/NOPTupleSerializer.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -132,16 +132,39 @@ } - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + /** + * The initial version (no additional persistent state). + */ + private final static transient byte VERSION0 = 0; + /** + * The current version. + */ + private final static transient byte VERSION = VERSION0; + + public void readExternal(final ObjectInput in) throws IOException, + ClassNotFoundException { + super.readExternal(in); + final byte version = in.readByte(); + + switch (version) { + case VERSION0: + break; + default: + throw new UnsupportedOperationException("Unknown version: " + + version); + } + } - public void writeExternal(ObjectOutput out) throws IOException { + public void writeExternal(final ObjectOutput out) throws IOException { super.writeExternal(out); + out.writeByte(VERSION); + } } Modified: trunk/bigdata/src/java/com/bigdata/journal/CommitRecordIndex.java =================================================================== --- trunk/bigdata/src/java/com/bigdata/journal/CommitRecordIndex.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata/src/java/com/bigdata/journal/CommitRecordIndex.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -24,6 +24,8 @@ package com.bigdata.journal; import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; import java.util.UUID; import com.bigdata.btree.BTree; @@ -579,7 +581,7 @@ /** * */ - private static final long serialVersionUID = -4410874047750277697L; + private static final long serialVersionUID = 1; /** * Used to (de-)serialize {@link Entry}s (NOT thread-safe). @@ -657,6 +659,41 @@ } - } + /** + * The initial version (no additional persistent state). + */ + private final static transient byte VERSION0 = 0; + /** + * The current version. + */ + private final static transient byte VERSION = VERSION0; + + public void readExternal(final ObjectInput in) throws IOException, + ClassNotFoundException { + + super.readExternal(in); + + final byte version = in.readByte(); + + switch (version) { + case VERSION0: + break; + default: + throw new UnsupportedOperationException("Unknown version: " + + version); + } + + } + + public void writeExternal(final ObjectOutput out) throws IOException { + + super.writeExternal(out); + + out.writeByte(VERSION); + + } + + } // CommitRecordIndexTupleSerializer + } Modified: trunk/bigdata/src/java/com/bigdata/journal/Name2Addr.java =================================================================== --- trunk/bigdata/src/java/com/bigdata/journal/Name2Addr.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata/src/java/com/bigdata/journal/Name2Addr.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -30,6 +30,8 @@ import java.io.DataOutput; import java.io.DataOutputStream; import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; import java.lang.ref.WeakReference; import java.util.Arrays; import java.util.Iterator; @@ -1269,6 +1271,41 @@ } - } + /** + * The initial version (no additional persistent state). + */ + private final static transient byte VERSION0 = 0; + /** + * The current version. + */ + private final static transient byte VERSION = VERSION0; + + public void readExternal(final ObjectInput in) throws IOException, + ClassNotFoundException { + + super.readExternal(in); + + final byte version = in.readByte(); + + switch (version) { + case VERSION0: + break; + default: + throw new UnsupportedOperationException("Unknown version: " + + version); + } + + } + + public void writeExternal(final ObjectOutput out) throws IOException { + + super.writeExternal(out); + + out.writeByte(VERSION); + + } + + } // Name2AddrTupleSerializer + } Modified: trunk/bigdata/src/java/com/bigdata/mdi/MetadataIndex.java =================================================================== --- trunk/bigdata/src/java/com/bigdata/mdi/MetadataIndex.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata/src/java/com/bigdata/mdi/MetadataIndex.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -466,8 +466,43 @@ } - } + /** + * The initial version (no additional persistent state). + */ + private final static transient byte VERSION0 = 0; + /** + * The current version. + */ + private final static transient byte VERSION = VERSION0; + + public void readExternal(final ObjectInput in) throws IOException, + ClassNotFoundException { + + super.readExternal(in); + + final byte version = in.readByte(); + + switch (version) { + case VERSION0: + break; + default: + throw new UnsupportedOperationException("Unknown version: " + + version); + } + + } + + public void writeExternal(final ObjectOutput out) throws IOException { + + super.writeExternal(out); + + out.writeByte(VERSION); + + } + + } // PartitionLocatorTupleSerializer + /** * Passes the notice along to the {@link #view}. It caches de-serialized * locators and needs to drop them from its cache if they become stale. Modified: trunk/bigdata/src/java/com/bigdata/resources/JournalIndex.java =================================================================== --- trunk/bigdata/src/java/com/bigdata/resources/JournalIndex.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata/src/java/com/bigdata/resources/JournalIndex.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -23,6 +23,9 @@ */ package com.bigdata.resources; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; import java.util.UUID; import com.bigdata.btree.BTree; @@ -330,6 +333,41 @@ } + /** + * The initial version (no additional persistent state). + */ + private final static transient byte VERSION0 = 0; + + /** + * The current version. + */ + private final static transient byte VERSION = VERSION0; + + public void readExternal(final ObjectInput in) throws IOException, + ClassNotFoundException { + + super.readExternal(in); + + final byte version = in.readByte(); + + switch (version) { + case VERSION0: + break; + default: + throw new UnsupportedOperationException("Unknown version: " + + version); + } + + } + + public void writeExternal(final ObjectOutput out) throws IOException { + + super.writeExternal(out); + + out.writeByte(VERSION); + + } + } } Modified: trunk/bigdata/src/java/com/bigdata/service/CommitTimeIndex.java =================================================================== --- trunk/bigdata/src/java/com/bigdata/service/CommitTimeIndex.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata/src/java/com/bigdata/service/CommitTimeIndex.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -1,5 +1,8 @@ package com.bigdata.service; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; import java.util.UUID; import com.bigdata.btree.BTree; @@ -290,6 +293,41 @@ } + /** + * The initial version (no additional persistent state). + */ + private final static transient byte VERSION0 = 0; + + /** + * The current version. + */ + private final static transient byte VERSION = VERSION0; + + public void readExternal(final ObjectInput in) throws IOException, + ClassNotFoundException { + + super.readExternal(in); + + final byte version = in.readByte(); + + switch (version) { + case VERSION0: + break; + default: + throw new UnsupportedOperationException("Unknown version: " + + version); + } + + } + + public void writeExternal(final ObjectOutput out) throws IOException { + + super.writeExternal(out); + + out.writeByte(VERSION); + + } + } } Modified: trunk/bigdata/src/java/com/bigdata/sparse/TPSTupleSerializer.java =================================================================== --- trunk/bigdata/src/java/com/bigdata/sparse/TPSTupleSerializer.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata/src/java/com/bigdata/sparse/TPSTupleSerializer.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -1,5 +1,9 @@ package com.bigdata.sparse; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; + import com.bigdata.btree.BTree; import com.bigdata.btree.DefaultTupleSerializer; import com.bigdata.btree.ITuple; @@ -77,4 +81,39 @@ } + /** + * The initial version (no additional persistent state). + */ + private final static transient byte VERSION0 = 0; + + /** + * The current version. + */ + private final static transient byte VERSION = VERSION0; + + public void readExternal(final ObjectInput in) throws IOException, + ClassNotFoundException { + + super.readExternal(in); + + final byte version = in.readByte(); + + switch (version) { + case VERSION0: + break; + default: + throw new UnsupportedOperationException("Unknown version: " + + version); + } + + } + + public void writeExternal(final ObjectOutput out) throws IOException { + + super.writeExternal(out); + + out.writeByte(VERSION); + + } + } Modified: trunk/bigdata/src/test/com/bigdata/btree/TestBigdataMap.java =================================================================== --- trunk/bigdata/src/test/com/bigdata/btree/TestBigdataMap.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata/src/test/com/bigdata/btree/TestBigdataMap.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -28,6 +28,9 @@ package com.bigdata.btree; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; import java.util.NoSuchElementException; import java.util.Properties; import java.util.UUID; @@ -208,6 +211,41 @@ } - } + /** + * The initial version (no additional persistent state). + */ + private final static transient byte VERSION0 = 0; + /** + * The current version. + */ + private final static transient byte VERSION = VERSION0; + + public void readExternal(final ObjectInput in) throws IOException, + ClassNotFoundException { + + super.readExternal(in); + + final byte version = in.readByte(); + + switch (version) { + case VERSION0: + break; + default: + throw new UnsupportedOperationException("Unknown version: " + + version); + } + + } + + public void writeExternal(final ObjectOutput out) throws IOException { + + super.writeExternal(out); + + out.writeByte(VERSION); + + } + + } // StringSerializer + } Modified: trunk/bigdata/src/test/com/bigdata/journal/TestAll.java =================================================================== --- trunk/bigdata/src/test/com/bigdata/journal/TestAll.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata/src/test/com/bigdata/journal/TestAll.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -108,7 +108,7 @@ // } - suite.addTest( TestDiskJournal.suite() ); +// suite.addTest( TestDiskJournal.suite() ); suite.addTest( TestWORMStrategy.suite() ); Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Id2TermTupleSerializer.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Id2TermTupleSerializer.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Id2TermTupleSerializer.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -211,13 +211,13 @@ * namespace:UTF * </pre> */ - static final transient short VERSION0 = 0; + private static final transient byte VERSION0 = 0; - private static final transient short VERSION = VERSION0; + private static final transient byte VERSION = VERSION0; public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); - final short version = in.readShort(); + final byte version = in.readByte(); final String namespace; final String valueFactoryClass; switch (version) { @@ -254,17 +254,9 @@ public void writeExternal(final ObjectOutput out) throws IOException { super.writeExternal(out); - final short version = VERSION; - final String valueFactoryClass = valueFactory.getClass().getName(); - out.writeShort(version); - switch (version) { - case VERSION0: - out.writeUTF(namespace); - out.writeUTF(valueFactoryClass); - break; - default: - throw new AssertionError(); - } + out.writeByte(VERSION); + out.writeUTF(namespace); + out.writeUTF(valueFactory.getClass().getName()); } } Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/JustificationTupleSerializer.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/JustificationTupleSerializer.java 2010-07-27 18:17:27 UTC (rev 3317) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/JustificationTupleSerializer.java 2010-07-27 18:36:58 UTC (rev 3318) @@ -154,11 +154,31 @@ } + /** + * The initial version. + */ + private final static transient byte VERSION0 = 0; + + /** + * The current version. + */ + private final static transient byte VERSION = VERSION0; + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); + final byte version = in.readByte(); + + switch (version) { + case VERSION0: + break; + default: + throw new UnsupportedOperationException("Unknown version: " + + version); + } + N = in.readByte(); } @@ -167,6 +187,8 @@ super.writeExternal(out); + out.writeByte(VERSION); + out.writeByte(N); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2010-07-27 18:17:33
|
Revision: 3317 http://bigdata.svn.sourceforge.net/bigdata/?rev=3317&view=rev Author: martyncutcher Date: 2010-07-27 18:17:27 +0000 (Tue, 27 Jul 2010) Log Message: ----------- correctRejection test amended since RootBlockView permits lastCommitTime < firstCommitTime for historical access Modified Paths: -------------- trunk/bigdata/src/test/com/bigdata/journal/TestRootBlockView.java Modified: trunk/bigdata/src/test/com/bigdata/journal/TestRootBlockView.java =================================================================== --- trunk/bigdata/src/test/com/bigdata/journal/TestRootBlockView.java 2010-07-27 17:46:24 UTC (rev 3316) +++ trunk/bigdata/src/test/com/bigdata/journal/TestRootBlockView.java 2010-07-27 18:17:27 UTC (rev 3317) @@ -390,9 +390,8 @@ firstCommitTimeBad1, lastCommitTimeBad1, commitCounterOk, rootsAddrOk, commitRecordIndexOk, uuidOk, createTimeOk, closeTimeOk, checkerOk); - fail("Expecting: " + IllegalArgumentException.class); } catch (IllegalArgumentException ex) { - System.err.println("Ignoring expected exception: " + ex); + fail("Unexpected exception", ex); } try { new RootBlockView(rootBlock0, offsetBitsOk, nextOffsetOk, @@ -408,18 +407,16 @@ firstCommitTimeBad3, lastCommitTimeBad3, commitCounterOk, rootsAddrOk, commitRecordIndexOk, uuidOk, createTimeOk, closeTimeOk, checkerOk); - fail("Expecting: " + IllegalArgumentException.class); } catch (IllegalArgumentException ex) { - System.err.println("Ignoring expected exception: " + ex); + fail("Unexpected exception", ex); } try { new RootBlockView(rootBlock0, offsetBitsOk, nextOffsetOk, firstCommitTimeBad4, lastCommitTimeBad4, commitCounterOk, rootsAddrOk, commitRecordIndexOk, uuidOk, createTimeOk, closeTimeOk, checkerOk); - fail("Expecting: " + IllegalArgumentException.class); } catch (IllegalArgumentException ex) { - System.err.println("Ignoring expected exception: " + ex); + fail("Unexpected exception", ex); } // bad commit counter This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 17:46:30
|
Revision: 3316 http://bigdata.svn.sourceforge.net/bigdata/?rev=3316&view=rev Author: thompsonbry Date: 2010-07-27 17:46:24 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Also modified to use conditional assertion based on whether the LRUNexus is enabled Modified Paths: -------------- trunk/bigdata/src/test/com/bigdata/btree/AbstractIndexSegmentTestCase.java Modified: trunk/bigdata/src/test/com/bigdata/btree/AbstractIndexSegmentTestCase.java =================================================================== --- trunk/bigdata/src/test/com/bigdata/btree/AbstractIndexSegmentTestCase.java 2010-07-27 17:44:02 UTC (rev 3315) +++ trunk/bigdata/src/test/com/bigdata/btree/AbstractIndexSegmentTestCase.java 2010-07-27 17:46:24 UTC (rev 3316) @@ -32,6 +32,7 @@ import org.apache.log4j.Level; +import com.bigdata.LRUNexus; import com.bigdata.btree.IndexSegment.ImmutableLeafCursor; import com.bigdata.btree.IndexSegment.ImmutableNodeFactory.ImmutableLeaf; import com.bigdata.io.DirectBufferPool; @@ -191,6 +192,7 @@ final ImmutableLeafCursor itr = seg.newLeafCursor(SeekEnum.First); + if(LRUNexus.INSTANCE!=null) assertTrue(firstLeaf.getDelegate()==itr.leaf().getDelegate()); // Note: test depends on cache! ImmutableLeaf priorLeaf = itr.leaf(); @@ -243,6 +245,7 @@ final ImmutableLeafCursor itr = seg.newLeafCursor(SeekEnum.Last); + if(LRUNexus.INSTANCE!=null) assertTrue(lastLeaf.getDelegate() == itr.leaf().getDelegate()); // Note: test depends on cache! ImmutableLeaf nextLeaf = itr.leaf(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 17:44:09
|
Revision: 3315 http://bigdata.svn.sourceforge.net/bigdata/?rev=3315&view=rev Author: thompsonbry Date: 2010-07-27 17:44:02 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Fixed test errors related to the LRUNexus, which is now disabled by default. The specific asserts are now conditional on whether or not the LRUNexus is enabled. Modified Paths: -------------- trunk/bigdata/src/test/com/bigdata/btree/TestIndexSegmentBuilderWithSmallTree.java Modified: trunk/bigdata/src/test/com/bigdata/btree/TestIndexSegmentBuilderWithSmallTree.java =================================================================== --- trunk/bigdata/src/test/com/bigdata/btree/TestIndexSegmentBuilderWithSmallTree.java 2010-07-27 17:10:09 UTC (rev 3314) +++ trunk/bigdata/src/test/com/bigdata/btree/TestIndexSegmentBuilderWithSmallTree.java 2010-07-27 17:44:02 UTC (rev 3315) @@ -268,10 +268,14 @@ final ImmutableLeafCursor itr = seg.newLeafCursor(SeekEnum.First); + if(LRUNexus.INSTANCE!=null) assertTrue(firstLeaf.getDelegate() == itr.leaf().getDelegate()); // Note: test depends on cache! assertNull(itr.prior()); + if(LRUNexus.INSTANCE!=null) assertTrue(lastLeaf.getDelegate() == itr.next().getDelegate()); // Note: test depends on cache! + + if(LRUNexus.INSTANCE!=null) assertTrue(lastLeaf.getDelegate() == itr.leaf().getDelegate()); // Note: test depends on cache! } @@ -286,10 +290,13 @@ final ImmutableLeafCursor itr = seg.newLeafCursor(SeekEnum.Last); + if(LRUNexus.INSTANCE!=null) assertTrue(lastLeaf.getDelegate() == itr.leaf().getDelegate()); // Note: test depends on cache! assertNull(itr.next()); + if(LRUNexus.INSTANCE!=null) assertTrue(firstLeaf.getDelegate() == itr.prior().getDelegate()); // Note: test depends on cache! + if(LRUNexus.INSTANCE!=null) assertTrue(firstLeaf.getDelegate() == itr.leaf().getDelegate()); // Note: test depends on cache! } @@ -373,6 +380,7 @@ assertEquals("nextAddr", 0L, leaf.getNextAddr()); final ImmutableLeafCursor itr = seg.newLeafCursor(SeekEnum.First); + if(LRUNexus.INSTANCE!=null) assertTrue(leaf.getDelegate() == itr.leaf().getDelegate()); // Note: test depends on cache. assertNull(itr.prior()); assertNull(itr.next()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 17:10:16
|
Revision: 3314 http://bigdata.svn.sourceforge.net/bigdata/?rev=3314&view=rev Author: thompsonbry Date: 2010-07-27 17:10:09 +0000 (Tue, 27 Jul 2010) Log Message: ----------- corrected the relative path to the bigdata build directory Modified Paths: -------------- trunk/bigdata-perf/bigdata-bsbm/build.properties Modified: trunk/bigdata-perf/bigdata-bsbm/build.properties =================================================================== --- trunk/bigdata-perf/bigdata-bsbm/build.properties 2010-07-27 17:09:17 UTC (rev 3313) +++ trunk/bigdata-perf/bigdata-bsbm/build.properties 2010-07-27 17:10:09 UTC (rev 3314) @@ -3,7 +3,7 @@ # the base directory bsbm.dir=. # the bigdata base directory -bigdata.dir=.. +bigdata.dir=../.. # Where the generated files will be written. build.dir=ant-build This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 17:09:23
|
Revision: 3313 http://bigdata.svn.sourceforge.net/bigdata/?rev=3313&view=rev Author: thompsonbry Date: 2010-07-27 17:09:17 +0000 (Tue, 27 Jul 2010) Log Message: ----------- updated worksheet. Modified Paths: -------------- trunk/bigdata/src/architecture/mergePriority.xls Modified: trunk/bigdata/src/architecture/mergePriority.xls =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 17:04:14
|
Revision: 3312 http://bigdata.svn.sourceforge.net/bigdata/?rev=3312&view=rev Author: thompsonbry Date: 2010-07-27 17:04:08 +0000 (Tue, 27 Jul 2010) Log Message: ----------- moved bigdata-bsbm into bigdata-perf. Added Paths: ----------- trunk/bigdata-perf/bigdata-bsbm/ Removed Paths: ------------- trunk/bigdata-bsbm/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 17:00:46
|
Revision: 3311 http://bigdata.svn.sourceforge.net/bigdata/?rev=3311&view=rev Author: thompsonbry Date: 2010-07-27 17:00:40 +0000 (Tue, 27 Jul 2010) Log Message: ----------- removed old (empty) bsbm directory Removed Paths: ------------- trunk/bigdata-perf/bsbm/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 17:00:18
|
Revision: 3310 http://bigdata.svn.sourceforge.net/bigdata/?rev=3310&view=rev Author: thompsonbry Date: 2010-07-27 17:00:12 +0000 (Tue, 27 Jul 2010) Log Message: ----------- removed old (empty) lubm directory. changed relative path to bigdata build dir. Modified Paths: -------------- trunk/bigdata-perf/bigdata-lubm/build.properties Removed Paths: ------------- trunk/bigdata-perf/lubm/ Modified: trunk/bigdata-perf/bigdata-lubm/build.properties =================================================================== --- trunk/bigdata-perf/bigdata-lubm/build.properties 2010-07-27 16:42:33 UTC (rev 3309) +++ trunk/bigdata-perf/bigdata-lubm/build.properties 2010-07-27 17:00:12 UTC (rev 3310) @@ -3,7 +3,7 @@ # the base directory lubm.dir=. # the bigdata base directory -bigdata.dir=.. +bigdata.dir=../.. # Where the generated files will be written. build.dir=ant-build This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 16:42:39
|
Revision: 3309 http://bigdata.svn.sourceforge.net/bigdata/?rev=3309&view=rev Author: thompsonbry Date: 2010-07-27 16:42:33 +0000 (Tue, 27 Jul 2010) Log Message: ----------- moved lubm into bigdata-perf. Added Paths: ----------- trunk/bigdata-perf/bigdata-lubm/ trunk/bigdata-perf/bsbm/ trunk/bigdata-perf/lubm/ Removed Paths: ------------- trunk/bigdata-lubm/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 16:39:32
|
Revision: 3308 http://bigdata.svn.sourceforge.net/bigdata/?rev=3308&view=rev Author: thompsonbry Date: 2010-07-27 16:39:25 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Modified the eclipse classpath to not include the bsbm/lubm benchmarks. They are only run from ant scripts. Modified Paths: -------------- trunk/.classpath Modified: trunk/.classpath =================================================================== --- trunk/.classpath 2010-07-27 16:06:03 UTC (rev 3307) +++ trunk/.classpath 2010-07-27 16:39:25 UTC (rev 3308) @@ -1,69 +1,64 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry path="bigdata-rdf/src/java" kind="src"/> - <classpathentry path="bigdata-rdf/src/samples" kind="src"/> - <classpathentry path="bigdata-bsbm/src/test" kind="src"/> - <classpathentry path="dsi-utils/src/java" kind="src"/> - <classpathentry path="bigdata-bsbm/src/java" kind="src"/> - <classpathentry path="bigdata/src/resources/logging" kind="src"/> - <classpathentry path="bigdata-sails/src/samples" kind="src"/> - <classpathentry path="bigdata-jini/src/test" kind="src"/> - <classpathentry path="bigdata-sails/src/java" kind="src"/> - <classpathentry path="bigdata/src/java" kind="src"/> - <classpathentry path="bigdata-rdf/src/test" kind="src"/> - <classpathentry path="bigdata/src/test" kind="src"/> - <classpathentry path="bigdata-sails/src/test" kind="src"/> - <classpathentry path="bigdata-jini/src/java" kind="src"/> - <classpathentry path="bigdata-lubm/src/java" kind="src"/> - <classpathentry path="contrib/src/problems" kind="src"/> - <classpathentry path="bigdata/src/samples" kind="src"/> - <classpathentry path="dsi-utils/src/test" kind="src"/> - <classpathentry path="bigdata-jini/lib/apache/zookeeper-3.2.1.jar" kind="lib"/> - <classpathentry path="bigdata-sails/lib/commons-httpclient.jar" kind="lib"/> - <classpathentry path="bigdata-sails/lib/servlet-api.jar" kind="lib"/> - <classpathentry path="bigdata/lib/dsi-utils-1.0.6-020610.jar" kind="lib"/> - <classpathentry path="bigdata/lib/lgpl-utils-1.0.6-020610.jar" kind="lib"/> - <classpathentry path="bigdata-rdf/lib/nxparser-6-22-2010.jar" kind="lib"/> - <classpathentry path="lgpl-utils/src/java" kind="src"/> - <classpathentry path="lgpl-utils/src/test" kind="src"/> - <classpathentry path="bigdata/lib/icu/icu4j-3_6.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata/lib/unimi/colt-1.2.0.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata/lib/ctc_utils-5-4-2005.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata/lib/cweb-commons-1.1-b2-dev.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata/lib/cweb-extser-0.1-b2-dev.jar" exported="true" kind="lib"/> - <classpathentry sourcepath="/junit-ext/src" path="bigdata/lib/cweb-junit-ext-1.1-b3-dev.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata/lib/junit-3.8.1.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata/lib/apache/log4j-1.2.15.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata/lib/icu/icu4jni.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-rdf/lib/slf4j-api-1.4.3.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-rdf/lib/slf4j-log4j12-1.4.3.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-rdf/lib/iris-0.58.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-rdf/lib/jgrapht-jdk1.5-0.7.1.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/browser.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/classserver.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/fiddler.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/jini-core.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/jini-ext.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/jsk-lib.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/jsk-platform.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/jsk-resources.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/mahalo.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/mercury.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/norm.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/outrigger.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/reggie.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/start.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/sun-util.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-jini/lib/jini/lib/tools.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata/lib/unimi/fastutil-5.1.5.jar" exported="true" kind="lib"/> - <classpathentry path="bigdata-bsbm/lib/jdom.jar" kind="lib"/> - <classpathentry path="bigdata-bsbm/lib/ssj.jar" kind="lib"/> - <classpathentry path="bigdata/lib/lucene/lucene-analyzers-3.0.0.jar" kind="lib"/> - <classpathentry path="bigdata/lib/lucene/lucene-core-3.0.0.jar" kind="lib"/> - <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"/> - <classpathentry path="bigdata-rdf/lib/openrdf-sesame-2.3.0-onejar.jar" kind="lib"/> - <classpathentry path="bigdata-sails/lib/sesame-sparql-testsuite-2.3.0.jar" kind="lib"/> - <classpathentry path="bigdata-sails/lib/sesame-store-testsuite-2.3.0.jar" kind="lib"/> - <classpathentry path="bigdata/lib/high-scale-lib-v1.1.2.jar" kind="lib"/> - <classpathentry path="bin" kind="output"/> + <classpathentry kind="src" path="bigdata-rdf/src/java"/> + <classpathentry kind="src" path="bigdata-rdf/src/samples"/> + <classpathentry kind="src" path="dsi-utils/src/java"/> + <classpathentry kind="src" path="bigdata/src/resources/logging"/> + <classpathentry kind="src" path="bigdata-sails/src/samples"/> + <classpathentry kind="src" path="bigdata-jini/src/test"/> + <classpathentry kind="src" path="bigdata-sails/src/java"/> + <classpathentry kind="src" path="bigdata/src/java"/> + <classpathentry kind="src" path="bigdata-rdf/src/test"/> + <classpathentry kind="src" path="bigdata/src/test"/> + <classpathentry kind="src" path="bigdata-sails/src/test"/> + <classpathentry kind="src" path="bigdata-jini/src/java"/> + <classpathentry kind="src" path="contrib/src/problems"/> + <classpathentry kind="src" path="bigdata/src/samples"/> + <classpathentry kind="src" path="dsi-utils/src/test"/> + <classpathentry kind="lib" path="bigdata-jini/lib/apache/zookeeper-3.2.1.jar"/> + <classpathentry kind="lib" path="bigdata-sails/lib/commons-httpclient.jar"/> + <classpathentry kind="lib" path="bigdata-sails/lib/servlet-api.jar"/> + <classpathentry kind="lib" path="bigdata/lib/dsi-utils-1.0.6-020610.jar"/> + <classpathentry kind="lib" path="bigdata/lib/lgpl-utils-1.0.6-020610.jar"/> + <classpathentry kind="lib" path="bigdata-rdf/lib/nxparser-6-22-2010.jar"/> + <classpathentry kind="src" path="lgpl-utils/src/java"/> + <classpathentry kind="src" path="lgpl-utils/src/test"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4j-3_6.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/colt-1.2.0.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/ctc_utils-5-4-2005.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/cweb-commons-1.1-b2-dev.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/cweb-extser-0.1-b2-dev.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/cweb-junit-ext-1.1-b3-dev.jar" sourcepath="/junit-ext/src"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/junit-3.8.1.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/apache/log4j-1.2.15.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4jni.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/slf4j-api-1.4.3.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/slf4j-log4j12-1.4.3.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/iris-0.58.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/jgrapht-jdk1.5-0.7.1.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/browser.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/classserver.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/fiddler.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jini-core.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jini-ext.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-lib.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-platform.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-resources.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/mahalo.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/mercury.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/norm.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/outrigger.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/reggie.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/start.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/sun-util.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/tools.jar"/> + <classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/fastutil-5.1.5.jar"/> + <classpathentry kind="lib" path="bigdata/lib/lucene/lucene-analyzers-3.0.0.jar"/> + <classpathentry kind="lib" path="bigdata/lib/lucene/lucene-core-3.0.0.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="bigdata-rdf/lib/openrdf-sesame-2.3.0-onejar.jar"/> + <classpathentry kind="lib" path="bigdata-sails/lib/sesame-sparql-testsuite-2.3.0.jar"/> + <classpathentry kind="lib" path="bigdata-sails/lib/sesame-store-testsuite-2.3.0.jar"/> + <classpathentry kind="lib" path="bigdata/lib/high-scale-lib-v1.1.2.jar"/> + <classpathentry kind="output" path="bin"/> </classpath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 16:06:10
|
Revision: 3307 http://bigdata.svn.sourceforge.net/bigdata/?rev=3307&view=rev Author: thompsonbry Date: 2010-07-27 16:06:03 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Cleaned up lots of FIXME's. Fixed problem with NaNs in xsd:float and xsd:double handling. Modified Paths: -------------- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractLiteralIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DTE.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/ILexiconConfiguration.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IVUtility.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LexiconConfiguration.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/TermId.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSD.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDDoubleIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDFloatIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/ITermIndexCodes.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Id2TermWriteProc.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconKeyBuilder.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Term2IdTupleSerializer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/magic/IRISUtils.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/relation/rule/BindingSetSortKeyBuilder.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rio/NQuadsParser.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/JustificationTupleSerializer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOComparator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOKeyOrder.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPORelation.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOTupleSerializer.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/TestEncodeDecodeKeys.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPORelation.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestAll.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestLocalTripleStoreWithoutInlining.java Added Paths: ----------- trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/BlobOverflowHandler.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/LegacyTermIdUtility.java Removed Paths: ------------- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/BlobOverflowHandler.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LegacyTermIdUtility.java Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractIV.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractIV.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractIV.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -171,31 +171,10 @@ * Datatypes namespaces </a>). I propose that we collapse these by default * onto a canonical datatype URI. * - * @todo For a extensible data type which is being projected onto an intrinsic - * data type we would need both (a) a method to project the RDF Value onto - * the appropriate intrinsic data type; and (b) a method to materialize an - * RDF Value from the inline representation. - * <p> - * If we put the registrations into their own index, then we could use a - * more compact representation (the term identifier of the datatype URI is - * 8 bytes, but we could do with 2 or 4 bytes). Alternatively, we could - * use the LongPacker to pack an unsigned long integer into as few bytes - * as possible. This would break the natural ordering across the - * dataTypeIds, but I can not see how that would matter since the term - * identifiers are essentially arbitrary anyway so their order has little - * value. - * * @todo Can we inline the language code for a literal? I think that the * language code must be ASCII and might be restricted to two characters. * This might use up our {@link DTE#Reserved1} bit. * - * @todo One consequences of this refactor is that you must use equals() rather - * than == to compare internal values, including term identifiers. This - * boils down to verifying that the two internal values are the same type - * (same VTE, DTE, etc) and have the same value (termId, long, etc). That - * can all be done rather quickly, but it is more overhead than testing a - * == b. - * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id: TestEncodeDecodeKeys.java 2753 2010-05-01 16:36:59Z thompsonbry * $ @@ -346,28 +325,12 @@ } -// /** -// * FIXME I think we really need to be able to say from the flags whether -// * an IV is null or non-null. The context position of statements can -// * often be null. -// * -// * @param flags -// * The flags byte. -// */ -// static public boolean isNull(final byte flags) { -// -// return false; -// -// } - /** * Return <code>true</code> if the flags byte has its <code>extension</code> * bit set. * * @param flags * The flags byte. - * - * @todo unit test for this. */ static public boolean isExtension(final byte flags) { Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractLiteralIV.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractLiteralIV.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractLiteralIV.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -34,16 +34,6 @@ * <p> * {@inheritDoc} * - * @todo What are the SPARQL semantics for casting among these datatypes? - * They should probably be reflected here since that is the real use - * case. I believe that those casts also require failing a solution if - * the cast is not legal, in which case these methods might not be all - * that useful. - * <p> - * Also see BigdataLiteralImpl and XMLDatatypeUtil. It handles the - * conversions by reparsing, but there is no reason to do that here - * since we have the canonical point in the value space. - * * @see http://www.w3.org/TR/rdf-sparql-query/#FunctionMapping, The casting * rules for SPARQL * Deleted: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/BlobOverflowHandler.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/BlobOverflowHandler.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/BlobOverflowHandler.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -1,196 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -package com.bigdata.rdf.internal; - -import java.io.IOException; -import java.io.InputStream; - -import org.apache.log4j.Logger; - -import com.bigdata.btree.IOverflowHandler; -import com.bigdata.btree.ITuple; -import com.bigdata.btree.keys.KeyBuilder; -import com.bigdata.io.DataOutputBuffer; -import com.bigdata.io.IByteArrayBuffer; -import com.bigdata.rawstore.IBlock; -import com.bigdata.rawstore.IRawStore; - -/** - * Copies blocks onto the target store during overflow handling. Blocks that are - * no longer referenced by the file data index will be left behind on the - * journal and eventually discarded with the journal. The blob reference is a - * single <code>long</code> integer stored in the value of the tuple and gives - * the address of the raw record from which the blob may be read on - * {@link IRawStore} from which the tuple was read. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - * @version $Id: BlobOverflowHandler.java 2265 2009-10-26 12:51:06Z thompsonbry - * $ - * - * FIXME {@link IBlock} reads are not finished so this will not work - * yet. It seems that {@link IBlock} is might stand a refactor so that - * you get an {@link IByteArrayBuffer} instead of an {@link IBlock}. - * The remote iterator methods and remote tuple lookup methods (which - * have not yet been defined) would then use a smart proxy to handle - * the materialization of the raw record in the caller's JVM. There is - * no reason to add a streaming interface here since raw records and - * {@link IOverflowHandler}s are not useful once you get more than a - * few MB worth of data in the record. At that point you really need to - * use a REST-ful repository service which stores the data as chunks in - * the file system (ala BFS, but not trying to store the chunks in the - * journal or index segment since they are capped at ~200MB each and - * the file system chunk size might be closer to 64MB). - * - * FIXME Move this class to the btree package and integrate into its - * test suite. - * - * FIXME The class of the same name in the BFS package will need to be - * modified. Per above, BFS will need to store its chunks in the local - * file system. Therefore the blob reference will have to include the - * local file name (UUID_chunkNumber_version?) and the chunk will have - * to be replicated on each node having a given shard of chunks. For - * BFS, we clearly DO NOT want to move shards around if we can help it - * since we will have to move a huge amount of data around as well. - * <p> - * An alternative is to use a parallel file system to store the chunks, - * in which case we do not have to worry about replicating the chunks - * and we can move the shards easily enough since the chunks are - * elsewhere. - */ -public class BlobOverflowHandler implements IOverflowHandler { - - /** - * - */ - private static final long serialVersionUID = 6203072965860516919L; - - protected static final transient Logger log = Logger.getLogger(BlobOverflowHandler.class); - - /** - * Sole constructor. - */ - public BlobOverflowHandler() { - - } - - /** - * Lazily initialized by {@link #handle(ITuple, IRawStore)}. - */ - private transient DataOutputBuffer buf = null; - - public void close() { - - // release reference to the buffer. - buf = null; - - } - - public byte[] handle(final ITuple tuple, final IRawStore target) { - - if (buf == null) { - - buf = new DataOutputBuffer(); - - } - - /* - * Decode the blob reference. - * - * Note: The blob reference is just the [addr] of the record on the - * journal or index segment from which that blob reference was read. - */ - final long addr; - try { - addr = tuple.getValueStream().readLong(); - } catch (IOException e) { - throw new RuntimeException(e); - } - - if (addr == 0L) { - /* - * Note: empty blocks are allowed and are recorded with 0L as - * their address. - */ - return KeyBuilder.asSortKey(0L); - } - - // read block from underlying source store. - final IBlock block = tuple.readBlock(addr); - - // #of bytes in the block. - final int len = block.length(); - - // make sure buffer has sufficient capacity. - buf.ensureCapacity(len); - - // prepare buffer for write. - buf.reset(); - - // the address on which the block will be written. - final long addr2; - - // read on the source record. - final InputStream bin = block.inputStream(); - try { - - // read source into buffer (will be large enough). - final int nread = bin.read(buf.array(), 0, len); - - if (nread != len) { - - throw new RuntimeException("Premature end of block: expected=" - + len + ", actual=" + nread); - - } - - // write on the target store. - addr2 = target.write(buf.asByteBuffer()); - - } catch (IOException ex) { - - throw new RuntimeException("Problem copying block: addr=" + addr - + ", len=" + len, ex); - - } finally { - - try { - bin.close(); - } catch (IOException ex) { - log.warn(ex); - } - - } - - /* - * Format the address of the block on the target store (a long integer) - * into a byte[] and return that byte[]. This will be the value paired - * with the tuple in the target resource. - */ - buf.reset(); - buf.putLong(addr2); - return buf.toByteArray(); - - } - -} Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DTE.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DTE.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DTE.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -30,7 +30,9 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.UUID; + import org.openrdf.model.URI; + import com.bigdata.rawstore.Bytes; /** @@ -76,16 +78,6 @@ */ public enum DTE { -// /** -// * The "inline" value is a term identifier which must be resolved against -// * the ID2TERM index in the lexicon in order to materialize the -// * corresponding RDF Value. -// * -// * @todo URI for internal term identifiers? (probably not). -// */ -// TermId((byte) 0, Bytes.SIZEOF_LONG, Long.class, null/* N/A */, -// DTEFlags.NOFLAGS), // - /** * The "inline" value is a boolean (xsd:boolean). Only the distinct points * in the xsd:boolean value space are represented. xsd:boolean has multiple @@ -183,8 +175,6 @@ * The "inline" value is a {@link UUID}. * * @see http://lists.xml.org/archives/xml-dev/201003/msg00027.html - * - * @todo What is the datatype URI for UUID data types? (bd:UUID) */ UUID((byte) 13, Bytes.SIZEOF_UUID, UUID.class, XSD.UUID.stringValue(), DTEFlags.NOFLAGS), // @@ -235,8 +225,6 @@ * Note: This masks off everything but the lower 4 bits. */ switch (b & 0x0f) { -// case 0: -// return TermId; case 0: return XSDBoolean; case 1: @@ -328,15 +316,6 @@ /** * The class of the Java object used to represent instances of the coded * data type. - * - * @todo cls extends {@link AbstractIV}? Use {@link TermId} for a - * term identifier? If blank nodes are inlined, then use a special - * class for that, otherwise use {@link TermId}? Ditto for SIDs. URIs - * are never inlined. Datatype literals MAY be inline, depending on - * the datatype. The unsigned datatypes need to have special handling - * to avoid problems with math on unsigned values. That special - * handling could be provided by appropriate subclasses of - * {@link AbstractLiteralIV}. */ private final Class<?> cls; Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/ILexiconConfiguration.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/ILexiconConfiguration.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/ILexiconConfiguration.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -24,8 +24,8 @@ package com.bigdata.rdf.internal; -import org.openrdf.model.URI; import org.openrdf.model.Value; + import com.bigdata.rdf.model.BigdataValue; import com.bigdata.rdf.model.BigdataValueFactory; @@ -97,9 +97,6 @@ // // /** // * <code>true</code> iff <code>xsd:decimal</code> should be inlined. -// * -// * @todo This option is not yet supported. Combine with XSDInteger for -// * isBigNumericInline()? // */ // public boolean isXSDDecimalInline(); // @@ -111,8 +108,6 @@ // * <p> // * This option is NOT compatible with // * {@link AbstractTripleStore.Options#STORE_BLANK_NODES}. -// * -// * @todo Separate option to inlined SIDs? // */ // public boolean isBlankNodeInline(); // @@ -123,7 +118,7 @@ // public boolean isUUIDInline(); // // /** -// * @todo Option to enable storing of long literals (over a configured +// * Option to enable storing of long literals (over a configured // * threshold) as blob references. The TERM2ID index would have a // * hash function (MD5, SHA-1, SHA-2, etc) of the value and assign // * a termId. The ID2TERM index would map the termId to a blob Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IV.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IV.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IV.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -28,11 +28,11 @@ package com.bigdata.rdf.internal; import java.io.Serializable; + import org.openrdf.model.URI; import org.openrdf.model.Value; -import com.bigdata.btree.BytesUtil; + import com.bigdata.btree.keys.IKeyBuilder; -import com.bigdata.btree.keys.SuccessorUtil; import com.bigdata.rdf.model.BigdataValue; import com.bigdata.rdf.model.BigdataValueFactory; import com.bigdata.rdf.store.AbstractTripleStore.Options; @@ -45,12 +45,6 @@ * The generic type for the RDF {@link Value} implementation. * @param <T> * The generic type for the inline value. - * - * @todo Consider whether we need the ability to compute the successor of a - * value in the value space here. There are implementations of successor() - * for most data types in {@link SuccessorUtil}, including fixed length - * unsigned byte[]s, and also {@link BytesUtil#successor(byte[])}, which - * handles variable length unsigned byte[]s. */ public interface IV<V extends BigdataValue, T> extends Serializable, Comparable<IV> { @@ -201,7 +195,6 @@ * <code>true</code> for xsd:float, xsd:double, and xsd:decimal */ boolean isFloatingPointNumeric(); - /** * Inflate an inline RDF value to a {@link BigdataValue}. This method DOES @@ -213,27 +206,11 @@ * The value factory. * @param config * The lexicon configuration. + * * @return The corresponding {@link BigdataValue}. + * * @throws UnsupportedOperationException * unless the RDF value is inline. - * - * FIXME Reconcile with BigdataValueImpl and BigdataValue. The - * role of the valueFactory reference on BigdataValueImpl was to - * detect when an instance was created by another value factory. - * The choice of whether or not to inline the value is - * determined by the lexicon configuration, and that choice is - * probably captured by a BigdataValueFactory configuration - * object. Therefore we do need to convert to a different - * instance when the {@link IV} will be used in a - * different lexicon configuration context. - * <P> - * It would be nice to support shared lexicons for a collection - * of triple / quad stores. The lexicon would be in the - * container namespace for that federation of KBs. The - * individual triple/quad stores would be in the per-KB instance - * namespace. The collection could have a mixture of triple - * and/or quad stores since the lexicon does not interact with - * whether we are using triples or quads (except for SIDs). */ V asValue(final BigdataValueFactory vf, final ILexiconConfiguration config) throws UnsupportedOperationException; Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IVUtility.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IVUtility.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IVUtility.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -194,13 +194,8 @@ * * @param key * The byte[]. + * * @return The {@link IV}. - * - * FIXME handle all of the inline value types. - * - * FIXME Construct the InternalValue objects using factory if we - * will have to scope how the RDF Value is represented to the - * lexicon relation with which it is associated? */ public static IV decode(final byte[] key) { @@ -215,13 +210,8 @@ * The byte[]. * @param numTerms * The number of terms to decode. + * * @return The set of {@link IV}s. - * - * FIXME handle all of the inline value types. - * - * FIXME Construct the InternalValue objects using factory if we - * will have to scope how the RDF Value is represented to the - * lexicon relation with which it is associated? */ public static IV[] decode(final byte[] key, final int numTerms) { @@ -255,13 +245,8 @@ * * @param key * The byte[]. + * * @return The set of {@link IV}s. - * - * FIXME handle all of the inline value types. - * - * FIXME Construct the InternalValue objects using factory if we - * will have to scope how the RDF Value is represented to the - * lexicon relation with which it is associated? */ public static IV[] decodeAll(final byte[] key) { Deleted: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LegacyTermIdUtility.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LegacyTermIdUtility.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LegacyTermIdUtility.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -1,249 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - * Created July 10, 2010 - */ - -package com.bigdata.rdf.internal; - -import org.openrdf.model.BNode; -import org.openrdf.model.Literal; -import org.openrdf.model.URI; -import com.bigdata.btree.keys.IKeyBuilder; -import com.bigdata.btree.keys.KeyBuilder; -import com.bigdata.rawstore.Bytes; -import com.bigdata.rdf.lexicon.ITermIdCodes; -import com.bigdata.rdf.store.AbstractTripleStore.Options; - -class LegacyTermIdUtility implements ITermIdCodes { - - /** - * Return true iff the term identifier is marked as a RDF {@link Literal}. - * <p> - * Note: This simply examines the low bits of the term identifier, which - * marks whether or not the term identifier is a {@link Literal}. - * <p> - * Note: Some entailments require the ability to filter based on whether or - * not a term is a literal. For example, literals may not be entailed into - * the subject position. This method makes it possible to determine whether - * or not a term is a literal without materializing the term, thereby - * allowing the entailments to be computed purely within the term identifier - * space. - * - * @param termId - * The term identifier. - * - * @return <code>true</code> iff the term identifier is marked as an RDF - * {@link Literal}. - */ - static final public boolean isLiteral(final long termId) { - - return (termId & TERMID_CODE_MASK) == TERMID_CODE_LITERAL; - - } - - /** - * Return true iff the term identifier is marked as a RDF {@link BNode}. - * <p> - * Note: This simply examines the low bits of the term identifier, which - * marks whether or not the term identifier is a {@link BNode}. - * - * @param termId - * The term identifier. - * - * @return <code>true</code> iff the term identifier is marked as an RDF - * {@link BNode}. - */ - static final public boolean isBNode(final long termId) { - - return (termId & TERMID_CODE_MASK) == TERMID_CODE_BNODE; - - } - - /** - * Return true iff the term identifier is marked as a RDF {@link URI}. - * <p> - * Note: This simply examines the low bits of the term identifier, which - * marks whether or not the term identifier is a {@link URI}. - * - * @param termId - * The term identifier. - * - * @return <code>true</code> iff the term identifier is marked as an RDF - * {@link URI}. - */ - static final public boolean isURI(final long termId) { - - /* - * Note: The additional != NULL test is necessary for a URI term - * identifier so that it will not report 'true' for 0L since the two low - * order bits used to mark a URI are both zero. - */ - - return (termId & TERMID_CODE_MASK) == TERMID_CODE_URI && termId != TermId.NULL; - - } - - /** - * Return true iff the term identifier identifies a statement (this feature - * is enabled with {@link Options#STATEMENT_IDENTIFIERS}). - * <p> - * Note: This simply examines the low bits of the term identifier, which - * marks whether or not the term identifier is actually a statement - * identifier. - * - * @param termId - * The term identifier. - * - * @return <code>true</code> iff the term identifier identifies a - * statement. - */ - static final public boolean isStatement(final long termId) { - - return (termId & TERMID_CODE_MASK) == TERMID_CODE_STATEMENT; - - } - - /** - * Return the {@link VTE} identified by the LOW TWO (2) - * bits in the caller's value. - * - * @param b - * The bit flags. - * @return The corresponding {@link VTE}. - */ - static final public VTE VTE(final long l) { - if (isURI(l)) - return VTE.URI; - if (isBNode(l)) - return VTE.BNODE; - if (isLiteral(l)) - return VTE.LITERAL; - if (isStatement(l)) - return VTE.STATEMENT; - - throw new AssertionError(String.valueOf(l)); - } - - /** - * Construct a new style {@link TermId} from an old style long tid. The - * term type is encoded into the long in the old style long tid and will - * be converted to a {@link VTE} by this method. - * - * @param legacyTid - * The old style long term identifier. See {@link ITermIdCodes}. - */ - static final public TermId termId(final long legacyTid) { - - if (legacyTid == TermId.NULL) - return null; - - return new TermId(VTE(legacyTid), legacyTid); - - } - - /** - * Encode an IV using the old style data scheme, which is to just write the - * long term identifier without the flags. - * - * @param keyBuilder - * The object used to encode the {@link IV}. - * @param iv - * The {@link IV} to encode. - */ - static final public IKeyBuilder encode(IKeyBuilder keyBuilder, IV iv) { - - if (iv.isInline()) { - throw new IllegalArgumentException(); - } - - keyBuilder.append(iv.getTermId()); - - return keyBuilder; - - } - - /** - * Decode an IV using the old style data scheme, which is to just read the - * long term identifier without any flags. - * - * @param key - * The byte[]. - * @return The {@link IV} or <code>null</code> if the - * <code>tid == {@link TermId#NULL}</code>. - */ - static final public TermId decode(byte[] key) { - - final long tid = KeyBuilder.decodeLong(key, 0); - - return termId(tid); - - } - - /** - * Decode a set of {@link IV}s from a byte[]. - * - * @param key - * The byte[]. - * @return The set of {@link IV}s. - * - * FIXME handle all of the inline value types. - * - * FIXME Construct the InternalValue objects using factory if we - * will have to scope how the RDF Value is represented to the - * lexicon relation with which it is associated? - */ - public static IV[] decode(final byte[] key, final IV[] ivs) { - - final int arity = ivs.length; - - int offset = 0; - - for (int i = 0; i < arity; i++) { - - // decode the term identifier. - final long termId = KeyBuilder.decodeLong(key, offset); - offset += Bytes.SIZEOF_LONG; - - /* - * FIXME this is here for now until - * {@link AbstractInternalValue#isNull(byte)} works. - */ - if (termId == TermId.NULL) { - - ivs[i] = null; - - } else { - - ivs[i] = termId(termId); - - } - - } - - return ivs; - - } - -} Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LexiconConfiguration.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LexiconConfiguration.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LexiconConfiguration.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -44,17 +44,14 @@ * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ - * - * @todo large literal size boundary. - * @todo other configuration options. */ -public class LexiconConfiguration<V extends BigdataValue> implements ILexiconConfiguration { +public class LexiconConfiguration<V extends BigdataValue> implements ILexiconConfiguration<V> { - private boolean inlineLiterals, inlineBNodes; + private final boolean inlineLiterals, inlineBNodes; - private Map<TermId, IExtension> termIds; + private final Map<TermId, IExtension> termIds; - private Map<String, IExtension> datatypes; + private final Map<String, IExtension> datatypes; public LexiconConfiguration(final boolean inlineLiterals, final boolean inlineBNodes, final IExtensionFactory xFactory) { this.inlineLiterals = inlineLiterals; @@ -265,7 +262,7 @@ } - private boolean isSupported(DTE dte) { + private boolean isSupported(final DTE dte) { switch (dte) { case XSDBoolean: Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/TermId.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/TermId.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/TermId.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -23,7 +23,6 @@ */ package com.bigdata.rdf.internal; -import java.util.UUID; import com.bigdata.btree.keys.IKeyBuilder; import com.bigdata.rawstore.Bytes; import com.bigdata.rdf.model.BigdataValue; @@ -51,9 +50,6 @@ /** The term identifier. */ private final long termId; -// /** The datatype term identifier. */ -// private final long dataTypeId; - /** * Constructor for a term identifier when you are decoding and already have * the flags. @@ -87,34 +83,8 @@ this.termId = termId; -// this.dataTypeId = 0L; - } -// /** -// * Constructor for a term identifier for a datatype literal. Do NOT use this -// * constructor when the lexicon is configured such that the datatype literal -// * should be inlined. -// * -// * @param vte -// * @param dte -// * @param termId -// * @param dataTypeId -// */ -// public TermId(final VTE vte, final DTE dte, final long termId, -// final long dataTypeId) { -// -// super(vte, false/* inline */, true/* extension */, dte); -// -// if (dataTypeId == IRawTripleStore.NULL) -// throw new IllegalArgumentException(); -// -// this.termId = termId; -// -// this.dataTypeId = dataTypeId; -// -// } - /** * Human readable representation includes the term identifier, whether * this is a URI, Literal, Blank node, or Statement identifier and the @@ -152,13 +122,6 @@ return termId; } -// /** -// * Return the term identifier for the datatype associated with the term. -// */ -// final public long getDataTypeID() { -// return dataTypeId; -// } - /** * Always returns <code>false</code> since the RDF value is not inline. */ @@ -176,6 +139,8 @@ } /** + * {@inheritDoc + * * Note: only the termId matters for equality (unless we also have a * transient reference to the value factory which stands in as a proxy for * the KB instance). @@ -198,14 +163,6 @@ return (int) (termId ^ (termId >>> 32)); } - /** - * {@inheritDoc} - * - * FIXME We are going to need another class with similar semantics if we - * also allow raw tids (the historical way of coding a term identifier as - * just 8 bytes). I suggest RawTermId for the old way and TermId for the new - * way. - */ public int byteLength() { return 1 + Bytes.SIZEOF_LONG; @@ -220,11 +177,7 @@ return termId < termId2 ? -1 : termId > termId2 ? 1 : 0; } - - /** - * {@inheritDoc} - */ @Override public IKeyBuilder encode(final IKeyBuilder keyBuilder) { Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSD.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSD.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSD.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -27,6 +27,12 @@ import org.openrdf.model.URI; import org.openrdf.model.impl.URIImpl; +/** + * Collects various XSD URIs as constants. + * + * @author <a href="mailto:mrp...@us...">Mike Personick</a> + * @version $Id$ + */ public interface XSD { String NAMESPACE = "http://www.w3.org/2001/XMLSchema#"; Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDDoubleIV.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDDoubleIV.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDDoubleIV.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -115,7 +115,9 @@ public boolean equals(final Object o) { if(this==o) return true; if(o instanceof XSDDoubleIV<?>) { - return this.value == ((XSDDoubleIV<?>) o).value; +// return this.value == ((XSDDoubleIV<?>) o).value; + // Note: This handles NaN, etc. + return Double.compare(this.value, ((XSDDoubleIV<?>) o).value) == 0; } return false; } Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDFloatIV.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDFloatIV.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDFloatIV.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -115,7 +115,9 @@ public boolean equals(final Object o) { if(this==o) return true; if(o instanceof XSDFloatIV<?>) { - return this.value == ((XSDFloatIV<?>) o).value; +// return this.value == ((XSDFloatIV<?>) o).value; + // Note: This handles NaN, etc. + return Float.compare(this.value, ((XSDFloatIV<?>) o).value) == 0; } return false; } Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/ITermIndexCodes.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/ITermIndexCodes.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/ITermIndexCodes.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -27,9 +27,6 @@ package com.bigdata.rdf.lexicon; -import com.bigdata.rdf.internal.VTE; - - /** * This interface defines the signed byte values indicating the type of a term * in the term index. The purpose of this is to partition the term:id index into Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Id2TermWriteProc.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Id2TermWriteProc.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Id2TermWriteProc.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -79,7 +79,7 @@ * forms when another of the forms was already present under the * key. * - * FIXME Now it's not only deprecated, but the code that relies on it has + * Note: Now it's not only deprecated, but the code that relies on it has * been commented out. This is because it makes assumptions about how * {@link TermId} objects are encoded and decoded. Under the legacy model * they were simple longs. After the lexicon refactor we use the byte Modified: trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconKeyBuilder.java =================================================================== --- trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconKeyBuilder.java 2010-07-27 15:50:21 UTC (rev 3306) +++ trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconKeyBuilder.java 2010-07-27 16:06:03 UTC (rev 3307) @@ -15,57 +15,8 @@ * unsigned byte[] keys for RDF {@link Value}s and term identifiers. In general, * keys for RDF values are formed by a leading byte that indicates the type of * the value (URI, BNode, or some type of Literal), followed by the components - * of that value type. For datatype literals, there is an additional 32-bit - * integer encoded into the key which divides the key space into disjoint value - * spaces for different datatypes. Each disjoint value space encodes the key - * onto an unsigned byte[] in order to impose a total ordering within that value - * space. Data type values for float, double, long, int, short, and byte will - * each be coded into the minimum number of bytes required to represent that - * value space. Datatypes which are not explicitly handled are placed into an - * "unknown" value space, their datatype URI is coded into the key, and finally - * the data type value is coded as a Unicode sort key using their lexical - * representation without further normalization. Both plain literals and - * {@link XMLSchema#STRING} literals are mapped onto the value space of plain - * literals per <a href="http://www.w3.org/TR/rdf-mt/">RDF Semantics</a>. + * of that value type. * - * FIXME Registering the coders breaks some of the SPARQL unit tests for the - * Sesame TCK. I need to look into these tests and figure out why they are - * breaking and whether we can use these coders with SPARQL or not. The problem - * may be that distinct lexical forms are being mapped onto the same point in - * the code space and assigned the same term identifier. If SPARQL does not - * allow that and requires that we perform equality testing in the query rather - * than forcing convergence onto the value space in the lexicon then these - * coders can not be used if we are to remain in compliance with the - * specification. - *<P> - * We could make the use of the value space coders an option, and allow people - * whose applications can benefit from this behavior to enable it themselves. - * <p> - * If we not going to be able to exploit the key value space then we can - * simplify both this logic and the coding of the datatype keys, saving the 4 - * bytes per datatype value in the key used to formulate the disjoint value - * spaces. - * - * @todo Support has not been implemented for unsigned data types. - * - * @todo Support has not been implemented for a variety of other data types. - * - * @todo The total ordering within a value space makes possible certain query - * optimizations since strongly typed values of the same data type can be - * traversed in order (or within a half-open range) without sorting. In - * addition, it is possible to directly decode values from the key for - * many of these value types, e.g., float, double, long, int, short and - * byte. However, there may be little utility for that feature since the - * statements are encoded by term identifiers and the term identifiers for - * data type values DO NOT respect the order of the data type itself. - * - * @todo Allow extension of the {@link IDatatypeKeyCoder} factory. The - * extensions must assigned a consistent code for the corresponding - * "type." Currently, this must be done in the source code and the - * registered coders map is static. Alternatively, this could be mediated - * by the GRS for the owning {@link LexiconRelation}. Negative code values - * are reserved for the application. - * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ */ @@ -73,797 +24,6 @@ public final IKeyBuilder keyBuilder; -// /** -// * Interface for classes encapsulating the logic to encode (and where -// * possible, decode) datatype literals. -// * -// * @author <a href="mailto:tho...@us...">Bryan -// * Thompson</a> -// * @version $Id$ -// */ -// public static interface IDatatypeKeyCoder { -// -// /** -// * Interpret the text as some specific data type and encode a -// * representation of that data type value suitable for an index whose -// * keys are unsigned byte[]s. -// * -// * @param keyBuilder -// * The object used to build up the key. -// * @param text -// * A lexical representation of the value. -// */ -// void encode(IKeyBuilder keyBuilder, String text); -// -// /** -// * Decode a slice of a byte[] containing a key formed by -// * {@link #encode(IKeyBuilder, String)}. -// * -// * @param key -// * The byte[]. -// * @param off -// * The first byte in the slice. -// * @param len -// * The length of the slice. -// * -// * @return A lexical representation of the decoded value. -// * -// * @throws UnsupportedOperationException -// * If the keys for the datatype encoded by this interface -// * can not be decoded without loss. For example, this is -// * true of {@link XMLSchema#STRING} when compressed Unicode -// * sort keys are used. -// * -// * @todo the [len] parameter is probably not necessary for most things, -// * but there are some cool key types that are both variable length -// * and totally ordered. E.g., eXist XML node identifiers. -// */ -// String decode(byte[] key, int off, int len); -// -// /** -// * Return <code>true</code> if the implementation of this interface -// * encodes keys which can be decoded without loss. "Loss" means that it -// * is not possible to decode a value which correspond to the same point -// * in the value space of the datatype. For example, <code>.5</code> and -// * <code>0.5</code> both represent the same point in the -// * {@link XMLSchema#FLOAT} value space. These values are therefore -// * decodable without loss, even though the decoded value might not have -// * the same lexical representation. -// */ -// boolean isDecodable(); -// -// /** -// * Return the unique code designated for the primitive data type handled -// * by this coder. Coders which self-report values for this method which -// * are in conflict will be reported by a runtime exception. The -// * appropriate code values are declared by this interface. The primitive -// * datatypes include: -// * -// * <pre> -// * 3.2.1 string -// * 3.2.2 boolean -// * 3.2.3 decimal -// * 3.2.4 float -// * 3.2.5 double -// * 3.2.6 duration -// * 3.2.7 dateTime -// * 3.2.8 time -// * 3.2.9 date -// * 3.2.10 gYearMonth -// * 3.2.11 gYear -// * 3.2.12 gMonthDay -// * 3.2.13 gDay -// * 3.2.14 gMonth -// * 3.2.15 hexBinary -// * 3.2.16 base64Binary -// * 3.2.17 anyURI -// * 3.2.18 QName -// * 3.2.19 NOTATION -// * </pre> -// * -// * @see http://www.w3.org/TR/swbp-xsch-datatypes/ -// * @see <a ref="http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#built-in-primitive-datatypes>primitiv -// * e data types.</a> -// */ -// int code(); -// -// /** -// * Code used for unrecognized or otherwise unhandled data types. -// */ -// int CODE_OTHER = 0; -// -// int CODE_XSD_STRING = 1; -// -// int CODE_XSD_BOOLEAN = 2; -// -// /** -// * Arbitrary magnitude decimal values with arbitrary digits after the -// * decimal. -// */ -// int CODE_XSD_DECIMAL = 3; -// -// int CODE_XSD_FLOAT = 4; -// -// int CODE_XSD_DOUBLE = 5; -// -// /** @deprecated until good semantics have been developed. */ -// int CODE_XSD_DURATION = 6; -// -// int CODE_XSD_DATETIME = 7; -// -// int CODE_XSD_TIME = 8; -// -// int CODE_XSD_DATE = 9; -// -// int CODE_XSD_GYEARMONTH = 10; -// -// int CODE_XSD_GYEAR = 11; -// -// int CODE_XSD_GMONTHDAY = 12; -// -// int CODE_XSD_HEXBINARY = 13; -// -// int CODE_XSD_BASE64BINARY = 14; -// -// int CODE_XSD_ANYURI = 15; -// -// int CODE_XSD_QNAME = 16; -// -// int CODE_XSD_NOTATION = 17; -// -// /* -// * Arbitrary magnitude integers. -// */ -// int CODE_XSD_INTEGER = 18; -// -// /* -// * Various signed fixed width integer types. -// */ -// int CODE_XSD_LONG = 32; -// -// int CODE_XSD_INT = 33; -// -// int CODE_XSD_SHORT = 34; -// -// int CODE_XSD_BYTE = 35; -// -// /* -// * Various unsigned fixed with integer types. -// */ -// int CODE_XSD_ULONG = 36; -// -// int CODE_XSD_UINT = 37; -// -// int CODE_XSD_USHORT = 38; -// -// int CODE_XSD_UBYTE = 39; -// -// /** -// * An {@link RDF#XMLLITERAL}. -// */ -// int CODE_XML_LITERAL = 40; -// -// } -// -// /** -// * Handles anything derived from the primitive data type -// * {@link XMLSchema#BOOLEAN}. All such values are coded in a single byte. -// * -// * @author <a href="mailto:tho...@us...">Bryan -// * Thompson</a> -// * @version $Id$ -// */ -// public static class XSDBooleanCoder implements IDatatypeKeyCoder { -// -// public static transient final IDatatypeKeyCoder INSTANCE = new XSDBooleanCoder(); -// -// public int code() { -// -// return CODE_XSD_BOOLEAN; -// -// } -// -// public String decode(byte[] buf, int off, int len) { -// -// return KeyBuilder.decodeByte(buf[off]) == 1 ? "true" : "false"; -// -// } -// -// public void encode(IKeyBuilder keyBuilder, String text) { -// -// text = text.trim(); -// -// final boolean t; -// -// if ("true".equalsIgnoreCase(text) || "1".equals(text)) { -// -// t = true; -// -// } else if ("false".equalsIgnoreCase(text) || "0".equals(text)) { -// -// t = false; -// -// } else { -// -// throw new RuntimeException("Does not match xsd:boolean : " -// + text); -// -// } -// -// keyBuilder.append((byte) (t ? 1 : 0)); -// -// } -// -// /** Yes. */ -// public boolean isDecodable() { -// -// return true; -// -// } -// -// } -// -//// /** -//// * Handles anything derived from the primitive data type -//// * {@link XMLSchema#STRING}. Values are coded as Unicode sort keys and ARE -//// * NOT decodable. -//// * -//// * @author <a href="mailto:tho...@us...">Bryan -//// * Thompson</a> -//// * @version $Id$ -//// */ -//// public static class XSDStringCoder implements IDatatypeKeyCoder { -//// -//// public static transient final IDatatypeKeyCoder INSTANCE = new XSDStringCoder(); -//// -//// public int code() { -//// -//// return CODE_XSD_STRING; -//// -//// } -//// -//// public String decode(byte[] buf, int off, int len) { -//// -//// throw new UnsupportedOperationException(); -//// -//// } -//// -//// public void encode(IKeyBuilder keyBuilder, String text) { -//// -//// keyBuilder.append(text); -//// -//// } -//// -//// /** No - this class uses Unicode sort keys, which are not decodable. */ -//// public boolean isDecodable() { -//// -//// return false; -//// -//// } -//// -//// } -// -// /** -// * Handles {@link XMLSchema#LONG}. All such values are coded as 64-bit -// * integers. -// * -// * @author <a href="mailto:tho...@us...">Bryan -// * Thompson</a> -// * @version $Id$ -// */ -// public static class XSDLongCoder implements IDatatypeKeyCoder { -// -// public static transient final IDatatypeKeyCoder INSTANCE = new XSDLongCoder(); -// -// public int code() { -// -// return CODE_XSD_LONG; -// -// } -// -// public String decode(byte[] buf, int off, int len) { -// -// return Long.toString(KeyBuilder.decodeLong(buf, off)); -// -// } -// -// public void encode(IKeyBuilder keyBuilder, String text) { -// -// keyBuilder.append(Long.valueOf(text).longValue()); -// -// } -// -// /** Yes. */ -// public boolean isDecodable() { -// -// return true; -// -// } -// -// } -// -// /** -// * Handles {@link XMLSchema#INT}. All such values are coded as 32-bit -// * integers. -// * -// * @author <a href="mailto:tho...@us...">Bryan -// * Thompson</a> -// * @version $Id$ -// */ -// public static class XSDIntCoder implements IDatatypeKeyCoder { -// -// public static transient final IDatatypeKeyCoder INSTANCE = new XSDIntCoder(); -// -// public int code() { -// -// return CODE_XSD_INT; -// -// } -// -// public String decode(byte[] buf, int off, int len) { -// -// return Integer.toString(KeyBuilder.decodeInt(buf, off)); -// -// } -// -// public void encode(IKeyBuilder keyBuilder, String text) { -// -// keyBuilder.append(Integer.valueOf(text).intValue()); -// -// } -// -// /** Yes. */ -// public boolean isDecodable() { -// -// return true; -// -// } -// -// } -// -// /** -// * Handles {@link XMLSchema#SHORT}. All such values are coded as 16-bit -// * integers. -// * -// * @author <a href="mailto:tho...@us...">Bryan -// * Thompson</a> -// * @version $Id$ -// */ -// public static class XSDShortCoder implements IDatatypeKeyCoder { -// -// public static transient final IDatatypeKeyCoder INSTANCE = new XSDShortCoder(); -// -// public int code() { -// -// return CODE_XSD_SHORT; -// -// } -// -// public String decode(byte[] buf, int off, int len) { -// -// return Short.toString(KeyBuilder.decodeShort(buf, off)); -// -// } -// -// public void encode(IKeyBuilder keyBuilder, String text) { -// -// keyBuilder.append(Short.valueOf(text).shortValue()); -// -// } -// -// /** Yes. */ -// public boolean isDecodable() { -// -// return true; -// -// } -// -// } -// -// /** -// * Handles {@link XMLSchema#BYTE}. All such values are coded as 8-bit -// * integers. -// * -// * @author <a href="mailto:tho...@us...">Bryan -// * Thompson</a> -// * @version $Id$ -// */ -// public static class XSDByteCoder implements IDatatypeKeyCoder { -// -// public static transient final IDatatypeKeyCoder INSTANCE = new XSDByteCoder(); -// -// public int code() { -// -// return CODE_XSD_BYTE; -// -// } -// -// public String decode(byte[] buf, int off, int len) { -// -// return Byte.toString(KeyBuilder.decodeByte(buf[off])); -// -// } -// -// public void encode(IKeyBuilder keyBuilder, String text) { -// -// keyBuilder.append(Byte.valueOf(text).byteValue()); -// -// } -// -// /** Yes. */ -// public boolean isDecodable() { -// -// return true; -// -// } -// -// } -// -// /** -// * Handles anything derived from the primitive data type -// * {@link XMLSchema#FLOAT}. All such values are coded as 32-bit integers. -// * -// * @author <a href="mailto:tho...@us...">Bryan -// * Thompson</a> -// * @version $Id$ -// */ -// public static class XSDFloatCoder implements IDatatypeKeyCoder { -// -// public static transient final IDatatypeKeyCoder INSTANCE = new XSDFloatCoder(); -// -// public int code() { -// -// return CODE_XSD_FLOAT; -// -// } -// -// public String decode(byte[] buf, int off, int len) { -// -// return Float.toString(KeyBuilder.decodeFloat(buf, off)); -// -// } -// -// public void encode(IKeyBuilder keyBuilder, String text) { -// -// keyBuilder.append(Float.valueOf(text).floatValue()); -// -// } -// -// /** Yes. */ -// public boolean isDecodable() { -// -// return true; -// -// } -// -// } -// -// /** -// * Handles anything derived from the primitive data type -// * {@link XMLSchema#DOUBLE}. All such values are coded as 64-bit integers. -// * -// * @author <a href="mailto:tho...@us...">Bryan -// * Thompson</a> -// * @version $Id$ -// */ -// public static class XSDDoubleCoder implements IDatatypeKeyCoder { -// -// public static transient final IDatatypeKeyCoder INSTANCE = new XSDDoubleCoder(); -// -// public int code() { -// -// return CODE_XSD_DOUBLE; -// -// } -// -// public String decode(byte[] buf, int off, int len) { -// -// return Double.toString(KeyBuilder.decodeDouble(buf, off)); -// -// } -// -// public void encode(IKeyBuilder keyBuilder, String text) { -// -// keyBuilder.append(Double.valueOf(text).doubleValue()); -// -// } -// -// /** Yes. */ -// public boolean isDecodable() { -// -// return true; -// -// } -// -// } -// -//// /** -//// * Handles anything derived from the primitive data type -//// * {@link XMLSchema#DATETIME}. -//// * -//// * @author <a href="mailto:tho...@us...">Bryan -//// * Thompson</a> -//// * @version $Id$ -//// */ -//// public static class XSDDateTimeCoder implements IDatatypeKeyCoder { -//// -//// public static transient final IDatatypeKeyCoder INSTANCE = new XSDDateTimeCoder(); -//// -//// public int code() { -//// -//// return CODE_XSD_DATETIME; -//// -//// } -//// -//// public String decode(byte[] buf, int off, int len) { -//// -//// throw new UnsupportedOperationException(); -////// return Double.toString(KeyBuilder.decodeDouble(buf, off)); -//// -//// } -//// -//// public void encode(IKeyBuilder keyBuilder, String text) { -//// -//// final XMLGregorianCalendar cal = XMLDatatypeUtil.parseCalendar(text); -//// -//// // FIXME normalize to UTC and encode as int64 seconds since epoch or what? -//// -////// keyBuilder.append(.doubleValue()); -//// -//// throw new UnsupportedOperationException(); -//// -//// } -//// -//// /** No. */ -//// public boolean isDecodable() { -//// -//// return false; -//// -//// } -//// -//// } -// -// /** -// * Handles anything derived from the primitive data type -// * {@link XMLSchema#STRING}. Values are coded as Unicode sort keys and -// * ARE NOT decodable. -// * -// * @author <a href="mailto:tho...@us...">Bryan -// * Thompson</a> -// * @version $Id$ -// */ -// public static class XSDAnyURICoder implements IDatatypeKeyCoder { -// -// public static transient final IDatatypeKeyCoder INSTANCE = new XSDAnyURICoder(); -// -// public int code() { -// -... [truncated message content] |
From: <mrp...@us...> - 2010-07-27 15:50:28
|
Revision: 3306 http://bigdata.svn.sourceforge.net/bigdata/?rev=3306&view=rev Author: mrpersonick Date: 2010-07-27 15:50:21 +0000 (Tue, 27 Jul 2010) Log Message: ----------- don't run this test if we're not inlining Modified Paths: -------------- trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/constraints/TestInlineConstraints.java Modified: trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/constraints/TestInlineConstraints.java =================================================================== --- trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/constraints/TestInlineConstraints.java 2010-07-27 15:08:28 UTC (rev 3305) +++ trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/constraints/TestInlineConstraints.java 2010-07-27 15:50:21 UTC (rev 3306) @@ -27,19 +27,15 @@ package com.bigdata.rdf.internal.constraints; -import java.util.Iterator; +import java.util.Properties; import org.openrdf.model.vocabulary.RDF; import com.bigdata.rdf.internal.IV; -import com.bigdata.rdf.internal.constraints.InlineGT; -import com.bigdata.rdf.internal.constraints.InlineLT; import com.bigdata.rdf.model.BigdataLiteral; import com.bigdata.rdf.model.BigdataURI; import com.bigdata.rdf.model.BigdataValue; import com.bigdata.rdf.model.BigdataValueFactory; -import com.bigdata.rdf.model.StatementEnum; import com.bigdata.rdf.rio.StatementBuffer; import com.bigdata.rdf.rules.RuleContextEnum; -import com.bigdata.rdf.spo.ISPO; import com.bigdata.rdf.spo.SPOPredicate; import com.bigdata.rdf.store.AbstractTripleStore; import com.bigdata.rdf.store.ProxyTestCase; @@ -85,6 +81,11 @@ // store with no owl:sameAs closure AbstractTripleStore db = getStore(); + + // do not run if we are not inlining + if (!db.getLexiconRelation().isInlineLiterals()) { + return; + } try { @@ -183,6 +184,11 @@ // store with no owl:sameAs closure AbstractTripleStore db = getStore(); + // do not run if we are not inlining + if (!db.getLexiconRelation().isInlineLiterals()) { + return; + } + try { BigdataValueFactory vf = db.getValueFactory(); @@ -282,6 +288,11 @@ // store with no owl:sameAs closure AbstractTripleStore db = getStore(); + // do not run if we are not inlining + if (!db.getLexiconRelation().isInlineLiterals()) { + return; + } + try { BigdataValueFactory vf = db.getValueFactory(); @@ -385,6 +396,11 @@ // store with no owl:sameAs closure AbstractTripleStore db = getStore(); + // do not run if we are not inlining + if (!db.getLexiconRelation().isInlineLiterals()) { + return; + } + try { BigdataValueFactory vf = db.getValueFactory(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-27 15:08:39
|
Revision: 3305 http://bigdata.svn.sourceforge.net/bigdata/?rev=3305&view=rev Author: thompsonbry Date: 2010-07-27 15:08:28 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Merged r2632 through r3304 from LEXICON_REFACTOR_BRANCH into trunk. The LEXICON_REFACTOR_BRANCH is now closed. This commit introduces support for inlining xsd numerics in the statement indices. That physical schema change breaks binary compatibility for the triple store. Since this change touches every tuple in the statement indices, the migration path is to export and import your data. Modified Paths: -------------- trunk/.classpath trunk/bigdata/src/java/com/bigdata/LRUNexus.java trunk/bigdata/src/java/com/bigdata/btree/AbstractBTree.java trunk/bigdata/src/java/com/bigdata/btree/DefaultTupleSerializer.java trunk/bigdata/src/java/com/bigdata/btree/IndexMetadata.java trunk/bigdata/src/java/com/bigdata/btree/IndexSegment.java trunk/bigdata/src/java/com/bigdata/btree/IndexSegmentBuilder.java trunk/bigdata/src/java/com/bigdata/btree/IndexSegmentStore.java trunk/bigdata/src/java/com/bigdata/btree/NodeSerializer.java trunk/bigdata/src/java/com/bigdata/btree/keys/IKeyBuilder.java trunk/bigdata/src/java/com/bigdata/btree/keys/KeyBuilder.java trunk/bigdata/src/java/com/bigdata/btree/proc/AbstractKeyArrayIndexProcedure.java trunk/bigdata/src/java/com/bigdata/counters/AbstractStatisticsCollector.java trunk/bigdata/src/java/com/bigdata/io/DirectBufferPool.java trunk/bigdata/src/java/com/bigdata/journal/AbstractBufferStrategy.java trunk/bigdata/src/java/com/bigdata/journal/AbstractJournal.java trunk/bigdata/src/java/com/bigdata/journal/BufferMode.java trunk/bigdata/src/java/com/bigdata/journal/DiskOnlyStrategy.java trunk/bigdata/src/java/com/bigdata/journal/FileMetadata.java trunk/bigdata/src/java/com/bigdata/journal/Options.java trunk/bigdata/src/java/com/bigdata/mdi/IndexPartitionCause.java trunk/bigdata/src/java/com/bigdata/relation/IRelation.java trunk/bigdata/src/java/com/bigdata/relation/accesspath/SameVariableConstraint.java trunk/bigdata/src/java/com/bigdata/relation/locator/DefaultResourceLocator.java trunk/bigdata/src/java/com/bigdata/relation/rule/IPredicate.java trunk/bigdata/src/java/com/bigdata/relation/rule/Rule.java trunk/bigdata/src/java/com/bigdata/relation/rule/Var.java trunk/bigdata/src/java/com/bigdata/relation/rule/eval/DefaultRuleTaskFactory.java trunk/bigdata/src/java/com/bigdata/relation/rule/eval/RuleState.java trunk/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/JoinTask.java trunk/bigdata/src/java/com/bigdata/relation/rule/eval/pipeline/LocalJoinTask.java trunk/bigdata/src/java/com/bigdata/service/ndx/RawDataServiceTupleIterator.java trunk/bigdata/src/java/com/bigdata/service/proxy/RemoteAsynchronousIteratorImpl.java trunk/bigdata/src/java/com/bigdata/service/proxy/RemoteChunk.java trunk/bigdata/src/java/com/bigdata/sparse/AbstractAtomicRowReadOrWrite.java trunk/bigdata/src/java/com/bigdata/sparse/SparseRowStore.java trunk/bigdata/src/java/com/bigdata/striterator/IKeyOrder.java trunk/bigdata/src/resources/logging/log4j.properties trunk/bigdata/src/test/com/bigdata/btree/AbstractBTreeTestCase.java trunk/bigdata/src/test/com/bigdata/btree/AbstractIndexSegmentTestCase.java trunk/bigdata/src/test/com/bigdata/btree/TestAll_IndexSegment.java trunk/bigdata/src/test/com/bigdata/btree/TestIndexSegmentBuilderWithLargeTrees.java trunk/bigdata/src/test/com/bigdata/btree/keys/TestKeyBuilder.java trunk/bigdata/src/test/com/bigdata/relation/accesspath/TestSameVariableConstraint.java trunk/bigdata/src/test/com/bigdata/relation/rule/AbstractRuleTestCase.java trunk/bigdata/src/test/com/bigdata/relation/rule/TestRule.java trunk/bigdata/src/test/com/bigdata/search/TestAll.java trunk/bigdata/src/test/com/bigdata/search/TestSearchRestartSafe.java trunk/bigdata/src/test/com/bigdata/sparse/TestAll.java trunk/bigdata-bsbm/src/resources/bsbm-data/queries/query4.txt trunk/bigdata-rdf/src/java/com/bigdata/rdf/axioms/Axioms.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/axioms/BaseAxioms.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/BackchainOwlSameAsIterator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/BackchainOwlSameAsPropertiesIterator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/BackchainOwlSameAsPropertiesPIterator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/BackchainOwlSameAsPropertiesPOIterator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/BackchainOwlSameAsPropertiesSPIterator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/BackchainOwlSameAsPropertiesSPOIterator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/BackchainTypeResourceIterator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/FullyBufferedJustificationIterator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/Justification.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/OwlSameAsPropertiesExpandingIterator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/RdfTypeRdfsResourceFilter.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/SPOAssertionBuffer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/TruthMaintenance.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/BigdataRDFFullTextIndex.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/ITermIdFilter.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/ITermIndexCodes.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Id2TermTupleSerializer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Id2TermWriteProc.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/KVOTermIdComparator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconKeyBuilder.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/ReverseIndexWriterTask.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Term2IdTupleSerializer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Term2IdWriteProc.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/Term2IdWriteTask.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/load/VerifyStatementBuffer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/magic/IMagicTuple.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/magic/IRISUtils.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicAccessPath.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicIndexWriteProc.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicKeyOrder.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicPredicate.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicRelation.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicTuple.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/magic/MagicTupleSerializer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/BNodeContextFactory.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataBNodeImpl.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataLiteralImpl.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataResourceImpl.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataStatementImpl.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataURIImpl.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValue.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactory.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueIdComparator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueImpl.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/StatementEnum.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/TermIdComparator2.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rio/AsynchronousStatementBufferFactory.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rio/StatementBuffer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rules/AbstractRuleDistinctTermScan.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rules/AbstractRuleFastClosure_11_13.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rules/AbstractRuleFastClosure_3_5_6_7_9.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rules/AbstractRuleFastClosure_5_6_7_9.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rules/BackchainAccessPath.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rules/DoNotAddFilter.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rules/FastClosure.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rules/MatchRule.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rules/RDFJoinNexus.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/rules/RuleFastClosure3.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/DefaultGraphSolutionExpander.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/DistinctMultiTermAdvancer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/DistinctSPOIterator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/DistinctTermAdvancer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/ExplicitSPOFilter.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/ISPO.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/InGraphBinarySearchFilter.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/InGraphHashSetFilter.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/InferredSPOFilter.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/JustificationRemover.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/JustificationTupleSerializer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/NamedGraphSolutionExpander.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/NoAxiomFilter.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/OSPComparator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/POSComparator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPO.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOAccessPath.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOComparator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOFilter.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOIndexWriteProc.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOKeyOrder.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOPredicate.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPORelation.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOSortKeyBuilder.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOStarJoin.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOTupleSerializer.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/store/AbstractTripleStore.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataSolutionResolverator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataStatementIteratorImpl.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataValueIteratorImpl.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/store/IRawTripleStore.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/store/ITripleStore.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/store/ScaleOutTripleStore.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/store/TripleStoreUtility.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/vocab/BaseVocabulary.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/vocab/Vocabulary.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/TestAll.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/axioms/TestAxioms.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/lexicon/TestAddTerms.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/lexicon/TestAll.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/lexicon/TestComparators.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/lexicon/TestCompletionScan.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/lexicon/TestFullTextIndex.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/lexicon/TestId2TermTupleSerializer.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/lexicon/TestTerm2IdTupleSerializer.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/lexicon/TestVocabulary.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/magic/TestIRIS.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/magic/TestMagicKeyOrderStrategy.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/magic/TestMagicStore.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/model/TestAll.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rio/TestRDFXMLInterchangeWithStatementIdentifiers.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestAll.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestBackchainOwlSameAsPropertiesIterator.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestBackchainTypeResourceIterator.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestDatabaseAtOnceClosure.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestDistinctTermScan.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestJustifications.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestOptionals.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestOwlSameAsPropertiesExpandingIterator.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestRuleExpansion.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestRuleFastClosure_11_13.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestRuleFastClosure_3_5_6_7_9.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestSlice.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/rules/TestTruthMaintenance.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestDefaultGraphAccessPath.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPO.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPOAccessPath.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPOKeyCoders.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPOKeyOrder.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPOPredicate.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPORelation.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPOStarJoin.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPOTupleSerializer.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPOValueCoders.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/AbstractDistributedTripleStoreTestCase.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/AbstractEmbeddedTripleStoreTestCase.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/AbstractTestCase.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestAll.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestBulkFilter.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestLocalTripleStoreTransactionSemantics.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestRestartSafe.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestStatementIdentifiers.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestTripleStore.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestTripleStoreBasics.java trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataConstructIterator.java trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStatistics.java trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl2.java trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSail.java trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataSailHelper.java trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/FreeTextSearchExpander.java trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/HitConvertor.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/TestAll.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBigdataSailEvaluationStrategyImpl.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/TestJoinScope.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/TestNamedGraphs.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/TestProvenanceQuery.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/TestQuery.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/TestSetBinding.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataSparqlTest.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/tck/BigdataSparqlTest2.java trunk/bigdata-sails/src/test/com/bigdata/rdf/stress/LoadClosureAndQueryTest.java trunk/bigdata-sails/src/test/org/openrdf/query/parser/sparql/SPARQLQueryTest.java Added Paths: ----------- trunk/bigdata/src/java/com/bigdata/btree/IndexSegmentMultiBlockIterator.java trunk/bigdata/src/test/com/bigdata/btree/TestIndexSegmentMultiBlockIterators.java trunk/bigdata-bsbm/src/resources/bsbm-data/queries/query4-rewritten.txt trunk/bigdata-bsbm/src/test/ trunk/bigdata-bsbm/src/test/benchmark/ trunk/bigdata-bsbm/src/test/benchmark/bigdata/ trunk/bigdata-bsbm/src/test/benchmark/bigdata/TestBSBM.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractBNodeIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractInlineIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractLiteralIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/BlobOverflowHandler.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DTE.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DTEFlags.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DefaultExtensionFactory.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DummyIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/ExtensionIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IDatatypeURIResolver.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IExtension.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IExtensionFactory.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/ILexiconConfiguration.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IVUtility.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LegacyTermIdUtility.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LexiconConfiguration.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/NullIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/NumericBNodeIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/TermId.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/UUIDBNodeIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/UUIDLiteralIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/VTE.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSD.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDBooleanIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDByteIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDDecimalIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDDoubleIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDFloatIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDIntIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDIntegerIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDLongIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDShortIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/AbstractInlineConstraint.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineEQ.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineGE.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineGT.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineLE.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineLT.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineNE.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/package.html trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/TermIVComparator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/relation/ trunk/bigdata-rdf/src/java/com/bigdata/rdf/relation/rule/ trunk/bigdata-rdf/src/java/com/bigdata/rdf/relation/rule/BindingSetSortKeyBuilder.java trunk/bigdata-rdf/src/samples/ trunk/bigdata-rdf/src/samples/com/ trunk/bigdata-rdf/src/samples/com/bigdata/ trunk/bigdata-rdf/src/samples/com/bigdata/rdf/ trunk/bigdata-rdf/src/samples/com/bigdata/rdf/internal/ trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/ trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/ColorsEnumExtension.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/EpochExtension.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/SampleExtensionFactory.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/TestAll.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/TestEncodeDecodeKeys.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/TestLongLiterals.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/constraints/ trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/constraints/TestAll.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/constraints/TestInlineConstraints.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/lexicon/TestInlining.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/magic/TestAll.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/relation/ trunk/bigdata-rdf/src/test/com/bigdata/rdf/relation/rule/ trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestLocalTripleStoreWithoutInlining.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBigdataSailWithQuadsAndPipelineJoinsWithoutInlining.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/TestBigdataSailWithSidsWithoutInlining.java trunk/bigdata-sails/src/test/com/bigdata/rdf/sail/TestInlineValues.java Removed Paths: ------------- trunk/bigdata/src/architecture/scale-out-perf.txt trunk/bigdata/src/java/com/bigdata/mdi/ReadOnlyMetadataIndexView.java trunk/bigdata/src/java/com/bigdata/relation/rule/BindingSetSortKeyBuilder.java trunk/bigdata/src/java/com/bigdata/service/LocalDataServiceClient.java trunk/bigdata/src/java/com/bigdata/service/LocalDataServiceFederation.java trunk/bigdata/src/java/com/bigdata/service/ndx/DataServiceIndex.java trunk/bigdata/src/test/com/bigdata/service/TestLDS.java trunk/bigdata-bsbm/src/test/benchmark/ trunk/bigdata-bsbm/src/test/benchmark/bigdata/ trunk/bigdata-bsbm/src/test/benchmark/bigdata/TestBSBM.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/inf/VarOrId.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractBNodeIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractInlineIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/AbstractLiteralIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/BlobOverflowHandler.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DTE.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DTEFlags.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DefaultExtensionFactory.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/DummyIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/ExtensionIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IDatatypeURIResolver.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IExtension.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IExtensionFactory.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/ILexiconConfiguration.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/IVUtility.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LegacyTermIdUtility.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/LexiconConfiguration.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/NullIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/NumericBNodeIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/TermId.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/UUIDBNodeIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/UUIDLiteralIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/VTE.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSD.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDBooleanIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDByteIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDDecimalIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDDoubleIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDFloatIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDIntIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDIntegerIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDLongIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/XSDShortIV.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/ trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/AbstractInlineConstraint.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineEQ.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineGE.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineGT.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineLE.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineLT.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/InlineNE.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/internal/package.html trunk/bigdata-rdf/src/java/com/bigdata/rdf/model/TermIdComparator.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/relation/rule/ trunk/bigdata-rdf/src/java/com/bigdata/rdf/relation/rule/BindingSetSortKeyBuilder.java trunk/bigdata-rdf/src/java/com/bigdata/rdf/spo/FastRDFValueCoder.java trunk/bigdata-rdf/src/samples/com/ trunk/bigdata-rdf/src/samples/com/bigdata/ trunk/bigdata-rdf/src/samples/com/bigdata/rdf/ trunk/bigdata-rdf/src/samples/com/bigdata/rdf/internal/ trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/ColorsEnumExtension.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/EpochExtension.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/SampleExtensionFactory.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/TestAll.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/TestEncodeDecodeKeys.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/TestLongLiterals.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/constraints/ trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/constraints/TestAll.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/internal/constraints/TestInlineConstraints.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/relation/rule/ trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/AbstractLocalDataServiceFederationTestCase.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestLocalTripleStoreWORM.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestScaleOutTripleStoreWithLocalDataServiceFederation.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestTripleStoreLoadRateLocal.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestTripleStoreLoadRateWithEmbeddedFederation.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestTripleStoreLoadRateWithExistingJiniFederation.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestTripleStoreLoadRateWithJiniFederation.java trunk/bigdata-rdf/src/test/com/bigdata/rdf/store/TestTripleStoreLoadRateWithLocalDataServiceFederation.java trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java Property Changed: ---------------- trunk/ trunk/bigdata-jini/src/java/com/bigdata/attr/ trunk/bigdata-jini/src/java/com/bigdata/disco/ trunk/bigdata-jini/src/java/com/bigdata/disco/config/ trunk/bigdata-jini/src/java/com/bigdata/util/config/ trunk/bigdata-lubm/lib/ trunk/bigdata-lubm/src/resources/ trunk/bigdata-lubm/src/resources/answers (U1)/ trunk/bigdata-lubm/src/resources/config/ trunk/bigdata-lubm/src/resources/logging/ trunk/bigdata-lubm/src/resources/scripts/ trunk/bigdata-perf/ trunk/bigdata-perf/btc/ trunk/bigdata-perf/btc/src/ trunk/bigdata-perf/btc/src/resources/ trunk/bigdata-perf/btc/src/resources/logging/ trunk/bigdata-perf/uniprot/ trunk/bigdata-perf/uniprot/src/ trunk/bigdata-perf/uniprot/src/resources/ trunk/bigdata-perf/uniprot/src/resources/logging/ trunk/bigdata-rdf/src/java/com/bigdata/rdf/util/ trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/bench/ trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/sparql/ trunk/dsi-utils/ trunk/dsi-utils/LEGAL/ trunk/dsi-utils/lib/ trunk/dsi-utils/src/ trunk/dsi-utils/src/java/ trunk/dsi-utils/src/java/it/ trunk/dsi-utils/src/java/it/unimi/ trunk/dsi-utils/src/java/it/unimi/dsi/ trunk/dsi-utils/src/java/it/unimi/dsi/compression/ trunk/dsi-utils/src/java/it/unimi/dsi/io/ trunk/dsi-utils/src/java/it/unimi/dsi/util/ trunk/dsi-utils/src/test/ trunk/dsi-utils/src/test/it/ trunk/dsi-utils/src/test/it/unimi/ trunk/dsi-utils/src/test/it/unimi/dsi/ trunk/dsi-utils/src/test/it/unimi/dsi/io/ trunk/dsi-utils/src/test/it/unimi/dsi/util/ trunk/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom/ trunk/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom/ trunk/osgi/ trunk/src/resources/bin/config/ Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-2730 /branches/fko:3150-3194 + /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/LEXICON_REFACTOR_BRANCH:2633-3304 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-2730 /branches/fko:3150-3194 Modified: trunk/.classpath =================================================================== --- trunk/.classpath 2010-07-27 13:16:22 UTC (rev 3304) +++ trunk/.classpath 2010-07-27 15:08:28 UTC (rev 3305) @@ -1,67 +1,69 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="src" path="bigdata-rdf/src/java"/> - <classpathentry kind="src" path="dsi-utils/src/java"/> - <classpathentry kind="src" path="bigdata-bsbm/src/java"/> - <classpathentry kind="src" path="bigdata/src/resources/logging"/> - <classpathentry kind="src" path="bigdata-sails/src/samples"/> - <classpathentry kind="src" path="bigdata-jini/src/test"/> - <classpathentry kind="src" path="bigdata-sails/src/java"/> - <classpathentry kind="src" path="bigdata/src/java"/> - <classpathentry kind="src" path="bigdata-rdf/src/test"/> - <classpathentry kind="src" path="bigdata/src/test"/> - <classpathentry kind="src" path="bigdata-sails/src/test"/> - <classpathentry kind="src" path="bigdata-jini/src/java"/> - <classpathentry kind="src" path="bigdata-lubm/src/java"/> - <classpathentry kind="src" path="contrib/src/problems"/> - <classpathentry kind="src" path="bigdata/src/samples"/> - <classpathentry kind="src" path="dsi-utils/src/test"/> - <classpathentry kind="lib" path="bigdata-jini/lib/apache/zookeeper-3.2.1.jar"/> - <classpathentry kind="lib" path="bigdata-sails/lib/commons-httpclient.jar"/> - <classpathentry kind="lib" path="bigdata-sails/lib/servlet-api.jar"/> - <classpathentry kind="lib" path="bigdata/lib/dsi-utils-1.0.6-020610.jar"/> - <classpathentry kind="lib" path="bigdata/lib/lgpl-utils-1.0.6-020610.jar"/> - <classpathentry kind="lib" path="bigdata-rdf/lib/nxparser-6-22-2010.jar"/> - <classpathentry kind="src" path="lgpl-utils/src/java"/> - <classpathentry kind="src" path="lgpl-utils/src/test"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4j-3_6.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/colt-1.2.0.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/ctc_utils-5-4-2005.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/cweb-commons-1.1-b2-dev.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/cweb-extser-0.1-b2-dev.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/cweb-junit-ext-1.1-b3-dev.jar" sourcepath="/junit-ext/src"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/junit-3.8.1.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/apache/log4j-1.2.15.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/icu/icu4jni.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/slf4j-api-1.4.3.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/slf4j-log4j12-1.4.3.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/iris-0.58.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-rdf/lib/jgrapht-jdk1.5-0.7.1.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/browser.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/classserver.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/fiddler.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jini-core.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jini-ext.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-lib.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-platform.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/jsk-resources.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/mahalo.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/mercury.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/norm.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/outrigger.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/reggie.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/start.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/sun-util.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata-jini/lib/jini/lib/tools.jar"/> - <classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/fastutil-5.1.5.jar"/> - <classpathentry kind="lib" path="bigdata-bsbm/lib/jdom.jar"/> - <classpathentry kind="lib" path="bigdata-bsbm/lib/ssj.jar"/> - <classpathentry kind="lib" path="bigdata/lib/lucene/lucene-analyzers-3.0.0.jar"/> - <classpathentry kind="lib" path="bigdata/lib/lucene/lucene-core-3.0.0.jar"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="lib" path="bigdata-rdf/lib/openrdf-sesame-2.3.0-onejar.jar"/> - <classpathentry kind="lib" path="bigdata-sails/lib/sesame-sparql-testsuite-2.3.0.jar"/> - <classpathentry kind="lib" path="bigdata-sails/lib/sesame-store-testsuite-2.3.0.jar"/> - <classpathentry kind="lib" path="bigdata/lib/high-scale-lib-v1.1.2.jar"/> - <classpathentry kind="output" path="bin"/> + <classpathentry path="bigdata-rdf/src/java" kind="src"/> + <classpathentry path="bigdata-rdf/src/samples" kind="src"/> + <classpathentry path="bigdata-bsbm/src/test" kind="src"/> + <classpathentry path="dsi-utils/src/java" kind="src"/> + <classpathentry path="bigdata-bsbm/src/java" kind="src"/> + <classpathentry path="bigdata/src/resources/logging" kind="src"/> + <classpathentry path="bigdata-sails/src/samples" kind="src"/> + <classpathentry path="bigdata-jini/src/test" kind="src"/> + <classpathentry path="bigdata-sails/src/java" kind="src"/> + <classpathentry path="bigdata/src/java" kind="src"/> + <classpathentry path="bigdata-rdf/src/test" kind="src"/> + <classpathentry path="bigdata/src/test" kind="src"/> + <classpathentry path="bigdata-sails/src/test" kind="src"/> + <classpathentry path="bigdata-jini/src/java" kind="src"/> + <classpathentry path="bigdata-lubm/src/java" kind="src"/> + <classpathentry path="contrib/src/problems" kind="src"/> + <classpathentry path="bigdata/src/samples" kind="src"/> + <classpathentry path="dsi-utils/src/test" kind="src"/> + <classpathentry path="bigdata-jini/lib/apache/zookeeper-3.2.1.jar" kind="lib"/> + <classpathentry path="bigdata-sails/lib/commons-httpclient.jar" kind="lib"/> + <classpathentry path="bigdata-sails/lib/servlet-api.jar" kind="lib"/> + <classpathentry path="bigdata/lib/dsi-utils-1.0.6-020610.jar" kind="lib"/> + <classpathentry path="bigdata/lib/lgpl-utils-1.0.6-020610.jar" kind="lib"/> + <classpathentry path="bigdata-rdf/lib/nxparser-6-22-2010.jar" kind="lib"/> + <classpathentry path="lgpl-utils/src/java" kind="src"/> + <classpathentry path="lgpl-utils/src/test" kind="src"/> + <classpathentry path="bigdata/lib/icu/icu4j-3_6.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata/lib/unimi/colt-1.2.0.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata/lib/ctc_utils-5-4-2005.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata/lib/cweb-commons-1.1-b2-dev.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata/lib/cweb-extser-0.1-b2-dev.jar" exported="true" kind="lib"/> + <classpathentry sourcepath="/junit-ext/src" path="bigdata/lib/cweb-junit-ext-1.1-b3-dev.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata/lib/junit-3.8.1.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata/lib/apache/log4j-1.2.15.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata/lib/icu/icu4jni.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-rdf/lib/slf4j-api-1.4.3.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-rdf/lib/slf4j-log4j12-1.4.3.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-rdf/lib/iris-0.58.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-rdf/lib/jgrapht-jdk1.5-0.7.1.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/browser.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/classserver.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/fiddler.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/jini-core.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/jini-ext.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/jsk-lib.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/jsk-platform.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/jsk-resources.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/mahalo.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/mercury.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/norm.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/outrigger.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/reggie.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/start.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/sun-util.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-jini/lib/jini/lib/tools.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata/lib/unimi/fastutil-5.1.5.jar" exported="true" kind="lib"/> + <classpathentry path="bigdata-bsbm/lib/jdom.jar" kind="lib"/> + <classpathentry path="bigdata-bsbm/lib/ssj.jar" kind="lib"/> + <classpathentry path="bigdata/lib/lucene/lucene-analyzers-3.0.0.jar" kind="lib"/> + <classpathentry path="bigdata/lib/lucene/lucene-core-3.0.0.jar" kind="lib"/> + <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"/> + <classpathentry path="bigdata-rdf/lib/openrdf-sesame-2.3.0-onejar.jar" kind="lib"/> + <classpathentry path="bigdata-sails/lib/sesame-sparql-testsuite-2.3.0.jar" kind="lib"/> + <classpathentry path="bigdata-sails/lib/sesame-store-testsuite-2.3.0.jar" kind="lib"/> + <classpathentry path="bigdata/lib/high-scale-lib-v1.1.2.jar" kind="lib"/> + <classpathentry path="bin" kind="output"/> </classpath> Deleted: trunk/bigdata/src/architecture/scale-out-perf.txt =================================================================== --- trunk/bigdata/src/architecture/scale-out-perf.txt 2010-07-27 13:16:22 UTC (rev 3304) +++ trunk/bigdata/src/architecture/scale-out-perf.txt 2010-07-27 15:08:28 UTC (rev 3305) @@ -1,3599 +0,0 @@ -Notes on various things. Mostly free form and in temporal order, -with occasional efforts to collate by topic. - -============================================================ - -Notes on store level record checksums and record compression. - -1. many record compression schemes will fail if the data are corrupt, - but logically you compress first and then checksum the record. - - compression is often a technique using a stream of blocks. - - checksum is a streaming technique. - - // IRawStore#write() - write(ByteBuffer b) : addr - - // AbstractJournal#write() - - if(compress) { - - b = compress(b) - - } - - int chksum; - if(useChecksum) { - - bytesRequired = b.remaining() + 4; - - chmsum = computeChecksum( b ); - - } else bytesRequired = b.remaining(); - - bufferStrategy.write(b,chksum,useChecksum) - - Note: buffer strategy write() probably needs to have the checksum - value pass along in addition to the record to avoid re-allocation - of the ByteBuffer just to tack on the additional 4 bytes. We could - either always write those additional 4 bytes or optionally write - them if checksums are enabled. - -2. the root block needs to hold the critical data indicating whether - or not checksums in use and what record compression technique, if - any, to apply. We need this on hand before we can either read or - write a record on the store. - -3. we need 4 bytes (int32) for the checksum. this should be at the - end of the record, so the size in the store is extended by 4 bytes - and the address for the record on the store is adjusted to also - include those 4 bytes. However, when you read from the store it - will give you a slice WITHOUT those four bytes. Further, if it is - using compression then it will decompress the slice, resulting in a - new slice that can be much larger than the record on the store - whose size is encoded within the address. This will probably break - a variety of asserts that assume that the returned ByteBuffer will - be exactly the size of the byte count encoded in the address. - -4. Compression should run on the byte[] not on the slower ByteBuffer. - Serialization generally writes on a byte[], but sometimes that is - wrapped up as a ByteBuffer - and it can even be a slice() onto a - larger array (NodeSerializer does this since it returns a view onto - an internal buffer). - - /** - * The {@link Adler32} checksum. This is an int32 value, even through the - * {@link Checksum} API returns an int64 (aka long integer) value. The - * actual checksum is in the lower 32 bit. - */ - static final int SIZEOF_CHECKSUM = Bytes.SIZEOF_INT; - - /** - * Offset of the int32 value that is the {@link Adler32} checksum of the - * serialized node or leaf. The checksum is computed for all bytes exclusing - * the first 4 bytes, on which the value of the computed checksum is - * written. - */ - static final int OFFSET_CHECKSUM = 0; - - /** - * When <code>true</code>, checksums will be generated for serialized - * nodes and leaves and verified on read. Checksums provide a check for - * corrupt media and make the database more robust at the expense of some - * added cost to compute a validate the checksums. - * <p> - * Computing the checksum is ~ 40% of the cost of (de-)serialization. - * <p> - * When the backing store is fully buffered (it is entirely in RAM) then - * checksums are automatically disabled. - * - * @deprecated See {@link #setUseChecksum(boolean)} - */ - public final boolean getUseChecksum() {return useChecksum;} - -============================================================ -Consider block storage / NAS deployment scenario. - - In this scenario we use robust remote storage with a large block - size (64M+). The backing store could be HFS or NAS. Only large - chunks are read at a time. Index store writes are also large - chunks. Commit point writes will require partial chunk updates - unless we stream to the failover services at the commit point and - only write to the remote store when we close the journal for writes. - - Use a direct buffer for the live journal, no write cache. - - Use resource lock manager (ala zookeeper) to allocate journal files - on the block store. Commit points write through so that commits are - visible to failover services (or are streamed through to those - services). The initial allocation is for the entire target extent. - Avoid the need to extent by eager overflow as coordinated with the - write executor service. - - Use resource lock manager when obtaining an historical journal or - index segment store. Copy the entire thing to local disk and manage - the data locally that will be used by the server. - -============================================================ -Consider a RW store variant. - - A read-write store would be useful for scale-up deployments where - access to historical commit points is not required. If you require - access to historical commit points, then a read-write store will not - satisify since it will release the storage associated with deleted - records no later than the commit point. - - Only the WORM allows access to those historical commit points. This - places a RW store somewhat at odds with the rest of the bigdata - architecture since we presume that operations read based on a commit - time and that the commit time can be mapped onto a commit point. - - Regardless, a read-write store would use bit maps for allocations. - The handles to the bit maps could be stored in the root block addrs. - Deletes would be automatic for B+Tree nodes and leaves and in the - hands of the application for low-level record writes. - - Each allocation block would handle records in a certain size range. - E.g., LT 512, LT 1024, LT 4096, etc. The block sizes will tend to - be fairly large since records are nearly always B+Tree nodes or - leaves. (It may be possible to dynamically determine the best set - of block sizes). - - For a given block size, we probably need a chain of allocation - blocks. This is necessary to handle on the one handle widely - varying #s of allocations by block size and on the other to not - place a limit on how many allocations there may be of a given block - size. This also lets us keep down the size of the allocation block - and hence the amount of metadata that needs to be written on each - commit. - - The root block could just hold the addr of the allocation block - chains record. - - Is it possible to efficiently persist only the incremental change to - a bit vector? If the changes are from a specific offset on? - -============================================================ - - - Tune indices - - - The ids index should benefit from value compression since the - values are the serialized terms. This will require custom - code to break the values into symbols and then use huffman - encoding. Alternatively, simply treat each value as a symbol - and code from that (assuming that value reuse is common - if - not then at least URIs can be broken down into common - symbols). - - - The terms (term:id) index is on the order of 5x larger than - the ids (id:term) index. Presumably this is because updates - are distributed more or less randomly across the terms index - as new terms become defined but are strictly append only for - the ids index since new ids are always larger than old ids. - - - A larger branching factor may benefit the ids index. - - - A compacting merge of the terms index should greatly reduce - its size. - - - Splitting the terms2ids index will allocate more resources - and greater parallelism to that index. - - - Prefix compression may reduce the problem (it is enabled as - of 10/1/08). - - - Nearly ALL _read_ time between the SPO and TERMS index is - reading the TERMS index (99%). - - - Nearly ALL _write_ time between the SPO and the TERMS index - is writing the SPO index (99%). Statements are more likely - to be distinct than terms, so it makes sense that we write - on the statement index more often. However, note that this - is true even though the TERMS index is 3x larger than the - SPO index. - - - BTree - - - Modify to allow a purely transient BTree using ONLY hard - references. This variant does not require a backing store. - The parent and child references should be HARD - references. Deleted nodes and leaves will be GC'd once they are - evicted from the write retention queue. - - - Per-child locks : try using the childRef for this. Add - synchronized(node) to ensure that the childRef[i] is non-null - and then synchronized(childRef[i]) for the lock itself. - - - The RecordCompressor as utilized by the NodeSerializer is NOT - thread-safe as it relies on a single cbuf field. Either the - static buffer pool (if direct buffers are performant for this), - a heap buffer pool, dynamic heap allocations for - (de-)compression, or a serialized access to an instance per - NodeSerializer instance (and hence per BTree instance). - - - Change checksums to be at the store/record level. Interpret - the record length as having 2 additional bytes for read/write - of the checksum. Put it at the end of the record. - Enable/disable at the store level. - - Add an option for read-back validation of writes? - - Add an option for a fully synchronized raw store interface on - the Journal? - - - IAutoboxBTree - - - Write tests of the autobox API for BTree, FusedView, - ClientIndexView, and DataServiceIndex. - - - Should be able to instantiate a resource that is a BigdataMap - or BigdataSet, so perhaps make these classes extend - AbstractResource? Same for SparseRowStore? - - - Need [isNull] for ClientIndexView and DataServiceIndex impls - to reconstruct the object by allowing reconstruction of the - ITuple. - - Could modify the ResultBuffer to provide this additional - information as an option and specify an appropriate - constructor for the point test to get back that metadata. - - Really, should define crudTuple() methods and rework the - batch crud methods in terms of tuples. That is the general - framwork. Bit flags can be used to indicate that certain - information (keys, vals, etc). are not required for a given - op. (keys are always available on the client for these ops - so there is never a need to send them with the data: just - {val, isNull, isDeleted} and the option to read deleted - tuples. - - BigdataMap and BigdataSet will not scale-out until this issue - is resolved. - -============================================================ -Lock contention - -There are two places where we get a modest amount of lock contention, -based on -Djrockit.lockprofiling=true. - - - Node#getChild(int) - - This is the gateway for access to child nodes. It currently uses - double-checked locking to avoid synchronization when the desired - child is already available. If the child needs to be read from the - disk then the threads are synchronized in order to prevent - concurrent requests from reading the same record, deserializing the - node or leaf, and then entering different references for that node - or leaf into the childRefs[]. - - We could allow concurrent resolution of a child that is not in - memory if we used an AtomicReference[] and stored the weak - references in that and using an atomic operation to set the - reference iff it was not already set. This would require code - changes everywhere we use childRefs[] and it is a long shot that - this would improve performance at all. - - - DiskOnlyStrategy#reopenChannel(). Contention here arises when an - interrupt is recognized during an IO operation and the file channel - is closed. Readers will transparently re-open the channel, but - they all want to do so at once which causes contention for this - method. I don't see anyway to improve on this off hand. - -============================================================ -Sparse Row Store (SRS) - - - Extract IRowStore interface. - - - Optimize get(Schema,name) in SparseRowStore and - AtomicRowWriteRead. - - - AutoIncrement semantics: - - - You can't use an autoinc counter for a primary key. However, - this could be done if we use the maximum value for the auto-inc - counter to form the fromKey, which would direct the procedure to - the correct index partition. We would need to notice that the - property value was an auto-increment counter and the fromKey - would then have to be regenerated on the index partition. We - would then lookup the current value for that counter and write - its successor into the row store. - - The inability to use auto-inc for the primary key is really - quite limiting. - - - Since we have all these successor semantics, we should be able - to support auto-increment for more than just int and long. A - better way to form the successor is to pass along an - IAutoIncrement method and let it form the successor. That - allows all kinds of interesting patterns. - - - JSON API - - - Add a web application that let's people easily write on or read - from the sparse row store using JSON or the like. - - - It should be easy to view and modify the data in the global row - store, which is where locatable resources store their - configuration metadata. - - - The JSON API should be compatible to the extent possible with - HBASE and GAE. - - - This web application will have to be distributed in order to - eliminate bottlenecks. One approach is to re-direct HTTP - clients to an embedded web service co-located with the data - service on which the row resides. HTTP clients can continue to - address that server until they receive a redirect. - - - (On reflection, I have decided NOT to go this route.) Add a BLOB - reference column type. There are at least two design options for - this. I think that we should support at least (1) and (2). - - (1) the blocks are stored locally and hence are always - available from the same data service as the BLOB reference - column value - this might limit the maximum effective blob - size (in bytes) since the data will have to fit in the same - index partition and hence be co-located on a single host. - In fact, the blocks will be in the same index segment as - the column value once the journal overflows. One advantage - of this approach is the block updates can be atomic with - block metadata updates - a feature that is not otherwise - available without full transactions. - - (2) the blob reference includes the name of the scale-out index - on which the blocks for that blob are stored - in this - model the blocks can reside anywhere and splits of the - blocks will have no relevance to splits of the metadata. - This also makes it easier to locate the partitions of the - index containing the blocks on data services that are - specifically provisioned for large data blocks. - - (3) the blob reference contains the primary key for the blob - and the blob is stored either in the same index or in - another index. I am not sure that this variant adds value - over (1) and (2). - - - Refactor the BigdataRepository to use the BLOB reference type. - -============================================================ -Bigdata File System (BFS) - - - (***) Test failures remain for TestFileMetadataIndex. It seems as - if the logic was bad previously. If we delete the file Version - then how can we increment it and get a different answer? Maybe we - should delete the Id since that would leave the version alone? - No, that does not work since all property values will be - overwritten. How about either writing a "deleted" flag or doing - some fancy steps to find the most recent non-deleted version and - then increment that? - - Bug fix for create/delete/update interaction with Version counter - in the row store. - - - test_delete failure - - - test_createUpdate failure - - - handle overflow of blocks to the index segments during MOVE - - - provide streaming socket api on data service for reading blocks - (low level in the DiskOnlyStrategy - if in the write cache then - return directly else return buffered input stream reading on the - disk file and interrupt if journal is closed). - - - range delete - - - logical row scan for headers of documents in a key range. - - - Write test for forward and reverse scans starting at the fence - posts around a partition boundary. - -============================================================ -Map/Reduce demos (**) - - - Rework the map/reduce implementation to use local writes and - distributed gathers. - - - Download, prepare, extract. - - - Concurrent RDF data load as a map/reduce job. - - - Try jini federation using only the terms index to assign - consistent term identifiers, bulk loading into local SPO-only - indices, and then range partitioning the indices into global - SPO, POS, and OSP orders and bulk loading the global statement - indices. The data loader should be concurrent and a filter - should be applied such that each "host" loads only the files - that hash MOD N to that host. (note that only AddTerms and - AddIds go across the network API in this case.) - -============================================================ -Tune network IO - - - huffman encoding is appropriate for network IO, but hu-tucker is - not required since we have to decompress keys to get them - inserted into the btree. - - - tokenization needs to be specified for RDF Value types for the - purposes of compression. In fact, we are guarenteed that values - are NOT duplicated in a given batch so tokenization needs to - uncover common symbols. This is easy for URIs but less so for - literals and impossible for BNodes (which do not rea... [truncated message content] |
From: <tho...@us...> - 2010-07-27 13:19:53
|
Revision: 3304 http://bigdata.svn.sourceforge.net/bigdata/?rev=3304&view=rev Author: thompsonbry Date: 2010-07-27 13:16:22 +0000 (Tue, 27 Jul 2010) Log Message: ----------- Merged from trunk [r3284 through r3303]. Modified Paths: -------------- branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/util/config/NicUtil.java branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/java/com/bigdata/service/jini/util/LookupStarter.java branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/java/com/bigdata/service/jini/util/config/lookup.config branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/resources/config/bigdataStandaloneTesting.config branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/jini/start/testReggie.config branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/jini/start/testStartJini.config branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/zookeeper/testzoo.config branches/LEXICON_REFACTOR_BRANCH/src/resources/config/jini/reggie.config Property Changed: ---------------- branches/LEXICON_REFACTOR_BRANCH/ branches/LEXICON_REFACTOR_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/sparql/ branches/LEXICON_REFACTOR_BRANCH/dsi-utils/ branches/LEXICON_REFACTOR_BRANCH/dsi-utils/src/java/ branches/LEXICON_REFACTOR_BRANCH/src/resources/bin/config/ Property changes on: branches/LEXICON_REFACTOR_BRANCH ___________________________________________________________________ Modified: svn:mergeinfo - /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/bugfix-btm:2594-2779 /branches/dev-btm:2574-2730 /trunk:2633-2752,2761-2981,2983-3113 + /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/bugfix-btm:2594-3237 /branches/dev-btm:2574-2730 /branches/fko:3150-3194 /trunk:2633-2752,2761-2981,2983-3303 Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/util/config/NicUtil.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/util/config/NicUtil.java 2010-07-27 08:57:48 UTC (rev 3303) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/util/config/NicUtil.java 2010-07-27 13:16:22 UTC (rev 3304) @@ -507,54 +507,42 @@ /** * Special-purpose convenience method that returns a * <code>String</code> value representing the ip address of - * the current node; where the value that is returned is - * determined according to following criteria: + * the current node. * <p> - * <ul> - * <li> If a non-<code>null</code> value is input for the - * <code>systemPropertyName</code> parameter, then - * this is viewed as a declaration by the caller that - * that the system property with that given value - * should take precedence over all other means of - * determining the desired ip address. As such, this - * method determines if a system property having the - * given has indeed been set and, if it has, returns - * the ip address of the nic having that name; or - * <code>null</code> if there is no nic with the - * desired name installed on the node. - * <li> If a non-<code>null</code> value is input for the - * <code>systemPropertyName</code> parameter, but - * no system property with that name has been set, - * and <code>true</code> has been passed in for - * the <code>fallbackOk</code> parameter, then this - * method will return the IPV4 based address of the - * first reachable nic that is found on the node. - * Upon failing to find such an address, if the - * <code>loopbackOk</code> parameter is also - * <code>true</code>, then this method will return - * the <i>loop back</i> address of the node; otherwise - * <code>null</code> is returned. - * <li> If <code>null</code> is input for the - * <code>systemPropertyName</code> parameter, but - * a non-<code>null</code> value is input for the - * <code>defaultNic</code> parameter, then this - * method returns the ip address of the nic having - * that name; or <code>null</code> if there is no - * nic with the desired default name installed on the - * node. - * <li> If <code>null</code> is input for both the - * <code>systemPropertyName</code> parameter and the - * <code>defaultNic</code> parameter, and if the - * <code>fallbackOk</code> parameter is <code>true</code>, - * then this method will return the IPV4 based address - * of the first reachable nic that is found on the node. - * Upon failing to find such an address, if the - * <code>loopbackOk</code> parameter is also - * <code>true</code>, then this method will return - * the <i>loop back</i> address of the node; otherwise - * <code>null</code> is returned. - * </ul> + * If a non-<code>null</code> value is input for the + * <code>systemPropertyName</code> parameter, then this + * method first determines if a system property with + * name equivalent to the given value has been set and, + * if it has, returns the ip address of the nic whose name + * is equivalent to that system property value; or + * <code>null</code> if there is no nic with the desired + * name installed on the node. * <p> + * If there is no system property whose name is the value + * of the <code>systemPropertyName</code> parameter, and + * if the value "default" is input for the + * <code>defaultNic</code> parameter, then this method + * will return the IPV4 based address of the first reachable + * nic that can be found on the node; otherwise, if a + * non-<code>null</code> value not equal to "default" is + * input for the the <code>defaultNic</code> parameter, + * then this method returns the ip address of the nic + * corresponding to that given name; or <code>null</code> + * if there is no such nic name installed on the node. + * <p> + * If, on the other hand, <code>null</code> is input for + * the <code>systemPropertyName</code> parameter, then + * this method will attempt to find the desired ip address + * using only the value of the <code>defaultNic</code>, + * and applying the same search criteria as described + * above. + * <p> + * Note that in all cases, if <code>true</code> is input + * for the <code>loopOk</code> parameter, then upon failing + * to find a valid ip address using the specified search + * mechanism, this method will return the <i>loop back</i> + * address; otherwise, <code>null</code> is returned. + * <p> * This method can be called from within a configuration * as well as from within program control. * @@ -568,33 +556,24 @@ * the name of the network interface * whose ip address should be returned * if <code>null</code> is input for the + * <code>systemPropertyName</code> parameter, + * or if there is no system property with + * name equivalent the value of the * <code>systemPropertyName</code> parameter. * - * @param fallbackOk if <code>true</code>, then if either - * no system property is set having the - * name referenced by the - * <code>systemPropertyName</code> parameter, - * or if <code>null</code> is input for both - * the <code>systemPropertyName</code> - * parameter and the <code>defaultNic</code> - * parameter, return the IPV4 based address - * of the first reachable network interface - * that can be found on the node. + * @param loopbackOk if <code>true</code>, then return the + * <i>loop back</i> address upon failure + * to find a valid ip address using the + * search criteria specified through the + * <code>systemPropertyName</code> and + * <code>defaultNic</code> parameters. * - * @param loopbackOk if <code>true</code>, and if <code>true</code> - * is also input for the <code>fallbackOk</code> - * parameter, then if this method attempts, - * but fails, to find a valid IPV4 fallback - * address, then the node's <i>loop back</i> - * address is returned. - * * @return a <code>String</code> representing an ip address associated * with the current node; where the value that is returned is * determined according to the criteria described above. */ public static String getIpAddress(String systemPropertyName, String defaultNic, - boolean fallbackOk, boolean loopbackOk) throws SocketException, IOException { @@ -613,32 +592,30 @@ } if(propSet) { return getIpAddress(nicName, 0, loopbackOk); - } else {//desired system property not set, try fallback - if(fallbackOk) { - return getDefaultIpv4Address(loopbackOk); + } else {//system property not set, try default and/or fallback + if(defaultNic != null) { + if( defaultNic.equals("default") ) { + return getDefaultIpv4Address(loopbackOk); + } else { + return getIpAddress(defaultNic, 0, loopbackOk); + } } else { return null; } } - } else {//no system property name provided, try default nic + } else {//no system property name provided, try default if(defaultNic != null) { - return getIpAddress(defaultNic, 0, loopbackOk); - } else {//no default nic provided, try fallback - if(fallbackOk) { + if( defaultNic.equals("default") ) { return getDefaultIpv4Address(loopbackOk); } else { - return null; + return getIpAddress(defaultNic, 0, loopbackOk); } + } else { + return getIpAddress(null, loopbackOk); } } } - public static String getIpAddress() - throws SocketException, IOException - { - return getIpAddress(null, null, true, true); - } - /** * Examines each address associated with each network interface * card (nic) installed on the current node, and returns the Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/java/com/bigdata/service/jini/util/LookupStarter.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/java/com/bigdata/service/jini/util/LookupStarter.java 2010-07-27 08:57:48 UTC (rev 3303) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/java/com/bigdata/service/jini/util/LookupStarter.java 2010-07-27 13:16:22 UTC (rev 3304) @@ -74,8 +74,7 @@ private static String defaultGroup = null; static { try { - thisHost = NicUtil.getIpAddress - ("default.nic", null, true, true); + thisHost = NicUtil.getIpAddress("default.nic", "default", true); defaultGroup = System.getProperty("bigdata.fedname", "bigdata.test.group-"+thisHost); Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/java/com/bigdata/service/jini/util/config/lookup.config =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/java/com/bigdata/service/jini/util/config/lookup.config 2010-07-27 08:57:48 UTC (rev 3303) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/java/com/bigdata/service/jini/util/config/lookup.config 2010-07-27 13:16:22 UTC (rev 3304) @@ -10,7 +10,7 @@ com.sun.jini.reggie { private static exportPort = 0;//randomly chosen port private static exportIpAddr = - NicUtil.getIpAddress("default.nic", null, true, true); + NicUtil.getIpAddress("default.nic", "default", true); private static codebasePort = 23333;//value used if not set by system prop // Public configuration entries Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/resources/config/bigdataStandaloneTesting.config =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/resources/config/bigdataStandaloneTesting.config 2010-07-27 08:57:48 UTC (rev 3303) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/resources/config/bigdataStandaloneTesting.config 2010-07-27 13:16:22 UTC (rev 3304) @@ -77,7 +77,7 @@ static serviceDir = ConfigMath.getAbsoluteFile(new File(fedname)); private static localIpAddr = - NicUtil.getIpAddress("default.nic", null, true, true); + NicUtil.getIpAddress("default.nic", "default", true); /* * Example cluster configuration. Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/jini/start/testReggie.config =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/jini/start/testReggie.config 2010-07-27 08:57:48 UTC (rev 3303) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/jini/start/testReggie.config 2010-07-27 13:16:22 UTC (rev 3304) @@ -15,7 +15,7 @@ com.sun.jini.reggie { private static exportIpAddr = - NicUtil.getIpAddress("default.nic", null, true, true); + NicUtil.getIpAddress("default.nic", "default", true); private static exportPort = Integer.parseInt("0"); private static serverILFactory = Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/jini/start/testStartJini.config =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/jini/start/testStartJini.config 2010-07-27 08:57:48 UTC (rev 3303) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/jini/start/testStartJini.config 2010-07-27 13:16:22 UTC (rev 3304) @@ -15,7 +15,7 @@ private static appHome = System.getProperty("app.home", ConfigMath.getAbsolutePath(new File(".")) ); private static codebaseHost = - NicUtil.getIpAddress("default.nic", null, true, true); + NicUtil.getIpAddress("default.nic", "default", true); private static codebasePort = "23334"; private static defaultCodebaseRootDir = ConfigUtil.concat( new String[] { appHome, "${/}bigdata-jini${/}lib${/}jini${/}lib-dl" } ); Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/zookeeper/testzoo.config =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/zookeeper/testzoo.config 2010-07-27 08:57:48 UTC (rev 3303) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-jini/src/test/com/bigdata/zookeeper/testzoo.config 2010-07-27 13:16:22 UTC (rev 3304) @@ -34,7 +34,7 @@ private static appHome = System.getProperty("app.home", ConfigMath.getAbsolutePath(new File(".")) ); private static localIpAddr = - NicUtil.getIpAddress("default.nic", null, true, true); + NicUtil.getIpAddress("default.nic", "default", true); /* A comma delimited list of the known zookeeper servers together * with their assigned "myid". Property changes on: branches/LEXICON_REFACTOR_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/sparql ___________________________________________________________________ Modified: svn:mergeinfo - /branches/fko/bigdata-sails/src/java/com/bigdata/rdf/sail/sparql:3150-3194 /trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/sparql:2761-2981,2983-3284 + /branches/fko/bigdata-sails/src/java/com/bigdata/rdf/sail/sparql:3150-3194 /trunk/bigdata-sails/src/java/com/bigdata/rdf/sail/sparql:2761-2981,2983-3303 Property changes on: branches/LEXICON_REFACTOR_BRANCH/dsi-utils ___________________________________________________________________ Modified: svn:mergeinfo - /branches/fko/dsi-utils:3150-3194 + /branches/fko/dsi-utils:3150-3194 /trunk/dsi-utils:3285-3303 Property changes on: branches/LEXICON_REFACTOR_BRANCH/dsi-utils/src/java ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/dsi-utils/src/java:2761-2981,2983-3113 + /trunk/dsi-utils/src/java:2761-2981,2983-3113,3285-3303 Property changes on: branches/LEXICON_REFACTOR_BRANCH/src/resources/bin/config ___________________________________________________________________ Modified: svn:mergeinfo - /branches/fko/src/resources/bin/config:3150-3194 + /branches/fko/src/resources/bin/config:3150-3194 /trunk/src/resources/bin/config:3285-3303 Modified: branches/LEXICON_REFACTOR_BRANCH/src/resources/config/jini/reggie.config =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/src/resources/config/jini/reggie.config 2010-07-27 08:57:48 UTC (rev 3303) +++ branches/LEXICON_REFACTOR_BRANCH/src/resources/config/jini/reggie.config 2010-07-27 13:16:22 UTC (rev 3304) @@ -14,7 +14,8 @@ com.sun.jini.reggie { - private static exportIpAddr = NicUtil.getIpAddress(null, null, true, true); + private static exportIpAddr = + NicUtil.getIpAddress("default.nic", "default", false); private static exportPort = Integer.parseInt( System.getProperty("exportPort", "0") ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2010-07-27 08:57:54
|
Revision: 3303 http://bigdata.svn.sourceforge.net/bigdata/?rev=3303&view=rev Author: martyncutcher Date: 2010-07-27 08:57:48 +0000 (Tue, 27 Jul 2010) Log Message: ----------- It seems that we have finally solved the problem of representing the value of zero with the sign byte. This finesses all the problems of special case precision and scale that seemed so complicated. Modified Paths: -------------- branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/btree/keys/KeyBuilder.java branches/LEXICON_REFACTOR_BRANCH/bigdata/src/test/com/bigdata/btree/keys/TestKeyBuilder.java Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/btree/keys/KeyBuilder.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/btree/keys/KeyBuilder.java 2010-07-26 21:58:56 UTC (rev 3302) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/btree/keys/KeyBuilder.java 2010-07-27 08:57:48 UTC (rev 3303) @@ -1000,21 +1000,19 @@ public KeyBuilder append(final BigDecimal d) { final int sign = d.signum(); + if (sign == 0) { + append((byte) 0); + + return this; + } + BigDecimal nd = d.stripTrailingZeros(); String unscaledStr = nd.unscaledValue().toString(); - final int precision; - final int scale; + final int precision = nd.precision(); + final int scale = nd.scale(); - if ("0".equals(unscaledStr)) { - precision = 1; - scale = Integer.MAX_VALUE; - } else { - precision = nd.precision(); - scale = nd.scale(); - } - int exponent = precision - scale; if (sign == -1) { exponent = -exponent; @@ -1046,18 +1044,25 @@ */ static public int byteLength(final BigDecimal value) { - // FIXME Make sure to normalize trailing zeros first if necessary. - final int dataLen = value.unscaledValue().toString().length(); + final int byteLength; - final int byteLength = + if (value.signum() == 0) { + byteLength = 1; + } else { + final BigDecimal nbd = value.stripTrailingZeros(); + + final int dataLen = nbd.unscaledValue().toString().length(); + + byteLength = + 1 /* sign */ + 4 /* exponent */ + dataLen /* data */ + 1 /* termination byte */ ; - + } + return byteLength; - + } /* @@ -1522,6 +1527,11 @@ static public BigDecimal decodeBigDecimal(final int offset, final byte[] key) { int curs = offset; final byte sign = key[curs++]; + + if (sign == decodeZero) { + return new BigDecimal(0); + } + int exponent = decodeInt(key, curs); final boolean neg = sign == negSign; if (neg) { @@ -1538,14 +1548,15 @@ final BigInteger unscaled = new BigInteger(unscaledStr); final int precision = len; - final int scale = precision - exponent - (neg ? 1 : 0); + final int scale = precision - exponent - (neg ? 1 : 0); final BigDecimal ret = new BigDecimal(unscaled, scale); return ret; // relative scale adjustment } - private static final byte eos = decodeByte(0); + private static final byte decodeZero = decodeByte(0); + private static final byte eos = decodeZero; private static final byte eos2 = decodeByte(Byte.MAX_VALUE); private static final byte negSign = decodeByte(-1); Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata/src/test/com/bigdata/btree/keys/TestKeyBuilder.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata/src/test/com/bigdata/btree/keys/TestKeyBuilder.java 2010-07-26 21:58:56 UTC (rev 3302) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata/src/test/com/bigdata/btree/keys/TestKeyBuilder.java 2010-07-27 08:57:48 UTC (rev 3303) @@ -1789,18 +1789,19 @@ final BigDecimal m500 = new BigDecimal("00500"); final BigDecimal m5003 = new BigDecimal("500.000"); - doLTTest(z1, p1); - doLTTest(negp1, z1); - doLTTest(negp1, p1); - doEQTest(z1, negz1); - doEncodeDecodeTest(m5); + doEncodeDecodeTest(negz1); doEncodeDecodeTest(z1); doEncodeDecodeTest(z2); doEncodeDecodeTest(z3); doEncodeDecodeTest(m1); doEncodeDecodeTest(m2); + doLTTest(z1, p1); + doLTTest(negp1, z1); + doLTTest(negp1, p1); + doEQTest(z1, negz1); + doEQTest(m5, m53); doEQTest(m500, m5003); doEQTest(z3, z2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2010-07-26 21:59:05
|
Revision: 3302 http://bigdata.svn.sourceforge.net/bigdata/?rev=3302&view=rev Author: mrpersonick Date: 2010-07-26 21:58:56 +0000 (Mon, 26 Jul 2010) Log Message: ----------- added user flag to SPO (metadata graphs) for CSI Modified Paths: -------------- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BNodeContextFactory.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataStatementImpl.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactory.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/StatementEnum.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/ISPO.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPO.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOIndexWriteProc.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOTupleSerializer.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/store/AbstractTripleStore.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataStatementIteratorImpl.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPO.java Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BNodeContextFactory.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BNodeContextFactory.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BNodeContextFactory.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -138,9 +138,14 @@ public BigdataStatement createStatement(Resource s, URI p, Value o, Resource c, StatementEnum type) { - return valueFactory.createStatement(s, p, o, c, type); + return valueFactory.createStatement(s, p, o, c, type, false); } - + + public BigdataStatement createStatement(Resource s, URI p, Value o, + Resource c, StatementEnum type, boolean userFlag) { + return valueFactory.createStatement(s, p, o, c, type, userFlag); + } + public BigdataURI createURI(String namespace, String localName) { return valueFactory.createURI(namespace, localName); } Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataStatementImpl.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataStatementImpl.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataStatementImpl.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -64,6 +64,7 @@ protected final BigdataValue o; protected final BigdataResource c; private StatementEnum type; + private boolean userFlag; private transient boolean override = false; private transient boolean modified = false; @@ -72,7 +73,8 @@ */ public BigdataStatementImpl(final BigdataResource subject, final BigdataURI predicate, final BigdataValue object, - final BigdataResource context, final StatementEnum type) { + final BigdataResource context, final StatementEnum type, + final boolean userFlag) { if (subject == null) throw new IllegalArgumentException(); @@ -97,6 +99,8 @@ this.type = type; + this.userFlag=userFlag; + } final public BigdataResource getSubject() { @@ -152,6 +156,12 @@ this.type = type; } + + final public void setUserFlag(boolean userFlag) { + + this.userFlag = userFlag; + + } final public boolean isAxiom() { @@ -170,6 +180,12 @@ return StatementEnum.Explicit == type; } + + final public boolean getUserFlag() { + + return userFlag; + + } public boolean equals(final Object o) { @@ -320,8 +336,8 @@ public byte[] serializeValue(final ByteArrayBuffer buf) { - return SPO.serializeValue(buf, override, type, c != null ? c - .getIV() : null); + return SPO.serializeValue(buf, override, userFlag, type, + c != null ? c.getIV() : null); } Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactory.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactory.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactory.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -137,6 +137,29 @@ Resource c, StatementEnum type); /** + * Create a statement (core impl). The s,p,o, and the optional c arguments + * will be normalized to this {@link BigdataValueFactory} using + * {@link #asValue(Value)}. + * + * @param s + * The subject. + * @param p + * The predicate. + * @param o + * The object. + * @param c + * The context (optional). Note: When non-<code>null</code> + * and statement identifiers are enabled, then this will be a + * blank node whose term identifier is the statement identifier. + * @param type + * The statement type (optional). + * @param userFlag + * The user flag + */ + BigdataStatement createStatement(Resource s, URI p, Value o, + Resource c, StatementEnum type, boolean userFlag); + + /** * Converts a {@link Value} into a {@link BigdataValue}. If the value is * already a {@link BigdataValue} and it was allocated by <i>this</i> * {@link BigdataValueFactoryImpl} then it is returned unchanged. Otherwise a Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -323,13 +323,21 @@ public BigdataStatementImpl createStatement(Resource s, URI p, Value o, Resource c, StatementEnum type) { + + return createStatement(s, p, o, c, type, false/* userFlag */); + + } + public BigdataStatementImpl createStatement(Resource s, URI p, Value o, + Resource c, StatementEnum type, final boolean userFlag) { + return new BigdataStatementImpl(// (BigdataResource) asValue(s),// (BigdataURI) asValue(p),// (BigdataValue) asValue(o),// (BigdataResource) asValue(c),// optional - type // the statement type (optional). + type, // the statement type (optional). + userFlag // the user flag (optional) ); } Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/StatementEnum.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/StatementEnum.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/StatementEnum.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -48,12 +48,8 @@ * A statement that was inferred from the explicit statements by the * appropriate model theory. */ - Inferred((byte) 2), - /** - * For debugging. - */ - Backchained((byte) 4); - + Inferred((byte) 2); + private final byte code; private StatementEnum(final byte code) { @@ -105,7 +101,7 @@ */ static public StatementEnum decode(final byte b) { - switch (b & ~MASK_OVERRIDE) { + switch (b & ~MASK_OVERRIDE & ~MASK_USER_FLAG) { case 0: return Explicit; @@ -113,8 +109,6 @@ case 2: return Inferred; - case 4: return Backchained; - default: throw new RuntimeException("Unexpected byte: " + b); @@ -164,6 +158,23 @@ public static final int MASK_OVERRIDE = 0x1 << 3; /** + * A user bit mask used by applications to flag statements + */ + public static final int MASK_USER_FLAG = 0x1 << 2; + + /** + * Return <code>true</code> iff the user bit is set. + * + * @param b + * The byte. + */ + public static boolean isUserFlag(final byte b) { + + return (b & StatementEnum.MASK_USER_FLAG) != 0; + + } + + /** * Return <code>true</code> iff the override bit is set. * * @param b Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/ISPO.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/ISPO.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/ISPO.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -155,6 +155,17 @@ boolean isExplicit(); /** + * Return <code>true</code> IFF the {@link SPO} user flag is set + */ + boolean getUserFlag(); + + /** + * Set {@link SPO} user flag + * @param userFlag + */ + void setUserFlag(boolean userFlag); + + /** * Return <code>true</code> IFF the {@link SPO} is marked as * {@link StatementEnum#Inferred}. */ Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPO.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPO.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPO.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -77,8 +77,13 @@ * Statement type (inferred, explicit, or axiom). */ private StatementEnum type; - + /** + * User flag + */ + private boolean userFlag; + + /** * Override flag used for downgrading statements during truth maintenance. */ private transient boolean override = false; @@ -405,6 +410,8 @@ final StatementEnum type = StatementEnum.decode(code); spo.setStatementType(type); + + spo.setUserFlag(StatementEnum.isUserFlag(code)); if (val.length == 1 + 8) { @@ -431,7 +438,7 @@ public byte[] serializeValue(final ByteArrayBuffer buf) { - return serializeValue(buf, isOverride(), type, c); + return serializeValue(buf, isOverride(),getUserFlag(), type, c); } @@ -463,14 +470,17 @@ * {@link SPO}. */ static public byte[] serializeValue(final ByteArrayBuffer buf, - final boolean override, final StatementEnum type, final IV c) { + final boolean override, final boolean userFlag, + final StatementEnum type, final IV c) { buf.reset(); // optionally set the override bit on the value. - final byte b = (byte) (override ? (type.code() | StatementEnum.MASK_OVERRIDE) - : type.code()); - + final byte b = (byte) + (type.code() + | (override ? StatementEnum.MASK_OVERRIDE : 0x0) + | (userFlag ? StatementEnum.MASK_USER_FLAG : 0x0)); + buf.putByte(b); if (type == StatementEnum.Explicit @@ -511,6 +521,26 @@ } + /** + * Return <code>true</code> IFF the {@link SPO} has the user flag bit set. + */ + public final boolean getUserFlag() { + + return userFlag; + + } + + /** + * Set the user flag bit on this SPO. + * + * @parm userFlag boolean flag + */ + public final void setUserFlag(final boolean userFlag) { + + this.userFlag=userFlag; + + } + private int hashCode = 0; /** @@ -627,7 +657,6 @@ case Explicit : t = "Explicit "; break; case Inferred : t = "Inferred "; break; case Axiom : t = "Axiom "; break; - case Backchained : t = "Backchained "; break; default: throw new AssertionError(); } } else { Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOIndexWriteProc.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOIndexWriteProc.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOIndexWriteProc.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -211,6 +211,8 @@ // figure out if the override bit is set. final boolean override = StatementEnum.isOverride(val[0]); + final boolean userFlag = StatementEnum.isUserFlag(val[0]); + /* * Decode the new (proposed) statement type (override bit is * masked off). @@ -242,7 +244,7 @@ * Statement is NOT pre-existing. */ - ndx.insert(key, SPO.serializeValue(tmp, false/* override */, + ndx.insert(key, SPO.serializeValue(tmp, false/* override */,userFlag, newType, new_sid/* MAY be NULL */)); if (isPrimaryIndex && DEBUG) { @@ -278,7 +280,7 @@ // Note: No statement identifier since statement is not // explicit. ndx.insert(key, SPO.serializeValue(tmp, - false/* override */, newType, null/* sid */)); + false/* override */,userFlag, newType, null/* sid */)); if (isPrimaryIndex && DEBUG) { log.debug("Downgrading SPO: key=" @@ -323,7 +325,7 @@ } ndx.insert(key, SPO.serializeValue(tmp, - false/* override */, maxType, sid)); + false/* override */,userFlag, maxType, sid)); if (isPrimaryIndex && DEBUG) { log.debug("Changing statement type: key=" Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOTupleSerializer.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOTupleSerializer.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/spo/SPOTupleSerializer.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -155,6 +155,8 @@ final StatementEnum type = StatementEnum.decode(vbuf.array()[0]); spo.setStatementType(type); + + spo.setUserFlag(StatementEnum.isUserFlag(vbuf.array()[0])); if (vbuf.limit() == 1 + 8) { @@ -256,9 +258,9 @@ final StatementEnum type = spo.getStatementType(); // optionally set the override bit on the value. - final byte b = (byte) (spo.isOverride() ? (type.code() | StatementEnum.MASK_OVERRIDE) + byte b = (byte) (spo.isOverride() ? (type.code() | StatementEnum.MASK_OVERRIDE) : type.code()); - + b=(byte)(spo.getUserFlag()?b|StatementEnum.MASK_USER_FLAG:b); buf.putByte(b); if (keyOrder.getKeyArity() == 3) { Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/store/AbstractTripleStore.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/store/AbstractTripleStore.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/store/AbstractTripleStore.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -2279,8 +2279,8 @@ (BigdataURI) terms.get(spo.p()),// (BigdataValue) terms.get(spo.o()),// (BigdataResource) (c != null ? terms.get(c) : null),// - spo.getStatementType()// - ); + spo.getStatementType(),// + spo.getUserFlag()); } Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataStatementIteratorImpl.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataStatementIteratorImpl.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/store/BigdataStatementIteratorImpl.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -210,13 +210,13 @@ if (spo.hasStatementType() == false) { log.error("statement with no type: " - + valueFactory.createStatement(s, p, o, c, null)); + + valueFactory.createStatement(s, p, o, c, null, spo.getUserFlag())); } // the statement. final BigdataStatement stmt = valueFactory.createStatement(s, p, o, - c, spo.getStatementType()); + c, spo.getStatementType(), spo.getUserFlag()); // save the reference. stmts[i++] = stmt; Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPO.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPO.java 2010-07-26 20:17:12 UTC (rev 3301) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/spo/TestSPO.java 2010-07-26 21:58:56 UTC (rev 3302) @@ -103,23 +103,18 @@ // test w/o override flag. boolean override = false; + boolean userFlag=false; for (StatementEnum type : StatementEnum.values()) { - if (type == StatementEnum.Backchained) { - - // skip this - it is not a real statement type. - continue; - - } - final byte[] val = SPO.serializeValue(new ByteArrayBuffer(), - override, type, c); + override,userFlag, type, c); final byte b = val[0]; assertEquals(type, StatementEnum.decode(b)); assertEquals(override, StatementEnum.isOverride(b)); + assertEquals(userFlag, StatementEnum.isUserFlag(b)); final IV iv = new TermId(VTE.URI, 0); @@ -128,6 +123,7 @@ // Should have (en|de)coded [c] as as statement identifier. assertEquals(9, val.length); assertEquals(c, SPO.decodeValue(new SPO(iv, iv, iv), val).c()); + assertEquals(userFlag,SPO.decodeValue(new SPO(iv, iv, iv), val).getUserFlag()); } else { // Should not have (en|de)coded a statement identifier. assertEquals(1, val.length); @@ -141,28 +137,85 @@ override = true; for (StatementEnum type : StatementEnum.values()) { - if (type == StatementEnum.Backchained) { + final byte[] val = SPO.serializeValue(new ByteArrayBuffer(), + override, userFlag, type, c); - // skip this - it is not a real statement type. - continue; - + final byte b = val[0]; + + assertEquals(type, StatementEnum.decode(b)); + + assertEquals(override, StatementEnum.isOverride(b)); + assertEquals(userFlag, StatementEnum.isUserFlag(b)); + + final IV iv = new TermId(VTE.URI, 0); + + if (type == StatementEnum.Explicit) { + // Should have (en|de)coded [c] as as statement identifier. + assertEquals(9, val.length); + assertEquals(c, SPO.decodeValue(new SPO(iv, iv, iv), val).c()); + assertEquals(userFlag,SPO.decodeValue(new SPO(iv, iv, iv), val).getUserFlag()); + } else { + // Should not have (en|de)coded a statement identifier. + assertEquals(1, val.length); + assertEquals(null, SPO.decodeValue( + new SPO(iv, iv, iv), val).c()); } + } + + // test w/o override flag && w userFlag + override = false; + userFlag=true; + for (StatementEnum type : StatementEnum.values()) { + final byte[] val = SPO.serializeValue(new ByteArrayBuffer(), - override, type, c); + override, userFlag, type, c); final byte b = val[0]; assertEquals(type, StatementEnum.decode(b)); + + assertEquals(override, StatementEnum.isOverride(b)); + assertEquals(userFlag, StatementEnum.isUserFlag(b)); + final IV iv = new TermId(VTE.URI, 0); + + if (type == StatementEnum.Explicit + && c.isStatement()) { + // Should have (en|de)coded [c] as as statement identifier. + assertEquals(9, val.length); + assertEquals(c, SPO.decodeValue(new SPO(iv, iv, iv), val).c()); + assertEquals(userFlag,SPO.decodeValue(new SPO(iv, iv, iv), val).getUserFlag()); + } else { + // Should not have (en|de)coded a statement identifier. + assertEquals(1, val.length); + assertEquals(null, SPO.decodeValue( + new SPO(iv, iv, iv), val).c()); + } + + } + + // test w/ override flag && w userFlag + override = true; + for (StatementEnum type : StatementEnum.values()) { + + final byte[] val = SPO.serializeValue(new ByteArrayBuffer(), + override, userFlag, type, c); + + final byte b = val[0]; + + assertEquals(type, StatementEnum.decode(b)); + assertEquals(override, StatementEnum.isOverride(b)); - + assertEquals(userFlag, StatementEnum.isUserFlag(b)); + final IV iv = new TermId(VTE.URI, 0); if (type == StatementEnum.Explicit) { // Should have (en|de)coded [c] as as statement identifier. assertEquals(9, val.length); assertEquals(c, SPO.decodeValue(new SPO(iv, iv, iv), val).c()); + assertEquals(userFlag, SPO.decodeValue(new SPO(iv, iv, iv), val).getUserFlag()); } else { // Should not have (en|de)coded a statement identifier. assertEquals(1, val.length); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2010-07-26 20:17:18
|
Revision: 3301 http://bigdata.svn.sourceforge.net/bigdata/?rev=3301&view=rev Author: mrpersonick Date: 2010-07-26 20:17:12 +0000 (Mon, 26 Jul 2010) Log Message: ----------- moved sample extensions from src/samples to src/test Added Paths: ----------- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/ColorsEnumExtension.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/EpochExtension.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/SampleExtensionFactory.java Removed Paths: ------------- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/ColorsEnumExtension.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/EpochExtension.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/SampleExtensionFactory.java Deleted: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/ColorsEnumExtension.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/ColorsEnumExtension.java 2010-07-26 20:16:27 UTC (rev 3300) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/ColorsEnumExtension.java 2010-07-26 20:17:12 UTC (rev 3301) @@ -1,169 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -package com.bigdata.rdf.internal; - -import org.openrdf.model.Literal; -import org.openrdf.model.URI; -import org.openrdf.model.Value; -import org.openrdf.model.impl.URIImpl; -import com.bigdata.rdf.model.BigdataURI; -import com.bigdata.rdf.model.BigdataValue; -import com.bigdata.rdf.model.BigdataValueFactory; -import com.bigdata.rdf.store.BD; - -/** - * Example of how to do a custom enum and map that enum over a byte using a - * native inline {@link XSDByteIV}. - */ -public class ColorsEnumExtension<V extends BigdataValue> implements IExtension<V> { - - /** - * The datatype URI for the colors enum extension. - */ - public transient static final URI COLOR = new URIImpl(BD.NAMESPACE + "Color"); - - private BigdataURI color; - - public ColorsEnumExtension() { - - } - - public void resolveDatatype(final IDatatypeURIResolver resolver) { - - this.color = resolver.resolve(COLOR); - - } - - public BigdataURI getDatatype() { - - return color; - - } - - /** - * Attempts to convert the supplied RDF value into a colors enum - * representation. Tests for a literal value with the correct datatype - * that can be converted to one of the colors in the {@link Color} enum - * based on the string value of the literal's label. Each {@link Color} - * in the enum maps to a particular byte. This byte is encoded in a - * delegate {@link XSDByteIV}, and an {@link ExtensionIV} is returned that - * wraps the native type. - */ - public ExtensionIV createIV(final Value value) { - - if (value instanceof Literal == false) - throw new IllegalArgumentException(); - - final Literal l = (Literal) value; - - if (l.getDatatype() == null || !color.equals(l.getDatatype())) - throw new IllegalArgumentException(); - - final String s = value.stringValue(); - - final Color c = Enum.valueOf(Color.class, s); - - // not a valid color - if (c == null) - return null; - - final AbstractLiteralIV delegate = new XSDByteIV(c.getByte()); - - return new ExtensionIV(delegate, (TermId) getDatatype().getIV()); - - } - - /** - * Attempt to convert the {@link AbstractLiteralIV#byteValue()} back into - * a {@link Color}, and then use the string value of the {@link Color} to - * create an RDF literal. - */ - public V asValue(final ExtensionIV iv, final BigdataValueFactory vf) { - - final byte b = iv.getDelegate().byteValue(); - - final Color c = Color.valueOf(b); - - if (c == null) - throw new RuntimeException("bad color got encoded somehow"); - - return (V) vf.createLiteral(c.toString(), color); - - } - - /** - * Simple demonstration enum for some common colors. Can fit up to 256 enum - * values into an enum projected onto a byte. - */ - public enum Color { - - Red((byte) 0), - Blue((byte) 1), - Green((byte) 2), - Yellow((byte) 3), - Orange((byte) 4), - Purple((byte) 5), - Black((byte) 6), - White((byte) 7), - Brown((byte) 8); - - private Color(final byte b) { - this.b = b; - } - - static final public Color valueOf(final byte b) { - switch (b) { - case 0: - return Red; - case 1: - return Blue; - case 2: - return Green; - case 3: - return Yellow; - case 4: - return Orange; - case 5: - return Purple; - case 6: - return Black; - case 7: - return White; - case 8: - return Brown; - default: - throw new IllegalArgumentException(Byte.toString(b)); - } - } - - private final byte b; - - public byte getByte() { - return b; - } - - } - -} Deleted: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/EpochExtension.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/EpochExtension.java 2010-07-26 20:16:27 UTC (rev 3300) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/EpochExtension.java 2010-07-26 20:17:12 UTC (rev 3301) @@ -1,110 +0,0 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -package com.bigdata.rdf.internal; - -import org.openrdf.model.Literal; -import org.openrdf.model.URI; -import org.openrdf.model.Value; -import org.openrdf.model.datatypes.XMLDatatypeUtil; -import org.openrdf.model.impl.URIImpl; -import com.bigdata.rdf.model.BigdataURI; -import com.bigdata.rdf.model.BigdataValue; -import com.bigdata.rdf.model.BigdataValueFactory; -import com.bigdata.rdf.store.BD; - -/** - * This implementation of {@link IExtension} implements inlining for literals - * that represent time in milliseconds since the epoch. The milliseconds are - * encoded as an inline long. - */ -public class EpochExtension<V extends BigdataValue> implements IExtension<V> { - - /** - * The datatype URI for the epoch extension. - */ - public transient static final URI EPOCH = new URIImpl(BD.NAMESPACE + "Epoch"); - - private BigdataURI epoch; - - public EpochExtension() { - } - - public void resolveDatatype(final IDatatypeURIResolver resolver) { - - this.epoch = resolver.resolve(EPOCH); - - } - - public BigdataURI getDatatype() { - - return epoch; - - } - - /** - * Attempts to convert the supplied value into an epoch representation. - * Tests for a literal value with the correct datatype that can be converted - * to a positive long integer. Encodes the long in a delegate - * {@link XSDLongIV}, and returns an {@link ExtensionIV} to wrap the native - * type. - */ - public ExtensionIV createIV(final Value value) { - - if (value instanceof Literal == false) - throw new IllegalArgumentException(); - - final Literal lit = (Literal) value; - - final URI dt = lit.getDatatype(); - - if (dt == null || !EPOCH.stringValue().equals(dt.stringValue())) - throw new IllegalArgumentException(); - - final String s = value.stringValue(); - - final long l = XMLDatatypeUtil.parseLong(s); - - // can't have negative epoch values - if (l < 0) - return null; - - final AbstractLiteralIV delegate = new XSDLongIV(l); - - return new ExtensionIV(delegate, (TermId) getDatatype().getIV()); - - } - - /** - * Use the string value of the {@link ExtensionIV} (which defers to the - * string value of the native type) to create a literal with the epoch - * datatype. - */ - public V asValue(final ExtensionIV iv, final BigdataValueFactory vf) { - - return (V) vf.createLiteral(iv.stringValue(), epoch); - - } - -} Deleted: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/SampleExtensionFactory.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/SampleExtensionFactory.java 2010-07-26 20:16:27 UTC (rev 3300) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/SampleExtensionFactory.java 2010-07-26 20:17:12 UTC (rev 3301) @@ -1,35 +0,0 @@ -package com.bigdata.rdf.internal; - -/** - * Simple {@link IExtensionFactory} implementation that creates two - * {@link IExtension}s - the {@link EpochExtension} and the - * {@link ColorsEnumExtension}. - */ -public class SampleExtensionFactory implements IExtensionFactory { - - private final IExtension[] extensions; - - public SampleExtensionFactory() { - - extensions = new IExtension[] { - new EpochExtension(), - new ColorsEnumExtension() - }; - - } - - public void resolveDatatypes(final IDatatypeURIResolver resolver) { - - for (IExtension extension : extensions) { - extension.resolveDatatype(resolver); - } - - } - - public IExtension[] getExtensions() { - - return extensions; - - } - -} Copied: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/ColorsEnumExtension.java (from rev 3298, branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/ColorsEnumExtension.java) =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/ColorsEnumExtension.java (rev 0) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/ColorsEnumExtension.java 2010-07-26 20:17:12 UTC (rev 3301) @@ -0,0 +1,169 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package com.bigdata.rdf.internal; + +import org.openrdf.model.Literal; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.model.impl.URIImpl; +import com.bigdata.rdf.model.BigdataURI; +import com.bigdata.rdf.model.BigdataValue; +import com.bigdata.rdf.model.BigdataValueFactory; +import com.bigdata.rdf.store.BD; + +/** + * Example of how to do a custom enum and map that enum over a byte using a + * native inline {@link XSDByteIV}. + */ +public class ColorsEnumExtension<V extends BigdataValue> implements IExtension<V> { + + /** + * The datatype URI for the colors enum extension. + */ + public transient static final URI COLOR = new URIImpl(BD.NAMESPACE + "Color"); + + private BigdataURI color; + + public ColorsEnumExtension() { + + } + + public void resolveDatatype(final IDatatypeURIResolver resolver) { + + this.color = resolver.resolve(COLOR); + + } + + public BigdataURI getDatatype() { + + return color; + + } + + /** + * Attempts to convert the supplied RDF value into a colors enum + * representation. Tests for a literal value with the correct datatype + * that can be converted to one of the colors in the {@link Color} enum + * based on the string value of the literal's label. Each {@link Color} + * in the enum maps to a particular byte. This byte is encoded in a + * delegate {@link XSDByteIV}, and an {@link ExtensionIV} is returned that + * wraps the native type. + */ + public ExtensionIV createIV(final Value value) { + + if (value instanceof Literal == false) + throw new IllegalArgumentException(); + + final Literal l = (Literal) value; + + if (l.getDatatype() == null || !color.equals(l.getDatatype())) + throw new IllegalArgumentException(); + + final String s = value.stringValue(); + + final Color c = Enum.valueOf(Color.class, s); + + // not a valid color + if (c == null) + return null; + + final AbstractLiteralIV delegate = new XSDByteIV(c.getByte()); + + return new ExtensionIV(delegate, (TermId) getDatatype().getIV()); + + } + + /** + * Attempt to convert the {@link AbstractLiteralIV#byteValue()} back into + * a {@link Color}, and then use the string value of the {@link Color} to + * create an RDF literal. + */ + public V asValue(final ExtensionIV iv, final BigdataValueFactory vf) { + + final byte b = iv.getDelegate().byteValue(); + + final Color c = Color.valueOf(b); + + if (c == null) + throw new RuntimeException("bad color got encoded somehow"); + + return (V) vf.createLiteral(c.toString(), color); + + } + + /** + * Simple demonstration enum for some common colors. Can fit up to 256 enum + * values into an enum projected onto a byte. + */ + public enum Color { + + Red((byte) 0), + Blue((byte) 1), + Green((byte) 2), + Yellow((byte) 3), + Orange((byte) 4), + Purple((byte) 5), + Black((byte) 6), + White((byte) 7), + Brown((byte) 8); + + private Color(final byte b) { + this.b = b; + } + + static final public Color valueOf(final byte b) { + switch (b) { + case 0: + return Red; + case 1: + return Blue; + case 2: + return Green; + case 3: + return Yellow; + case 4: + return Orange; + case 5: + return Purple; + case 6: + return Black; + case 7: + return White; + case 8: + return Brown; + default: + throw new IllegalArgumentException(Byte.toString(b)); + } + } + + private final byte b; + + public byte getByte() { + return b; + } + + } + +} Copied: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/EpochExtension.java (from rev 3298, branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/EpochExtension.java) =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/EpochExtension.java (rev 0) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/EpochExtension.java 2010-07-26 20:17:12 UTC (rev 3301) @@ -0,0 +1,110 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package com.bigdata.rdf.internal; + +import org.openrdf.model.Literal; +import org.openrdf.model.URI; +import org.openrdf.model.Value; +import org.openrdf.model.datatypes.XMLDatatypeUtil; +import org.openrdf.model.impl.URIImpl; +import com.bigdata.rdf.model.BigdataURI; +import com.bigdata.rdf.model.BigdataValue; +import com.bigdata.rdf.model.BigdataValueFactory; +import com.bigdata.rdf.store.BD; + +/** + * This implementation of {@link IExtension} implements inlining for literals + * that represent time in milliseconds since the epoch. The milliseconds are + * encoded as an inline long. + */ +public class EpochExtension<V extends BigdataValue> implements IExtension<V> { + + /** + * The datatype URI for the epoch extension. + */ + public transient static final URI EPOCH = new URIImpl(BD.NAMESPACE + "Epoch"); + + private BigdataURI epoch; + + public EpochExtension() { + } + + public void resolveDatatype(final IDatatypeURIResolver resolver) { + + this.epoch = resolver.resolve(EPOCH); + + } + + public BigdataURI getDatatype() { + + return epoch; + + } + + /** + * Attempts to convert the supplied value into an epoch representation. + * Tests for a literal value with the correct datatype that can be converted + * to a positive long integer. Encodes the long in a delegate + * {@link XSDLongIV}, and returns an {@link ExtensionIV} to wrap the native + * type. + */ + public ExtensionIV createIV(final Value value) { + + if (value instanceof Literal == false) + throw new IllegalArgumentException(); + + final Literal lit = (Literal) value; + + final URI dt = lit.getDatatype(); + + if (dt == null || !EPOCH.stringValue().equals(dt.stringValue())) + throw new IllegalArgumentException(); + + final String s = value.stringValue(); + + final long l = XMLDatatypeUtil.parseLong(s); + + // can't have negative epoch values + if (l < 0) + return null; + + final AbstractLiteralIV delegate = new XSDLongIV(l); + + return new ExtensionIV(delegate, (TermId) getDatatype().getIV()); + + } + + /** + * Use the string value of the {@link ExtensionIV} (which defers to the + * string value of the native type) to create a literal with the epoch + * datatype. + */ + public V asValue(final ExtensionIV iv, final BigdataValueFactory vf) { + + return (V) vf.createLiteral(iv.stringValue(), epoch); + + } + +} Copied: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/SampleExtensionFactory.java (from rev 3298, branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/samples/com/bigdata/rdf/internal/SampleExtensionFactory.java) =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/SampleExtensionFactory.java (rev 0) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/internal/SampleExtensionFactory.java 2010-07-26 20:17:12 UTC (rev 3301) @@ -0,0 +1,35 @@ +package com.bigdata.rdf.internal; + +/** + * Simple {@link IExtensionFactory} implementation that creates two + * {@link IExtension}s - the {@link EpochExtension} and the + * {@link ColorsEnumExtension}. + */ +public class SampleExtensionFactory implements IExtensionFactory { + + private final IExtension[] extensions; + + public SampleExtensionFactory() { + + extensions = new IExtension[] { + new EpochExtension(), + new ColorsEnumExtension() + }; + + } + + public void resolveDatatypes(final IDatatypeURIResolver resolver) { + + for (IExtension extension : extensions) { + extension.resolveDatatype(resolver); + } + + } + + public IExtension[] getExtensions() { + + return extensions; + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-07-26 20:16:33
|
Revision: 3300 http://bigdata.svn.sourceforge.net/bigdata/?rev=3300&view=rev Author: thompsonbry Date: 2010-07-26 20:16:27 +0000 (Mon, 26 Jul 2010) Log Message: ----------- Bug fix for http://sourceforge.net/apps/trac/bigdata/ticket/117 Modified Paths: -------------- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestAll.java Added Paths: ----------- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java 2010-07-26 19:31:59 UTC (rev 3299) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java 2010-07-26 20:16:27 UTC (rev 3300) @@ -36,12 +36,12 @@ import org.openrdf.model.Resource; import org.openrdf.model.URI; import org.openrdf.model.Value; +import org.openrdf.model.datatypes.XMLDatatypeUtil; import com.bigdata.cache.ConcurrentWeakValueCache; import com.bigdata.cache.LRUCache; import com.bigdata.cache.WeakValueCache; import com.bigdata.rdf.lexicon.LexiconRelation; -import com.bigdata.rdf.store.IRawTripleStore; /** * An implementation using {@link BigdataValue}s and {@link BigdataStatement}s. @@ -267,9 +267,14 @@ public BigdataLiteralImpl createLiteral(final XMLGregorianCalendar arg0) { +// return new BigdataLiteralImpl(this, arg0.toString(), +// null/* languageCode */, createURI(arg0.getXMLSchemaType() +// .toString())); + return new BigdataLiteralImpl(this, arg0.toString(), - null/* languageCode */, createURI(arg0.getXMLSchemaType() - .toString())); + null/* languageCode */, createURI(XMLDatatypeUtil.qnameToURI( + arg0.getXMLSchemaType()).stringValue())); + } public BigdataLiteralImpl createLiteral(final String label, final String language) { Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestAll.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestAll.java 2010-07-26 19:31:59 UTC (rev 3299) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestAll.java 2010-07-26 20:16:27 UTC (rev 3300) @@ -62,6 +62,8 @@ TestSuite suite = new TestSuite("RDF data model"); + suite.addTestSuite(TestFactory.class); + return suite; } Added: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java (rev 0) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java 2010-07-26 20:16:27 UTC (rev 3300) @@ -0,0 +1,74 @@ +/** + +Copyright (C) SYSTAP, LLC 2006-2010. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + * Created on Jul 26, 2010 + */ + +package com.bigdata.rdf.model; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeConstants; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.XMLGregorianCalendar; + +import org.omg.CORBA.portable.ValueFactory; + +import junit.framework.TestCase2; + +/** + * @author <a href="mailto:tho...@us...">Bryan Thompson</a> + * @version $Id$ + */ +public class TestFactory extends TestCase2 { + + /** + * + */ + public TestFactory() { + } + + /** + * @param name + */ + public TestFactory(String name) { + super(name); + } + + public void test_gregorian() throws DatatypeConfigurationException { + + final BigdataValueFactory vf = BigdataValueFactoryImpl.getInstance(getName()); + + final XMLGregorianCalendar cal = DatatypeFactory.newInstance().newXMLGregorianCalendarDate( + 2010,// year + 1, // month, + 13, // day, + 0// timezone + ); + + assertEquals("http://www.w3.org/2001/XMLSchema#date", vf + .createLiteral(cal).getDatatype().stringValue()); + + } + +} Property changes on: branches/LEXICON_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java ___________________________________________________________________ Added: svn:keywords + Id Date Revision Author HeadURL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |