Invokes the given merge operation.

@param serviceName the service name
@param operation   the merge operation
@param partitionId the partition ID of the operation
1807
protected void invoke(String serviceName, Operation operation, int partitionId) {
        try {
            operationCount++;
            operationService
                    .invokeOnPartition(serviceName, operation, partitionId)
                    .andThen(mergeCallback);
        } catch (Throwable t) {
            throw rethrow(t);
        }
    }
1136196
public final void sendSentinel(long txnId, int partitionId) {
        final long initiatorHSId = m_cartographer.getHSIdForSinglePartitionMaster(partitionId);
        sendSentinel(txnId, initiatorHSId, -1, -1, true);
    }
157480
public void project_serviceName_storage_containerId_DELETE(String serviceName, String containerId) throws IOException {
		String qPath = "/cloud/project/{serviceName}/storage/{containerId}";
		StringBuilder sb = path(qPath, serviceName, containerId);
		exec(qPath, "DELETE", sb.toString(), null);
	}
156297
public OvhContainerDetail project_serviceName_storage_containerId_GET(String serviceName, String containerId) throws IOException {
		String qPath = "/cloud/project/{serviceName}/storage/{containerId}";
		StringBuilder sb = path(qPath, serviceName, containerId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhContainerDetail.class);
	}
545473
public void serviceName_user_username_PUT(String serviceName, String username, OvhUser body) throws IOException {
		String qPath = "/cluster/hadoop/{serviceName}/user/{username}";
		StringBuilder sb = path(qPath, serviceName, username);
		exec(qPath, "PUT", sb.toString(), body);
	}
664003
CompletableFuture<Partition> join(
      PartitionManagementService managementService,
      ThreadContextFactory threadFactory) {
    election = managementService.getElectionService().getElectionFor(partitionId);
    server = new PrimaryBackupPartitionServer(
        this,
        managementService,
        memberGroupProvider,
        threadFactory);
    client = new PrimaryBackupPartitionClient(this, managementService, threadFactory);
    return server.start().thenCompose(v -> client.start()).thenApply(v -> this);
  }
691837
public OvhVolume project_serviceName_volume_volumeId_GET(String serviceName, String volumeId) throws IOException {
		String qPath = "/cloud/project/{serviceName}/volume/{volumeId}";
		StringBuilder sb = path(qPath, serviceName, volumeId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhVolume.class);
	}
1348526
public void add(Operation operation) {
		synchronized (operations) {
			operations.addLast(operation);
			if (waiting)
				sp.unblock();
		}
		if (autoStart && operations.size() == 1 && getStatus() == Task.STATUS_NOT_STARTED)
			start();
	}
1270863
public OvhOptions serviceName_partition_partitionName_options_GET(String serviceName, String partitionName) throws IOException {
		String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/options";
		StringBuilder sb = path(qPath, serviceName, partitionName);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhOptions.class);
	}
205033
@com.fasterxml.jackson.annotation.JsonProperty("ServiceId")
    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }
492313
private void mergeConsumerDrIdTrackerToZK(JSONObject jsonObj) throws JSONException {
        //DR ids/unique ids for remote partitions indexed by remote datacenter id,
        //each DC has a full partition set
        JSONObject dcIdMap;
        if (jsonObj.has("drMixedClusterSizeConsumerState")) {
            dcIdMap = jsonObj.getJSONObject("drMixedClusterSizeConsumerState");
        } else {
            dcIdMap = new JSONObject();
            jsonObj.put("drMixedClusterSizeConsumerState", dcIdMap);
        }

        for (Map.Entry<Integer, JSONObject> dcEntry : m_drMixedClusterSizeConsumerState.entrySet()) {
            //Last seen ids for a specific data center
            final String consumerPartitionString = dcEntry.getKey().toString();
            if (!dcIdMap.has(consumerPartitionString)) {
                dcIdMap.put(consumerPartitionString, dcEntry.getValue());
            }
        }
    }
1185108
public CompletableFuture<byte[]> invoke(PrimitiveOperation operation) {
    CompletableFuture<byte[]> future = new CompletableFuture<>();
    switch (operation.id().type()) {
      case COMMAND:
        context.execute(() -> invokeCommand(operation, future));
        break;
      case QUERY:
        context.execute(() -> invokeQuery(operation, future));
        break;
      default:
        throw new IllegalArgumentException("Unknown operation type " + operation.id().type());
    }
    return future;
  }
342359
@Override
    public void operationName(int index, String operationName)
            throws OperationFormatException {

        if (operationName == null || !ALPHANUMERICS_PATTERN.matcher(operationName).matches()) {
            throw new OperationFormatException("'" + operationName + "' is not a valid operation name.");
        }

        validatedOperationName(index, operationName);
    }
1280952
public void finalizeReplicaSync(int partitionId, int replicaIndex, ServiceNamespace namespace, long[] versions) {
        PartitionReplicaVersions replicaVersion = replicaVersions[partitionId];
        replicaVersion.clear(namespace);
        replicaVersion.set(namespace, versions, replicaIndex);
        clearReplicaSyncRequest(partitionId, namespace, replicaIndex);
    }
1092420
public void serviceName_server_id_PUT(String serviceName, Long id, OvhServer body) throws IOException {
		String qPath = "/sslGateway/{serviceName}/server/{id}";
		StringBuilder sb = path(qPath, serviceName, id);
		exec(qPath, "PUT", sb.toString(), body);
	}
1362626
public void project_serviceName_volume_volumeId_DELETE(String serviceName, String volumeId) throws IOException {
		String qPath = "/cloud/project/{serviceName}/volume/{volumeId}";
		StringBuilder sb = path(qPath, serviceName, volumeId);
		exec(qPath, "DELETE", sb.toString(), null);
	}
439549
private void acknowledgeAlreadyProcessedOperation(SegmentOperation operation) throws DataCorruptionException {
        if (operation instanceof MergeSegmentOperation) {
            // Only MergeSegmentOperations need special handling. Others, such as StreamSegmentSealOperation, are not
            // needed since they're handled in the initialize() method. Ensure that the DataSource is aware of this
            // (since after recovery, it may not know that a merge has been properly completed).
            MergeSegmentOperation mergeOp = (MergeSegmentOperation) operation;
            try {
                updateMetadataForTransactionPostMerger(this.dataSource.getStreamSegmentMetadata(mergeOp.getSourceSegmentId()), mergeOp.getStreamSegmentId());
            } catch (Throwable ex) {
                // Something really weird must have happened if we ended up in here. To prevent any (further) damage, we need
                // to stop the Segment Container right away.
                throw new DataCorruptionException(String.format("Unable to acknowledge already processed operation '%s'.", operation), ex);
            }
        }
    }