More dead code

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1212946 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2011-12-11 00:43:58 +00:00
parent 1d478ab5e3
commit 757c98346d
2 changed files with 0 additions and 145 deletions

View File

@ -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<FieldInfo, DocFieldConsumerPerField> fieldsToFlush, SegmentWriteState state) throws IOException {
Map<FieldInfo, DocFieldConsumerPerField> oneFieldsToFlush = new HashMap<FieldInfo, DocFieldConsumerPerField>();
Map<FieldInfo, DocFieldConsumerPerField> twoFieldsToFlush = new HashMap<FieldInfo, DocFieldConsumerPerField>();
for (Map.Entry<FieldInfo, DocFieldConsumerPerField> 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));
}
}

View File

@ -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;
}
}