Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blocking tree changes #924

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

Nitish1814
Copy link
Contributor

blocking tree changes!

-> added path set in isHashFunctionUsed() to avoid recursive call at each node

@@ -0,0 +1,12 @@
package zingg.common.core.block;

public class HashFunctionUtilityFactory {

Check warning

Code scanning / PMD

This utility class has a non-private constructor Warning

This utility class has a non-private constructor
long blockSize, ListMap<T, HashFunction<D,R,C,T>> hashFunctions, IArguments args) {
ZFrame<D,R,C> sample = testData.sample(false, sampleFraction);
long totalCount = sample.count();
if (blockSize == -1) blockSize = Heuristics.getMaxBlockSize(totalCount, args.getBlockSize());

Check warning

Code scanning / PMD

This statement should have braces Warning test

This statement should have braces
long totalCount = sample.count();
if (blockSize == -1) blockSize = Heuristics.getMaxBlockSize(totalCount, args.getBlockSize());
positives = positives.coalesce(1);
Block<D,R,C,T> cblock = getBlock(sample, positives, hashFunctions, blockSize);

Check warning

Code scanning / PMD

Consider simply returning the value vs storing it in local variable 'sl' Warning test

Consider simply returning the value vs storing it in local variable 'cblock'
@@ -15,7 +22,18 @@
this.creator = creator;
}

public List<? extends IFromCsv> getRecords(String file, boolean skipHeader) throws FileNotFoundException{
//default constructor
public CsvReader() {

Check warning

Code scanning / PMD

Document empty constructor Warning test

Document empty constructor

public List<String[]> readDataFromSource(String source) throws IOException, CsvException {
CSVReader csvReader = getCSVReader(source);
List<String[]> allData = csvReader.readAll();

Check warning

Code scanning / PMD

Consider simply returning the value vs storing it in local variable 'sl' Warning test

Consider simply returning the value vs storing it in local variable 'allData'
@@ -25,4 +43,12 @@
return records;
}

private CSVReader getCSVReader(String source) throws IOException {
FileReader filereader = new FileReader(source);
CSVReader csvReader = new CSVReaderBuilder(filereader)

Check warning

Code scanning / PMD

Consider simply returning the value vs storing it in local variable 'sl' Warning test

Consider simply returning the value vs storing it in local variable 'csvReader'
@@ -8,6 +8,7 @@
import zingg.common.client.ZFrame;
import zingg.common.client.util.ListMap;
import zingg.common.core.block.Block;
import zingg.common.core.block.HashUtility;

Check warning

Code scanning / PMD

Unused import 'zingg.common.core.executor.TrainerValidator' Warning

Unused import 'zingg.common.core.block.HashUtility'
@@ -25,4 +45,13 @@
return records;
}

private CSVReader getCSVReader(String source) throws IOException, URISyntaxException {
File file = new File(Objects.requireNonNull(this.getClass().getClassLoader().getResource(source)).toURI());
FileReader filereader = new FileReader(file);

Check warning

Code scanning / PMD

Ensure that resources like this FileReader object are closed after use Warning test

Ensure that resources like this FileReader object are closed after use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant