@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; hash = (53 * hash) + getRowKey().hashCode(); if (getMutationsCount() > 0) { hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getMutationsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; hash = (53 * hash) + getRowKey().hashCode(); if (getMutationsCount() > 0) { hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getMutationsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ROW_KEY_FIELD_NUMBER; hash = (53 * hash) + getRowKey().hashCode(); if (getMutationsCount() > 0) { hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getMutationsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
Preconditions.checkNotNull(entry, "Entry is null"); Preconditions.checkArgument(!entry.getRowKey().isEmpty(), "Request has an empty rowkey"); if (entry.getMutationsCount() >= MAX_NUMBER_OF_MUTATIONS) { entry.getRowKey().toStringUtf8(), entry.getMutationsCount(), MAX_NUMBER_OF_MUTATIONS)); };
/** * Adds a {@link com.google.bigtable.v2.MutateRowsRequest.Entry} to the {@link * com.google.bigtable.v2.MutateRowsRequest.Builder}. NOTE: Users have to make sure that this * gets called in a thread safe way. * * @param entry The {@link com.google.bigtable.v2.MutateRowsRequest.Entry} to add * @return a {@link SettableFuture} that will be populated when the {@link MutateRowsResponse} * returns from the server. See {@link #addCallback(ListenableFuture)} for more * information about how the SettableFuture is set. */ private ListenableFuture<MutateRowResponse> add(MutateRowsRequest.Entry entry) { Preconditions.checkNotNull(entry); SettableFuture<MutateRowResponse> future = SettableFuture.create(); mutationMeter.mark(); futures.add(future); builder.addEntries(entry); approximateByteSize += entry.getSerializedSize(); numberOfMutations += entry.getMutationsCount(); return future; }
private boolean wouldBeFull(MutateRowsRequest.Entry entry) { boolean hitMutationMax = numberOfMutations + entry.getMutationsCount() > MAX_NUMBER_OF_MUTATIONS; if (hitMutationMax) { LOG.debug( "Would overflow maximum number of mutations, current = %d, adding = %d", numberOfMutations, entry.getMutationsCount()); } return getRequestCount() + 1 > maxRowKeyCount || (approximateByteSize + entry.getSerializedSize() > maxRequestSize) || hitMutationMax; }