Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.clustermate.client.operation;
 
 import java.util.*;
 
Intermediate base class for write operations (PUT, DELETE).
 
public class WriteOperationResult<T extends WriteOperationResult<T>>
    extends OperationResultImpl<T>
{
    
List of servers for which calls succeeded (possibly after initial failures and re-send), in order of call completion.
    protected final List<ClusterServerNode_succeeded;
    
    /*
    /**********************************************************************
    /* Life-cycle
    /**********************************************************************
     */
    protected WriteOperationResult(OperationConfig config) {
        super(config);
         = new ArrayList<ClusterServerNode>(config.getOptimalOks());
   }
    @SuppressWarnings("unchecked")
    public T addSucceeded(ClusterServerNode server) {
        .add(server);
        return (T) this;
    }
    
    /*
    /**********************************************************************
    /* Partial API implementation
    /**********************************************************************
     */
    
    @Override
    public final int getSuccessCount() { return .size(); }
    @Override
    public boolean succeededMinimally() {
        return getSuccessCount() >= .getMinimalOksToSucceed();
    }
    @Override
    public boolean succeededOptimally() {
        return getSuccessCount() >= .getOptimalOks();
    }
    @Override
    public boolean succeededMaximally() {
        return getSuccessCount() >= .getMaxOks();
    }
    
    /*
    /**********************************************************************
    /* Extended API
    /**********************************************************************
     */
    public Iterable<ClusterServerNodegetSuccessServers() { return ; }
New to GrepCode? Check out our FAQ X