Github user isper3at commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/177#discussion_r127770676
  
    --- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/batch/SpanBatchBindingSetUpdater.java
 ---
    @@ -0,0 +1,128 @@
    +package org.apache.rya.indexing.pcj.fluo.app.batch;
    +
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +import java.util.Iterator;
    +import java.util.Optional;
    +
    +import org.apache.fluo.api.client.TransactionBase;
    +import org.apache.fluo.api.client.scanner.ColumnScanner;
    +import org.apache.fluo.api.client.scanner.RowScanner;
    +import org.apache.fluo.api.data.Bytes;
    +import org.apache.fluo.api.data.Column;
    +import org.apache.fluo.api.data.ColumnValue;
    +import org.apache.fluo.api.data.RowColumn;
    +import org.apache.fluo.api.data.Span;
    +import org.apache.log4j.Logger;
    +import org.apache.rya.indexing.pcj.fluo.app.batch.BatchInformation.Task;
    +
    +import com.google.common.base.Preconditions;
    +
    +/**
    + * This class processes {@link SpanBatchDeleteInformation} objects by
    + * deleting the entries in the Fluo Column corresponding to the {@link 
Span}
    + * of the BatchInformation object.  This class will delete entries until 
the
    + * batch size is met, and then create a new SpanBatchDeleteInformation 
object
    + * with an updated Span whose starting point is the stopping point of this
    + * batch.  If the batch limit is not met, then a new batch is not created 
and
    + * the task is complete.
    + *
    + */
    +public class SpanBatchBindingSetUpdater extends 
AbstractBatchBindingSetUpdater {
    +
    +    private static final Logger log = 
Logger.getLogger(SpanBatchBindingSetUpdater.class);
    +
    +    /**
    +     * Process SpanBatchDeleteInformation objects by deleting all entries 
indicated
    +     * by Span until batch limit is met.
    +     * @param tx - Fluo Transaction
    +     * @param row - Byte row identifying BatchInformation
    +     * @param batch - SpanBatchDeleteInformation object to be processed
    +     */
    +    @Override
    +    public void processBatch(TransactionBase tx, Bytes row, 
BatchInformation batch) throws Exception {
    +        super.processBatch(tx, row, batch);
    +        Preconditions.checkArgument(batch instanceof 
SpanBatchDeleteInformation);
    +        SpanBatchDeleteInformation spanBatch = 
(SpanBatchDeleteInformation) batch;
    +        Task task = spanBatch.getTask();
    +        int batchSize = spanBatch.getBatchSize();
    +        Span span = spanBatch.getSpan();
    +        Column column = batch.getColumn();
    +        Optional<RowColumn> rowCol = Optional.empty();
    +
    +        switch (task) {
    +        case Add:
    +            log.trace("The Task Add is not supported for 
SpanBatchBindingSetUpdater.  Batch " + batch + " will not be processed.");
    --- End diff --
    
    throw OperationUnsupportedException?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to