use of edu.umd.cs.findbugs.annotations.Nullable in project hbase by apache.
the class MetaTableAccessor method getRegionsFromMergeQualifier.
/**
* Get regions from the merge qualifier of the specified merged region
* @return null if it doesn't contain merge qualifier, else two merge regions
* @throws IOException
*/
@Nullable
public static Pair<HRegionInfo, HRegionInfo> getRegionsFromMergeQualifier(Connection connection, byte[] regionName) throws IOException {
Result result = getRegionResult(connection, regionName);
HRegionInfo mergeA = getHRegionInfo(result, HConstants.MERGEA_QUALIFIER);
HRegionInfo mergeB = getHRegionInfo(result, HConstants.MERGEB_QUALIFIER);
if (mergeA == null && mergeB == null) {
return null;
}
return new Pair<>(mergeA, mergeB);
}
use of edu.umd.cs.findbugs.annotations.Nullable in project incubator-rya by apache.
the class MultiProjectionEvaluatorTest method getMultiProjection.
/**
* Get the first {@link MultiProjection} node from a SPARQL query.
*
* @param sparql - The query that contains a single Projection node.
* @return The first {@link MultiProjection} that is encountered.
* @throws Exception The query could not be parsed.
*/
@Nullable
public static MultiProjection getMultiProjection(final String sparql) throws Exception {
requireNonNull(sparql);
final AtomicReference<MultiProjection> multiProjection = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
parsed.getTupleExpr().visit(new QueryModelVisitorBase<Exception>() {
@Override
public void meet(final MultiProjection node) throws Exception {
multiProjection.set(node);
}
});
return multiProjection.get();
}
use of edu.umd.cs.findbugs.annotations.Nullable in project incubator-rya by apache.
the class ProjectionEvaluatorTest method getProjection.
/**
* Get the first {@link Projection} node from a SPARQL query.
*
* @param sparql - The query that contains a single Projection node.
* @return The first {@link Projection} that is encountered.
* @throws Exception The query could not be parsed.
*/
@Nullable
public static Projection getProjection(final String sparql) throws Exception {
requireNonNull(sparql);
final AtomicReference<Projection> projection = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
parsed.getTupleExpr().visit(new QueryModelVisitorBase<Exception>() {
@Override
public void meet(final Projection node) throws Exception {
projection.set(node);
}
});
return projection.get();
}
use of edu.umd.cs.findbugs.annotations.Nullable in project incubator-rya by apache.
the class RdfTestUtil method getMultiProjection.
/**
* Get the first {@link MultiProjection} node from a SPARQL query.
*
* @param sparql - The query that contains a single Projection node.
* @return The first {@link MultiProjection} that is encountered.
* @throws Exception The query could not be parsed.
*/
@Nullable
public static MultiProjection getMultiProjection(final String sparql) throws Exception {
requireNonNull(sparql);
final AtomicReference<MultiProjection> multiProjection = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
parsed.getTupleExpr().visit(new QueryModelVisitorBase<Exception>() {
@Override
public void meet(final MultiProjection node) throws Exception {
multiProjection.set(node);
}
});
return multiProjection.get();
}
use of edu.umd.cs.findbugs.annotations.Nullable in project incubator-rya by apache.
the class RdfTestUtil method getFilter.
/**
* Get the first {@link Filter} node from a SPARQL query.
*
* @param sparql - The query that contains a single Projection node.
* @return The first {@link Filter} that is encountered.
* @throws Exception The query could not be parsed.
*/
@Nullable
public static Filter getFilter(final String sparql) throws Exception {
requireNonNull(sparql);
final AtomicReference<Filter> filter = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
parsed.getTupleExpr().visit(new QueryModelVisitorBase<Exception>() {
@Override
public void meet(final Filter node) throws Exception {
filter.set(node);
}
});
return filter.get();
}
Aggregations