From 757c98346d7bfab9afe642decdfa9af773c00d38 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Sun, 11 Dec 2011 00:43:58 +0000 Subject: [PATCH] More dead code git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1212946 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/index/DocFieldConsumers.java | 90 ------------------- .../index/DocFieldConsumersPerField.java | 55 ------------ 2 files changed, 145 deletions(-) delete mode 100644 lucene/src/java/org/apache/lucene/index/DocFieldConsumers.java delete mode 100644 lucene/src/java/org/apache/lucene/index/DocFieldConsumersPerField.java diff --git a/lucene/src/java/org/apache/lucene/index/DocFieldConsumers.java b/lucene/src/java/org/apache/lucene/index/DocFieldConsumers.java deleted file mode 100644 index 3d20248ff61..00000000000 --- a/lucene/src/java/org/apache/lucene/index/DocFieldConsumers.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.apache.lucene.index; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** This is just a "splitter" class: it lets you wrap two - * DocFieldConsumer instances as a single consumer. */ - -final class DocFieldConsumers extends DocFieldConsumer { - final DocFieldConsumer one; - final DocFieldConsumer two; - final DocumentsWriterPerThread.DocState docState; - - public DocFieldConsumers(DocFieldProcessor processor, DocFieldConsumer one, DocFieldConsumer two) { - this.one = one; - this.two = two; - this.docState = processor.docState; - } - - @Override - public void flush(Map fieldsToFlush, SegmentWriteState state) throws IOException { - - Map oneFieldsToFlush = new HashMap(); - Map twoFieldsToFlush = new HashMap(); - - for (Map.Entry fieldToFlush : fieldsToFlush.entrySet()) { - DocFieldConsumersPerField perField = (DocFieldConsumersPerField) fieldToFlush.getValue(); - oneFieldsToFlush.put(fieldToFlush.getKey(), perField.one); - twoFieldsToFlush.put(fieldToFlush.getKey(), perField.two); - } - - one.flush(oneFieldsToFlush, state); - two.flush(twoFieldsToFlush, state); - } - - @Override - public void abort() { - try { - one.abort(); - } finally { - two.abort(); - } - } - - @Override - public boolean freeRAM() { - boolean any = one.freeRAM(); - any |= two.freeRAM(); - return any; - } - - @Override - public void finishDocument() throws IOException { - try { - one.finishDocument(); - } finally { - two.finishDocument(); - } - } - - @Override - public void startDocument() throws IOException { - one.startDocument(); - two.startDocument(); - } - - @Override - public DocFieldConsumerPerField addField(FieldInfo fi) { - return new DocFieldConsumersPerField(this, fi, one.addField(fi), two.addField(fi)); - } - -} diff --git a/lucene/src/java/org/apache/lucene/index/DocFieldConsumersPerField.java b/lucene/src/java/org/apache/lucene/index/DocFieldConsumersPerField.java deleted file mode 100644 index 03dd6150857..00000000000 --- a/lucene/src/java/org/apache/lucene/index/DocFieldConsumersPerField.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.apache.lucene.index; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.IOException; - -final class DocFieldConsumersPerField extends DocFieldConsumerPerField { - - final DocFieldConsumerPerField one; - final DocFieldConsumerPerField two; - final DocFieldConsumers parent; - final FieldInfo fieldInfo; - - public DocFieldConsumersPerField(DocFieldConsumers parent, FieldInfo fi, DocFieldConsumerPerField one, DocFieldConsumerPerField two) { - this.parent = parent; - this.one = one; - this.two = two; - this.fieldInfo = fi; - } - - @Override - public void processFields(IndexableField[] fields, int count) throws IOException { - one.processFields(fields, count); - two.processFields(fields, count); - } - - @Override - public void abort() { - try { - one.abort(); - } finally { - two.abort(); - } - } - - @Override - FieldInfo getFieldInfo() { - return fieldInfo; - } -}