Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<maven.compiler.target>11</maven.compiler.target>
<hadoop.version>3.3.4</hadoop.version>
<hbase.version>2.4.15</hbase.version>
<mapr.version>6.1.0-mapr</mapr.version> </properties>
<mapr.version>6.1.0-mapr</mapr.version>
</properties>

<dependencies>
<dependency>
Expand All @@ -26,6 +27,13 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-mapreduce</artifactId>
<version>${hbase.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil;

public class AnonymizationPipelineDriver extends Configured implements Tool {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import com.mapr.health.util.SchemaUtility;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.mapreduce.TableMapper;
import org.apache.hadoop.hbase.mapreduce.TableMapper;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
Expand All @@ -26,9 +24,10 @@ public class PHIAnonymizationMapper
private final Text outputValue = new Text();

@Override
public void map(ImmutableBytesWritable rowKey, Result result, Context context)
public void map(ImmutableBytesWritable rowKey, Result result, TableMapper<Text, Text>.Context context)
throws IOException, InterruptedException {


// 1. Extract Raw PHI and Metadata
byte[] patientNameBytes = result.getValue(SchemaUtility.RAW_PHI_CF, SchemaUtility.PATIENT_NAME_COL);
byte[] visitDateBytes = result.getValue(SchemaUtility.METADATA_CF, SchemaUtility.VISIT_DATE_COL);
Expand All @@ -54,7 +53,6 @@ public void map(ImmutableBytesWritable rowKey, Result result, Context context)
// 3. Prepare output for temporary MapR-FS location
// Key: Hashed Patient ID
// Value: All non-PHI/Anonymized data that needs to be retained (e.g., VISIT_DATE)

outputKey.set(anonymizedId);
outputValue.set(visitDate);

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/mapr/health/job2/ArchivalTagReducer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.mapr.health.util.SchemaUtility;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.mapreduce.TableReducer;
import org.apache.hadoop.hbase.mapreduce.TableReducer;
import org.apache.hadoop.io.Text;

import java.io.IOException;
Expand All @@ -17,7 +17,7 @@ public class ArchivalTagReducer
extends TableReducer<Text, Text, ImmutableBytesWritable> {

@Override
public void reduce(Text key, Iterable<Text> values, Context context)
public void reduce(Text key, Iterable<Text> values, TableReducer<Text, Text, ImmutableBytesWritable>.Context context)
throws IOException, InterruptedException {

// The key is the final RowKey: AnonymizedID_VisitDate
Expand Down