Package net.yacy.kelondro.index

Examples of net.yacy.kelondro.index.RowSpaceExceededException


                index.remove(key);
                return null;
            }
            long memr = len + index.row().primaryKeyLength + 64;
            if (MemoryControl.available() < memr) {
                if (!MemoryControl.request(memr, true)) throw new RowSpaceExceededException(memr, "HeapReader.get()/check"); // not enough memory available for this blob
            }
           
            // read the key
            byte[] keyf;
            try {
                keyf = new byte[index.row().primaryKeyLength];
            } catch (OutOfMemoryError e) {
                throw new RowSpaceExceededException(index.row().primaryKeyLength, "HeapReader.get()/keyf");
            }
            file.readFully(keyf, 0, keyf.length);
            if (!this.ordering.equal(key, keyf)) {
                // verification of the indexed access failed. we must re-read the index
                Log.logSevere("HeapReader", "indexed verification access failed for " + heapFile.toString());
                // this is a severe operation, it should never happen.
                // remove entry from index because keeping that element in the index would not make sense
                index.remove(key);
                // nothing to return
                return null;
                // but if the process ends in this state, it would completely fail
                // if the index is not rebuild now at once
                //initIndexReadFromHeap();
            }
           
            // read the blob
            byte[] blob;
            try {
                blob = new byte[len];
            } catch (OutOfMemoryError e) {
                throw new RowSpaceExceededException(len, "HeapReader.get()/blob");
            }
            file.readFully(blob, 0, blob.length);
           
            return blob;
        }
View Full Code Here


        // return from the backend
        b = this.backend.get(key);
        if (b == null) return null;
        if (!MemoryControl.request(b.length * 2, true)) {
            throw new RowSpaceExceededException(b.length * 2, "decompress needs 2 * " + b.length + " bytes");
        }
        return decompress(b);
    }
View Full Code Here

            pos = line.indexOf("=");
            if (pos < 0) continue;
            map.put(line.substring(0, pos), line.substring(pos + 1));
        }
        } catch (OutOfMemoryError e) {
            throw new RowSpaceExceededException(0, "readLine probably uses too much RAM", e);
        }
        return map;
    }
View Full Code Here

                index.remove(key);
                return null;
            }
            long memr = len + index.row().primaryKeyLength + 64;
            if (MemoryControl.available() < memr) {
                if (!MemoryControl.request(memr, true)) throw new RowSpaceExceededException(memr, "HeapReader.get()/check"); // not enough memory available for this blob
            }
           
            // read the key
            byte[] keyf;
            try {
                keyf = new byte[index.row().primaryKeyLength];
            } catch (OutOfMemoryError e) {
                throw new RowSpaceExceededException(index.row().primaryKeyLength, "HeapReader.get()/keyf");
            }
            file.readFully(keyf, 0, keyf.length);
            if (!this.ordering.equal(key, keyf)) {
                // verification of the indexed access failed. we must re-read the index
                Log.logSevere("HeapReader", "indexed verification access failed for " + heapFile.toString());
                // this is a severe operation, it should never happen.
                // remove entry from index because keeping that element in the index would not make sense
                index.remove(key);
                // nothing to return
                return null;
                // but if the process ends in this state, it would completely fail
                // if the index is not rebuild now at once
                //initIndexReadFromHeap();
            }
           
            // read the blob
            byte[] blob;
            try {
                blob = new byte[len];
            } catch (OutOfMemoryError e) {
                throw new RowSpaceExceededException(len, "HeapReader.get()/blob");
            }
            file.readFully(blob, 0, blob.length);
           
            return blob;
        }
View Full Code Here

        // return from the backend
        b = this.backend.get(key);
        if (b == null) return null;
        if (!MemoryControl.request(b.length * 2, true)) {
            throw new RowSpaceExceededException(b.length * 2, "decompress needs 2 * " + b.length + " bytes");
        }
        return decompress(b);
    }
View Full Code Here

            pos = line.indexOf('=');
            if (pos < 0) continue;
            map.put(line.substring(0, pos), line.substring(pos + 1));
        }
        } catch (final OutOfMemoryError e) {
            throw new RowSpaceExceededException(0, "readLine probably uses too much RAM", e);
        } finally {
            br.close();
        }
        return map;
    }
View Full Code Here

TOP

Related Classes of net.yacy.kelondro.index.RowSpaceExceededException

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.