nickwallen commented on a change in pull request #1458: METRON-2177 Upgrade
Profiler for HBase 2.0.2
URL: https://github.com/apache/metron/pull/1458#discussion_r311217688
##########
File path:
metron-analytics/metron-profiler-client/src/test/java/org/apache/metron/profiler/client/ProfileWriter.java
##########
@@ -17,109 +17,18 @@
* limitations under the License.
*
*/
-
package org.apache.metron.profiler.client;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseConfiguration;
-import org.apache.hadoop.hbase.client.Durability;
-import org.apache.hadoop.hbase.client.HTableInterface;
-import org.apache.metron.hbase.HTableProvider;
-import org.apache.metron.hbase.ColumnList;
-import org.apache.metron.hbase.client.LegacyHBaseClient;
import org.apache.metron.profiler.ProfileMeasurement;
-import org.apache.metron.profiler.ProfilePeriod;
-import org.apache.metron.profiler.hbase.ColumnBuilder;
-import org.apache.metron.profiler.hbase.RowKeyBuilder;
-import org.apache.metron.profiler.hbase.SaltyRowKeyBuilder;
-import org.apache.metron.profiler.hbase.ValueOnlyColumnBuilder;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Random;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Function;
/**
- * Writes ProfileMeasurement values that can be read during automated testing.
+ * Responsible for writing {@link ProfileMeasurement} values to persistent
storage.
*/
-public class ProfileWriter {
-
- private RowKeyBuilder rowKeyBuilder;
- private ColumnBuilder columnBuilder;
- private LegacyHBaseClient hbaseClient;
- private HBaseProfilerClient client;
-
- public ProfileWriter(RowKeyBuilder rowKeyBuilder, ColumnBuilder
columnBuilder, HTableInterface table, long periodDurationMillis) {
- this.rowKeyBuilder = rowKeyBuilder;
- this.columnBuilder = columnBuilder;
- this.hbaseClient = new LegacyHBaseClient((c, t) -> table,
table.getConfiguration(), table.getName().getNameAsString());
- this.client = new HBaseProfilerClient(table, rowKeyBuilder, columnBuilder,
periodDurationMillis);
- }
+public interface ProfileWriter {
Review comment:
This is actually legacy code that allowed us to backfill profiles from the
command-line for testing purposes. When the Batch Profiler was introduced this
should have been killed. We don't need the `main` any longer.
The `ProfileGenerator`, `ProfileWriter` and `HBaseProfileWriter` were
refactorings on this legacy functionality when I thought I might need "write"
functionality for the `HBaseClient` API. After additional work I found this
not be necessary.
I removed these unnecessary classes in commit 3e825c1cf.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services