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

Feature/create summaries #2649

Open
wants to merge 7 commits into
base: integration
Choose a base branch
from
Open

Conversation

austin007008
Copy link
Collaborator

adds new functionality to create summaries for returned documents

@austin007008 austin007008 force-pushed the feature/create-summaries branch 2 times, most recently from 239efc1 to 16bfd93 Compare November 21, 2024 19:34
@austin007008 austin007008 force-pushed the feature/create-summaries branch 2 times, most recently from 0315e6e to de635db Compare December 4, 2024 13:03
@austin007008 austin007008 force-pushed the feature/create-summaries branch 3 times, most recently from 9137fb9 to 6186bcc Compare December 6, 2024 16:23
austin007008 and others added 3 commits December 6, 2024 17:49
working summaries created

fix test

reccomendations

trailing regex for name matching

remove unused import

parameters can be entered in any order
Re-generated AccumuloSyntaxParser.java from AccumuloSyntaxParser.jj using
a verson of javacc 4.1 build from https://github.com/javacc/javacc/tree/release_41
@austin007008 austin007008 force-pushed the feature/create-summaries branch from 6186bcc to 2c92f1c Compare December 6, 2024 17:49
Comment on lines 1557 to 1567
public String getSummaryIterator() {
return getConfig().getSummaryIterator().getName();
}

public void setSummaryIterator(String iteratorClass) {
try {
getConfig().setSummaryIterator((Class<? extends SortedKeyValueIterator<Key,Value>>) Class.forName(iteratorClass));
} catch (Exception e) {
throw new DatawaveFatalQueryException("Illegal d column summary iterator class", e);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually the iterator class name. Follow the pattern used by the create uids iterator, i.e., use getCreateUidsIteratorClass and setCreateUidsIteratorClass

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is like this so that the specified class can be easily changed (could be wrong about that though). See set/get ExcerptIterator


String queryString = "QUOTE:(farther) #SUMMARY(SIZE:-50)";

// not sure why the timestamp and delete flag are present
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we figure out why the timestamp and delete flag are present?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timestamp and delete flag will always be present as components of the key if we're using toString(), won't they?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk tbh. the layout of this test was taken from "ExcerptTest" and it had the same thing.

@austin007008 austin007008 force-pushed the feature/create-summaries branch from 2c92f1c to 2eac9ae Compare December 6, 2024 18:36

String queryString = "QUOTE:(farther) #SUMMARY(SIZE:-50)";

// not sure why the timestamp and delete flag are present
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timestamp and delete flag will always be present as components of the key if we're using toString(), won't they?

@drewfarris
Copy link
Collaborator

Looks like the builds might be failing due to a formatting issue - consider double checking this.

}
} catch (Exception e) {
log.warn("Unable to parse summary size string, returning empty SummaryOptions: {}", string, e);
return new SummaryOptions();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this should be a fatal rather that default situation?

Comment on lines +249 to +253
foundContent.put(currentViewName, source.getTopValue().get());
}
} else {
if (currentViewName.equalsIgnoreCase(name)) {
foundContent.put(currentViewName, source.getTopValue().get());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be a limit on the amount of content that will be added to prevent potential memory problems? This might also require some more configuration flags

Comment on lines +996 to +997
this.setSummaryOptions(summaryOptions);
config.setSummaryOptions(summaryOptions);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the config be updated in the call to setSummaryOptions()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants