Package org.apache.jackrabbit.core.query.lucene.directory

Examples of org.apache.jackrabbit.core.query.lucene.directory.IndexInputStream


     */
    private void read(ActionCollector collector) throws IOException {
        if (!dir.fileExists(fileName)) {
            return;
        }
        InputStream in = new IndexInputStream(dir.openInput(fileName));
        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
            String line;
            while ((line = reader.readLine()) != null) {
                try {
                    collector.collect(MultiIndex.Action.fromString(line));
                } catch (IllegalArgumentException e) {
                    log.warn("Malformed redo entry: " + e.getMessage());
                }
            }
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException e) {
                    log.warn("Exception while closing redo log: " + e.toString());
                }
            }
        }
View Full Code Here


     */
    private void read(ActionCollector collector) throws IOException {
        if (!dir.fileExists(fileName)) {
            return;
        }
        InputStream in = new IndexInputStream(dir.openInput(fileName));
        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
            String line;
            while ((line = reader.readLine()) != null) {
                try {
                    collector.collect(MultiIndex.Action.fromString(line));
                } catch (IllegalArgumentException e) {
                    log.warn("Malformed redo entry: " + e.getMessage());
                }
            }
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException e) {
                    log.warn("Exception while closing redo log: " + e.toString());
                }
            }
        }
View Full Code Here

     *
     * @throws IOException if an error occurs.
     */
    private void read() throws IOException {
        String fileName = getFileName(generation);
        InputStream in = new BufferedInputStream(new IndexInputStream(
                directory.openInput(fileName)));
        try {
            LinkedHashMap<String, IndexInfo> indexes = new LinkedHashMap<String, IndexInfo>();
            DataInputStream di = new DataInputStream(in);
            int version;
View Full Code Here

     *
     * @throws IOException if an error occurs.
     */
    private void read() throws IOException {
        String fileName = getFileName(generation);
        InputStream in = new IndexInputStream(directory.openInput(fileName));
        try {
            LinkedHashMap<String, IndexInfo> indexes = new LinkedHashMap<String, IndexInfo>();
            DataInputStream di = new DataInputStream(in);
            int version;
            if (generation == 0) {
                version = NAMES_ONLY;
            } else {
                version = di.readInt();
            }
            int counter = di.readInt();
            for (int i = di.readInt(); i > 0; i--) {
                String indexName = di.readUTF();
                long gen = 0;
                if (version >= WITH_GENERATION) {
                    gen = di.readLong();
                }
                indexes.put(indexName, new IndexInfo(indexName, gen));
            }
            // when successfully read set values
            this.lastModified = directory.fileModified(fileName);
            this.indexes = indexes;
            this.counter = counter;
        } finally {
            in.close();
        }
    }
View Full Code Here

     *
     * @throws IOException if an error occurs while reading.
     */
    private void readStore() throws IOException {
        if (dir.fileExists(INDEXING_QUEUE_FILE)) {
            InputStream in = new IndexInputStream(dir.openInput(INDEXING_QUEUE_FILE));
            BufferedReader reader = new BufferedReader(
                    new InputStreamReader(in, ENCODING));
            try {
                String line;
                while ((line = reader.readLine()) != null) {
                    int idx = line.indexOf(' ');
                    if (idx == -1) {
                        // invalid line
                        log.warn("invalid line in {}: {}", INDEXING_QUEUE_FILE, line);
                    } else {
                        String cmd = line.substring(0, idx);
                        String uuid = line.substring(idx + 1, line.length());
                        if (ADD.equals(cmd)) {
                            pending.add(uuid);
                        } else if (REMOVE.equals(cmd)) {
                            pending.remove(uuid);
                        } else {
                            // invalid line
                            log.warn("invalid line in {}: {}", INDEXING_QUEUE_FILE, line);
                        }
                    }
                }
            } finally {
                in.close();
            }
        }
    }
View Full Code Here

     *
     * @throws IOException if an error occurs.
     */
    private void read() throws IOException {
        String fileName = getFileName(generation);
        InputStream in = new BufferedInputStream(new IndexInputStream(
                directory.openInput(fileName)));
        try {
            LinkedHashMap<String, IndexInfo> indexes = new LinkedHashMap<String, IndexInfo>();
            DataInputStream di = new DataInputStream(in);
            int version;
View Full Code Here

     *
     * @throws IOException if an error occurs.
     */
    private void read() throws IOException {
        String fileName = getFileName(generation);
        InputStream in = new BufferedInputStream(new IndexInputStream(
                directory.openInput(fileName)));
        try {
            LinkedHashMap<String, IndexInfo> indexes = new LinkedHashMap<String, IndexInfo>();
            DataInputStream di = new DataInputStream(in);
            int version;
View Full Code Here

     *
     * @throws IOException if an error occurs.
     */
    private void read() throws IOException {
        String fileName = getFileName(generation);
        InputStream in = new BufferedInputStream(new IndexInputStream(
                directory.openInput(fileName)));
        try {
            LinkedHashMap<String, IndexInfo> indexes = new LinkedHashMap<String, IndexInfo>();
            DataInputStream di = new DataInputStream(in);
            int version;
View Full Code Here

     */
    private void read(ActionCollector collector) throws IOException {
        if (!dir.fileExists(fileName)) {
            return;
        }
        InputStream in = new IndexInputStream(dir.openInput(fileName));
        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
            String line;
            while ((line = reader.readLine()) != null) {
                try {
                    collector.collect(MultiIndex.Action.fromString(line));
                } catch (IllegalArgumentException e) {
                    log.warn("Malformed redo entry: " + e.getMessage());
                }
            }
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException e) {
                    log.warn("Exception while closing redo log: " + e.toString());
                }
            }
        }
View Full Code Here

     *
     * @throws IOException if an error occurs while reading.
     */
    private void readStore() throws IOException {
        if (dir.fileExists(INDEXING_QUEUE_FILE)) {
            InputStream in = new IndexInputStream(dir.openInput(INDEXING_QUEUE_FILE));
            BufferedReader reader = new BufferedReader(
                    new InputStreamReader(in, ENCODING));
            try {
                String line;
                while ((line = reader.readLine()) != null) {
                    int idx = line.indexOf(' ');
                    if (idx == -1) {
                        // invalid line
                        log.warn("invalid line in {}: {}", INDEXING_QUEUE_FILE, line);
                    } else {
                        String cmd = line.substring(0, idx);
                        String uuid = line.substring(idx + 1, line.length());
                        if (ADD.equals(cmd)) {
                            pending.add(uuid);
                        } else if (REMOVE.equals(cmd)) {
                            pending.remove(uuid);
                        } else {
                            // invalid line
                            log.warn("invalid line in {}: {}", INDEXING_QUEUE_FILE, line);
                        }
                    }
                }
            } finally {
                in.close();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.query.lucene.directory.IndexInputStream

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.