Package org.openjena.atlas

Examples of org.openjena.atlas.AtlasException


            if ( size == 3 ) {
                return Tuple.create(in.readLong(), in.readLong(), in.readLong()) ;
            } else if ( size == 4 ) {
                return Tuple.create(in.readLong(), in.readLong(), in.readLong(), in.readLong()) ;
            } else {
                throw new AtlasException("Unsupported size.") ;
            }
        } catch (IOException e) {
            return null ;
        }
    }
View Full Code Here


        }
    }

    @Override
    public void remove() {
        throw new AtlasException("Method not implemented.") ;
    }
View Full Code Here

    @Override
    public void close() {
        try {
            in.close() ;
        } catch (IOException e) {
            new AtlasException(e) ;
        }       
    }
View Full Code Here

        this.pool.setRejectedExecutionHandler(this.block) ;
    }
  
    protected void checkClosed()
    {
        if (closed) throw new AtlasException("SortedDataBag is closed, no operations can be performed on it.") ;
    }
View Full Code Here

    @Override
  public void add(E item)
    {
        checkClosed();
        if (finishedAdding)
            throw new AtlasException("SortedDataBag: Cannot add any more items after the writing phase is complete.");
       
        if (policy.isThresholdExceeded())
        {
            spill();
        }
View Full Code Here

            {
                out = getSpillStream();
            }
            catch (IOException e)
            {
                throw new AtlasException(e);
            }
           
            // Sort the tuples
            // Collections.sort() will copy to an array, sort, and then copy back.  Avoid that
            // extra copy by copying to an array and using Arrays.sort().  Also it lets us use
View Full Code Here

            if ( ( multithreaded ) && ( ! pool.isShutdown() ) ) {
                pool.shutdown() ;
                try {
                    pool.awaitTermination(10, TimeUnit.MINUTES) ;
                } catch (InterruptedException e) {
                    throw new AtlasException(e) ;
                }
            }
           
            List<Iterator<E>> inputs = new ArrayList<Iterator<E>>(size + (memSize > 0 ? 1 : 0));
                       
            if (memSize > 0)
            {
                inputs.add(memory.iterator());
            }
           
            for ( int i = 0; i < size; i++ )
            {
                File spillFile = getSpillFiles().get(i);
                try
                {
                    InputStream in = new BufferedInputStream(new FileInputStream(spillFile));
                   
                    Iterator<E> deserializer = serializationFactory.createDeserializer(in) ;
                    IteratorResourceClosing<E> irc = new IteratorResourceClosing<E>(deserializer, in);
                    inputs.add(irc);
                }
                catch (FileNotFoundException e)
                {
                    // Close any open streams before we throw an exception
                    for (Iterator<E> it : inputs)
                    {
                        Iter.close(it);
                    }
                   
                    throw new AtlasException("Cannot find one of the spill files", e);
                }
            }
           
            SpillSortIterator<E> ssi = new SpillSortIterator<E>(inputs, comparator);
            registerCloseableIterator(ssi);
View Full Code Here

                getSpillFiles().removeAll(toRemove) ;
               
                memory = new ArrayList<E>() ;
            }           
        } catch (IOException e) {
            throw new AtlasException(e) ;
        }

    }   
View Full Code Here

        Iterator<Long> iter = tuple.iterator() ;
        while ( iter.hasNext() ) {
            try {
                out.writeLong( iter.next() ) ;
            } catch (IOException e) {
                new AtlasException(e) ;
            }
        }
    }
View Full Code Here

    @Override
    public void flush() {
        try {
            out.flush() ;
        } catch (IOException e) {
            new AtlasException(e) ;
        }
    }
View Full Code Here

TOP

Related Classes of org.openjena.atlas.AtlasException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.