code: public void mergeShard(ApplicationDefinition appDef, String shard, MergeOptions options) {
          checkServiceState();
          if (appDef.getOption("auto-merge") != null) {
              TaskManagerService.instance().executeTask(appDef, new OLAPMerger(appDef, shard, options));
          } else {
              m_olap.merge(appDef, shard, options);
          }
      }
docs: Merge loaded batches for the given shard name and application, optionally assigning
  an expire-date. If "auto-merge" is not set for the application and a merge is
  already underway for the shard, an exception is thrown. If "auto-merge" is set, the
  shard is merged via a {@link TaskManagerService} task, waiting for an existing
  merge task, if any, to complete. If the given expireDate is not null, the shard is
  updated with the given expire-date. If the given expireDate is null, the shard is
  updated to not have an expire-date.
  
  @param appDef        OLAP application definition.
  @param shard         Shard name.
  @param options    	Merge options