Skip to content

Commit

Permalink
Merge pull request #655 from jpmcmu/HPCC4J-551
Browse files Browse the repository at this point in the history
HPCC4J-551 HPCCFile Make TLK Use Optional
  • Loading branch information
jpmcmu authored Nov 1, 2023
2 parents 2dc8279 + f0ec51e commit 99601b0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
28 changes: 28 additions & 0 deletions dfsclient/src/main/java/org/hpccsystems/dfs/client/HPCCFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,34 @@ public HPCCFile setClusterRemapInfo(RemapInfo remapinfo)
return this;
}

/**
* Get the value of useTLK option
*
* @return a boolean value indicating use of the TLK to filter index file reads
*/
public boolean getUseTLK()
{
return this.useTLK;
}

/**
* Sets the useTLK option.
* Note: the value must be set before querying any data from the file, including record definition information.
*
* @param useTLK should the TLK be used to filter index file reads
*
* @return this HPCCFile
*/
public HPCCFile setUseTLK(boolean useTLK)
{
this.useTLK = useTLK;

// Force the data parts to be re-created
this.dataParts = null;

return this;
}

/**
* Gets the filter.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,8 @@ public void tlkBypassTest() throws Exception
// Read index ignoring TLK and check that all partitions are returned
//------------------------------------------------------------------------------

Connection espConn = new Connection(connString);
espConn.setUserName(hpccUser);
espConn.setPassword(hpccPass);

HPCCFile file = new HPCCFile("~test::index::integer::key", espConn, "", "", new RemapInfo(), 0, "", false);
HPCCFile file = new HPCCFile("~test::index::integer::key", connString , hpccUser, hpccPass);
file.setUseTLK(false);
DataPartition[] dataParts = file.getFileParts();

Long searchValue = 3L;
Expand Down

0 comments on commit 99601b0

Please sign in to comment.