Projects >> zanata-server >>d153feea97885b528790b66fa0465b36749e287d

Chunk
Conflicting content
        assert handle == null || handle.isDone();
        final ReindexTask reindexTask = new ReindexTask(entityManagerFactory);
        String taskId =
<<<<<<< HEAD
                asyncTaskManagerServiceImpl.startTask(reindexTask);
        this.handle = (TimedAsyncHandle) asyncTaskManagerServiceImpl.getHandle(taskId);
    }

=======
                asyncTaskManagerServiceImpl.startTask(new ReindexTask());
        this.handle =
                (TimedAsyncHandle) asyncTaskManagerServiceImpl
                        .getHandle(taskId);
    }

    @SuppressWarnings("rawtypes")
    ClassIndexer getIndexer(Class clazz) {
        AbstractIndexingStrategy strategy;
        // TODO add a strategy which uses TransMemoryStreamingDAO
        if (clazz.equals(HTextFlowTarget.class)) {
            strategy = new HTextFlowTargetIndexingStrategy(session);
        } else {
            strategy = new SimpleClassIndexingStrategy(clazz, session);
        }
        return new ClassIndexer(session, handle, clazz, strategy);
    }

    public void reindex(boolean purge, boolean reindex, boolean optimize)
            throws Exception {
        setOptions(purge, reindex, optimize);
        new ReindexTask().call();
    }

>>>>>>> 9c4135543cc9ef86ed571c617466352fe8e81cfb
    /**
     * Private reindex Asynchronous task. NB: Separate from the main Bean class
     * as it is not recommended to reuse async tasks.
Solution content
        assert handle == null || handle.isDone();
        final ReindexTask reindexTask = new ReindexTask(entityManagerFactory);
        String taskId =
                asyncTaskManagerServiceImpl.startTask(reindexTask);
        this.handle = (TimedAsyncHandle) asyncTaskManagerServiceImpl.getHandle(taskId);
    }

    public void reindex(boolean purge, boolean reindex, boolean optimize)
            throws Exception {
        setOptions(purge, reindex, optimize);
        new ReindexTask(entityManagerFactory).call();
    }

    /**
     * Private reindex Asynchronous task. NB: Separate from the main Bean class
     * as it is not recommended to reuse async tasks.
File
SearchIndexManager.java
Developer's decision
Manual
Kind of conflict
Attribute
Cast expression
Method declaration
Method invocation
Chunk
Conflicting content
        @Nonnull
        private final TimedAsyncHandle handle;

<<<<<<< HEAD
        public ReindexTask(EntityManagerFactory entityManagerFactory) {
            this.entityManagerFactory = entityManagerFactory;
            String name = getClass().getSimpleName(); //+":"+indexingOptions
            this.handle = new TimedAsyncHandle(name);
            FullTextSession session = openFullTextSession();
            try {
                handle.setMaxProgress(getTotalOperations(session));
            } finally {
                session.close();
=======
        @Override
        public TimedAsyncHandle getHandle() {
            if (handle == null) {
                String name = getClass().getSimpleName(); // +":"+indexingOptions
                handle = new TimedAsyncHandle(name);
                handle.setMaxProgress(getTotalOperations());
>>>>>>> 9c4135543cc9ef86ed571c617466352fe8e81cfb
            }
        }
Solution content
        @Nonnull
        private final TimedAsyncHandle handle;

        public ReindexTask(EntityManagerFactory entityManagerFactory) {
            this.entityManagerFactory = entityManagerFactory;
            String name = getClass().getSimpleName(); // +":"+indexingOptions
            this.handle = new TimedAsyncHandle(name);
            FullTextSession session = openFullTextSession();
            try {
                handle.setMaxProgress(getTotalOperations(session));
            } finally {
                session.close();
            }
        }
File
SearchIndexManager.java
Developer's decision
Version 1
Kind of conflict
Annotation
Attribute
Comment
If statement
Method invocation
Method signature
Try statement
Variable