|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectanonymizer.Anonymizer
mondrian.Mondrian
public class Mondrian
Implementation of the Mondrian multi-dimensional partitioning algorithm for satisfying k-anonymity described in the following paper:
@article{mondrian, author = {Kristen Lefevre and David J. Dewitt and Raghu Ramakrishnan}, title = {Mondrian multidimensional k-anonymity}, booktitle = {In ICDE}, year = {2006} }Our dimension selection heuristic is the one described in Section 4 of the paper. Namely, at each iteration, we "choose the dimension with the widest (normalized) range of values". When multiple dimensions have the same width, our implementation chooses the first dimension that contains an allowable cut. Given dimension, partitions are built by splitting the domain on the median value. If med represents the median, LHS contains all values <= med and RHS contains all values > med.
Field Summary | |
---|---|
private java.lang.String[] |
suppEq
Generalized values for the suppression equivalence |
Fields inherited from class anonymizer.Anonymizer |
---|
anonTable, conf, eqTable, sqlwrapper, suppressionThreshold |
Constructor Summary | |
---|---|
Mondrian(Configuration conf)
Class constructor |
Method Summary | |
---|---|
void |
anonymize()
Anonymizes the input. |
void |
changeKAnonymityRequirement(int newKvalue)
Overwrites the privacy parameter k |
protected AnonRecordTable |
createAnonRecordsTable(java.lang.String tableName)
Create anonRecords table |
protected EquivalenceTable |
createEquivalenceTable(java.lang.String tableName)
Create equivalence table |
java.lang.Double |
getMedian(long eid,
int att)
Computes the median value on attribute indexed att for equivalence with ID eid |
private double |
getNormalizedWidth(java.lang.String gen,
java.lang.String sup)
Calculates the normalized width of a generalized value, based on the suppression value |
protected void |
insertTupleToAnonTable(java.lang.String[] vals,
long eid)
Insert a tuple to the anonRecords table |
protected long |
insertTupleToEquivalenceTable(java.lang.String[] vals)
Insert a tuple to the equivalence table |
private void |
updateEIDs(long oldEID,
long newEID,
Interval range,
int index)
Updates the EIDs of equivalences with EID = oldEID to newEID if the predicate indicated by the interval is satisfied on the qi-attribute at the specified index |
Methods inherited from class anonymizer.Anonymizer |
---|
anonymizeDataset, anonymizeDataset, isReadyForSuppression, main, outputResults_Anatomy, outputResults_GenVals, outputResults_GenValsDist, outputResults, readData, suppressEquivalences |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String[] suppEq
Constructor Detail |
---|
public Mondrian(Configuration conf) throws java.lang.Exception
conf
- Configuration instance
java.lang.Exception
Method Detail |
---|
public void changeKAnonymityRequirement(int newKvalue)
newKvalue
- New value of kprotected AnonRecordTable createAnonRecordsTable(java.lang.String tableName)
createAnonRecordsTable
in class Anonymizer
tableName
- Name of the table
protected EquivalenceTable createEquivalenceTable(java.lang.String tableName)
createEquivalenceTable
in class Anonymizer
tableName
- Name of the table
protected long insertTupleToEquivalenceTable(java.lang.String[] vals) throws java.lang.Exception
insertTupleToEquivalenceTable
in class Anonymizer
vals
- All values of the tuple to be inserted (as read from the source, i.e., before any generalization)
java.lang.Exception
protected void insertTupleToAnonTable(java.lang.String[] vals, long eid) throws java.lang.Exception
insertTupleToAnonTable
in class Anonymizer
vals
- All values of the tuple to be inserted (as read from the source, i.e., before any generalization)eid
- Equivalence id of the equivalence to which the tuple belongs
java.lang.Exception
public void anonymize() throws java.lang.Exception
anonymize
in class Anonymizer
java.lang.Exception
private double getNormalizedWidth(java.lang.String gen, java.lang.String sup) throws java.lang.Exception
gen
- String representation of the generalization intervalsup
- String representation of the suppresion interval (i.e., the entire domain)
java.lang.Exception
private void updateEIDs(long oldEID, long newEID, Interval range, int index)
oldEID
- ID of the equivalence being splitnewEID
- New ID assigned to those records matching the rangerange
- The interval that specifies the new range on newEID for attribute at indexindex
- Index of the partitioning dimensionpublic java.lang.Double getMedian(long eid, int att) throws java.lang.Exception
eid
- Equivalence IDatt
- An attribute index
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |