}
Set codecDocStoreFiles = new HashSet();
<<<<<<< HEAD
final boolean hasSharedDocStore = info.getDocStoreOffset() != -1;
final String segmentInfoFileName3X = IndexFileNames.segmentFileName(info.name,
"",
Lucene3xSegmentInfosFormat.SI_EXTENSION);
if (hasSharedDocStore) {
// only violate the codec this way if its preflex &
// shares doc stores
info.getCodec().storedFieldsFormat().files(info, codecDocStoreFiles);
info.getCodec().termVectorsFormat().files(info, codecDocStoreFiles);
}
//System.out.println("copy seg=" + info.name + " version=" + info.getVersion());
// Same SI as before but we change directory, name and docStoreSegment:
SegmentInfo newInfo = new SegmentInfo(directory, info.getVersion(), segName, info.docCount, info.getDocStoreOffset(),
newDsName, info.getDocStoreIsCompoundFile(), info.getNormGen(), info.getUseCompoundFile(),
info.getDelCount(), info.getCodec(), info.getDiagnostics());
newInfo.setDelGen(info.getDelGen());
// We must rewrite the SI file because it references
// segment name (its own name, if its 3.x, and doc
// store segment name):
TrackingDirectoryWrapper dirWrapper = new TrackingDirectoryWrapper(directory);
try {
newInfo.getCodec().segmentInfosFormat().getSegmentInfosWriter().write(dirWrapper, newInfo, null, context);
} catch (UnsupportedOperationException uoe) {
// OK: 3x codec cannot write a new SI file;
// SegmentInfos will write this on commit
}
final Set siFileNames = dirWrapper.getCreatedFiles();
// Copy the segment's files
=======
if (info.getDocStoreOffset() != -1) {
// only violate the codec this way if its preflex
info.getCodec().storedFieldsFormat().files(info, codecDocStoreFiles);
info.getCodec().termVectorsFormat().files(info, codecDocStoreFiles);
}
// Copy the segment files
>>>>>>> 20f10be75b469a4ca5817815b99098eb44c60cb6
for (String file: info.files()) {
final String newFileName; |