Package org.apache.xindice

Examples of org.apache.xindice.Stopwatch


                for (int i = 0; i < list.length; i++) {
                    log.trace("Index Creation: " + list[i].indexer.getName());
                }
            }

            Stopwatch sw = new Stopwatch("Populated Indexes", true);
            RecordSet rs = collection.getFiler().getRecordSet();
            while (rs.hasMoreRecords()) {
                // Read only key, we don't need filer-level value
                Key key = rs.getNextKey();
                Object value = collection.getEntry(key);
                if (value instanceof Document) {
                    try {
                        new SAXHandler(key, (Document)value, ACTION_CREATE, list);
                    } catch (Exception e) {
                        if (log.isWarnEnabled()) {
                            log.warn("Failed to index document " + key, e);
                        }
                    }
                }
            }

            for (int i = 0; i < list.length; i++) {
                try {
                    list[i].indexer.flush();
                } catch (Exception e) {
                    if (log.isWarnEnabled()) {
                        log.warn("ignored exception", e);
                    }
                }
                list[i].status = STATUS_READY;
            }
            sw.stop();

            if (log.isDebugEnabled()) {
                for (int i = 0; i < list.length; i++) {
                    log.debug("Index Complete: " + list[i].indexer.getName());
                }
                log.debug(sw.toString());
            }
        }
    }
View Full Code Here


                for (int i = 0; i < list.length; i++) {
                    log.trace("Index Creation: " + list[i].getName());
                }
            }

            Stopwatch sw = new Stopwatch("Populated Indexes", true);
            RecordSet rs = collection.getFiler().getRecordSet();
            while (rs.hasMoreRecords()) {
                // Read only key, we don't need filer-level value
                Key key = rs.getNextKey();
                Entry entry = collection.getEntry(key);
                if (entry.getEntryType() == Entry.DOCUMENT) {
                    try {
                        new DocumentHandler(symbols, key, (Document) entry.getValue(), DocumentHandler.ACTION_CREATE, list);
                    } catch (Exception e) {
                        if (log.isWarnEnabled()) {
                            log.warn("Failed to index document " + key, e);
                        }
                    }
                }
            }

            for (int i = 0; i < list.length; i++) {
                try {
                    list[i].flush();
                } catch (Exception e) {
                    if (log.isWarnEnabled()) {
                        log.warn("ignored exception", e);
                    }
                }
                status.put(list[i].getName(), STATUS_READY);
            }
            sw.stop();

            if (log.isDebugEnabled()) {
                for (int i = 0; i < list.length; i++) {
                    log.debug("Index Complete: " + list[i].getName());
                }
                log.debug(sw.toString());
            }
        }
    }
View Full Code Here

                for (int i = 0; i < list.length; i++) {
                    log.trace("Index Creation: " + list[i].indexer.getName());
                }
            }

            Stopwatch sw = new Stopwatch("Populated Indexes", true);
            for (int i = 0; i < list.length; i++) {
                try {
                    if (!list[i].indexer.exists()) {
                        list[i].indexer.create();
                    }

                    list[i].indexer.open();
                } catch (Exception e) {
                    if (log.isWarnEnabled()) {
                        log.warn("Failed to create/open indexer " + list[i], e);
                    }
                }
            }

            RecordSet rs = collection.getFiler().getRecordSet();
            while (rs.hasMoreRecords()) {
                // Read only key, we don't need filer-level value
                Key key = rs.getNextKey();
                Object value = collection.getEntry(key);
                if (value instanceof Document) {
                    // Document doc = new DocumentImpl(rec.getValue().getData(), symbols, new NodeSource(collection, key));
                    try {
                        new SAXHandler(key, (Document)value, ACTION_CREATE, list);
                    } catch (Exception e) {
                        if (log.isWarnEnabled()) {
                            log.warn("Failed to index document " + key, e);
                        }
                    }
                }
            }

            for (int i = 0; i < list.length; i++) {
                try {
                    list[i].indexer.flush();
                } catch (Exception e) {
                    if (log.isWarnEnabled()) {
                        log.warn("ignored exception", e);
                    }
                }
                list[i].status = STATUS_READY;
            }
            sw.stop();

            if (log.isDebugEnabled()) {
                for (int i = 0; i < list.length; i++) {
                    log.debug("Index Complete: " + list[i].indexer.getName());
                }
                log.debug(sw.toString());
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.xindice.Stopwatch

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.