[
https://issues.apache.org/jira/browse/PIRK-4?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15441381#comment-15441381
]
ASF GitHub Bot commented on PIRK-4:
-----------------------------------
Github user smarthi commented on a diff in the pull request:
https://github.com/apache/incubator-pirk/pull/74#discussion_r76515132
--- Diff:
src/main/java/org/apache/pirk/responder/wideskies/storm/EncRowCalcBolt.java ---
@@ -0,0 +1,243 @@
+/*
+ * 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.
+ */
+
+package org.apache.pirk.responder.wideskies.storm;
+
+import org.apache.pirk.query.wideskies.Query;
+import org.apache.pirk.responder.wideskies.common.ComputeEncryptedRow;
+import org.apache.storm.task.OutputCollector;
+import org.apache.storm.task.TopologyContext;
+import org.apache.storm.topology.OutputFieldsDeclarer;
+import org.apache.storm.topology.base.BaseRichBolt;
+import org.apache.storm.tuple.Fields;
+import org.apache.storm.tuple.Tuple;
+import org.apache.storm.tuple.Values;
+import org.slf4j.LoggerFactory;
+import scala.Tuple2;
+
+import java.io.IOException;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+
+/**
+ * Bolt class to perform the encrypted row calculation
+ * <p/>
+ * Receives a {@code <hash(selector), dataPartitions>} tuple as input.
+ * <p/>
+ * Encrypts the row data and emits a (column index, encrypted row-value)
tuple for each encrypted block.
+ * <p/>
+ * Every FLUSH_FREQUENCY seconds, it sends a signal to EncColMultBolt to
flush its output and resets all counters. At that point, all outgoing (column
index,
+ * encrypted row-value) tuples are buffered until a SESSION_END signal is
received back from the EncColMultBolt.
+ */
+public class EncRowCalcBolt extends BaseRichBolt
+{
+ private static final long serialVersionUID = 1L;
+
+ private static final org.slf4j.Logger logger =
LoggerFactory.getLogger(EncRowCalcBolt.class);
+
+ private OutputCollector outputCollector;
+ private static Query query;
+ private static boolean querySet = false;
+
+ private Boolean limitHitsPerSelector;
+ private Long maxHitsPerSelector;
+ private Long totalEndSigs;
+ private int rowDivisions;
+ private Boolean saltColumns;
+ private Boolean splitPartitions;
+
+ private Random rand;
+
+ // These are the main data structures used here.
+ private Map<Integer,Integer> hitsByRow = new HashMap<Integer,Integer>();
+ private Map<Integer,Integer> colIndexByRow = new
HashMap<Integer,Integer>();
+ private List<Tuple2<Long,BigInteger>> matrixElements = new
ArrayList<Tuple2<Long,BigInteger>>();
+ private List<BigInteger> dataArray = new ArrayList<>();
+
+ private int numEndSigs = 0;
+
+ // These buffered values are used in the case when a session has been
ejected, but the SESSION_END signal has not been received
+ // yet from the next bolt.
+ private boolean buffering = false;
+ private List<Tuple2<Long,BigInteger>> bufferedValues = new
ArrayList<Tuple2<Long,BigInteger>>();
--- End diff --
no need to specify type on RHS
> Add Streaming Implementation for Apache Storm
> ---------------------------------------------
>
> Key: PIRK-4
> URL: https://issues.apache.org/jira/browse/PIRK-4
> Project: PIRK
> Issue Type: Task
> Components: Responder
> Reporter: Chris Harris
> Assignee: Chris Harris
>
> Per the Pirk Roadmap, this is a feature to add support for Apache Storm
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)