Projects >> lucene-solr >>d5f7dbdde7ba0028fad581c6fa6d521a5ba0a276

Chunk
Conflicting content
        final Set dsFilesCopied = new HashSet();
        final Map dsNames = new HashMap();
        final Set copiedFiles = new HashSet();
<<<<<<< HEAD
=======

>>>>>>> 20f10be75b469a4ca5817815b99098eb44c60cb6
        for (SegmentInfo info : sis) {
          assert !infos.contains(info): "dup info dir=" + info.dir + " name=" + info.name;
Solution content
        final Set dsFilesCopied = new HashSet();
        final Map dsNames = new HashMap();
        final Set copiedFiles = new HashSet();
        for (SegmentInfo info : sis) {
          assert !infos.contains(info): "dup info dir=" + info.dir + " name=" + info.name;
File
IndexWriter.java
Developer's decision
Version 1
Kind of conflict
Blank
Chunk
Conflicting content
          IOContext context = new IOContext(new MergeInfo(info.docCount, info.sizeInBytes(), true, -1));
          
<<<<<<< HEAD
          infos.add(copySegmentAsIs(info, newSegName, dsNames, dsFilesCopied, context, copiedFiles));
=======
          copySegmentAsIs(info, newSegName, dsNames, dsFilesCopied, context, copiedFiles);

          infos.add(info);
>>>>>>> 20f10be75b469a4ca5817815b99098eb44c60cb6
        }
      }
Solution content
          IOContext context = new IOContext(new MergeInfo(info.docCount, info.sizeInBytes(), true, -1));
          
          infos.add(copySegmentAsIs(info, newSegName, dsNames, dsFilesCopied, context, copiedFiles));
        }
      }
File
IndexWriter.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
  }

  /** Copies the segment files as-is into the IndexWriter's directory. */
<<<<<<< HEAD
  private SegmentInfo copySegmentAsIs(SegmentInfo info, String segName,
                                      Map dsNames, Set dsFilesCopied, IOContext context,
                                      Set copiedFiles)
=======
  private void copySegmentAsIs(SegmentInfo info, String segName,
                               Map dsNames, Set dsFilesCopied, IOContext context,
                               Set copiedFiles)
>>>>>>> 20f10be75b469a4ca5817815b99098eb44c60cb6
      throws IOException {
    // Determine if the doc store of this segment needs to be copied. It's
    // only relevant for segments that share doc store with others,
Solution content
  }

  /** Copies the segment files as-is into the IndexWriter's directory. */
  private SegmentInfo copySegmentAsIs(SegmentInfo info, String segName,
                                      Map dsNames, Set dsFilesCopied, IOContext context,
                                      Set copiedFiles)
      throws IOException {
    // Determine if the doc store of this segment needs to be copied. It's
    // only relevant for segments that share doc store with others,
File
IndexWriter.java
Developer's decision
Version 1
Kind of conflict
Method signature
Chunk
Conflicting content
    }
    
    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;
Solution content
    }
    
    Set codecDocStoreFiles = new HashSet();
    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
    for (String file: info.files()) {

      final String newFileName;
File
IndexWriter.java
Developer's decision
Version 1
Kind of conflict
Comment
If statement
Method invocation
Try statement
Variable