@InterfaceStability.Experimental
    @InterfaceAudience.Public
    public static <D extends Document<?>> Single<D> getFirstPrimaryOrReplica(final String id,
        final Class<D> target, final Bucket bucket) {
        return getFirstPrimaryOrReplica(id, target, bucket, bucket.environment().kvTimeout());
    }
@ InterfaceStability . Experimental @ InterfaceAudience . Public public static < D extends Document < ? > > Single < D > getFirstPrimaryOrReplica ( final String id , final Class < D > target , final Bucket bucket ) { return getFirstPrimaryOrReplica ( id , target , bucket , bucket . environment ( ) . kvTimeout ( ) ) ; }
Asynchronously fetch the document from the primary and if that operations fails try
all the replicas and return the first document that comes back from them (using the
environments KV timeout for both primary and replica).

@param id the document ID to fetch.
@param target the custom document type to use.
@param bucket the bucket to use when fetching the doc.
@return @return a {@link Single} with either 0 or 1 {@link Document}.