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

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


     *
     * @param dir the directory from where to read the index infos.
     * @throws IOException if an error occurs.
     */
    void read(Directory dir) throws IOException {
        InputStream in = new IndexInputStream(dir.openInput(name));
        try {
            DataInputStream di = new DataInputStream(in);
            counter = di.readInt();
            for (int i = di.readInt(); i > 0; i--) {
                String indexName = di.readUTF();
                indexes.add(indexName);
                names.add(indexName);
            }
        } finally {
            in.close();
        }
    }
View Full Code Here


     */
    private void read(ActionCollector collector) throws IOException {
        if (!dir.fileExists(REDO_LOG)) {
            return;
        }
        InputStream in = new IndexInputStream(dir.openInput(REDO_LOG));
        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

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.