algoliasearch/src/offline/java/com/algolia/search/saas/MirroredIndex.java
public void sync()
    {
        if (getDataSelectionQueries().length == 0) {
            throw new IllegalStateException("Cannot sync with empty data selection queries");
        }
        synchronized (this) {
            if (syncing)
                return;
            syncing = true;
        }
        getClient().localBuildExecutorService.submit(new Runnable()
        {
            @Override
            public void run()
            {
                _sync();
            }
        });
    }
public void sync()
    {
        if (getDataSelectionQueries().length == 0) {
            throw new IllegalStateException("Cannot sync with empty data selection queries");
        }
        synchronized (this) {
            if (syncing)
                return;
            syncing = true;
        }
        getClient().localBuildExecutorService.submit(new Runnable()
        {
            @Override
            public void run()
            {
                _sync();
            }
        });
    }
Launch a sync.
If a sync is already running, this call is ignored. Otherwise, the sync is enqueued and runs in the background.

NOTE: All index syncs are sequential: no two syncs can run at the same time.

@throws IllegalStateException If no data selection queries were set.