Skip to content

Commit

Permalink
Gh 2552 remove deprecated (#2564)
Browse files Browse the repository at this point in the history
* gh-2552: Removed deprecated code except getTraits and hasTrait

* gh-2552: Fix javadoc issue

* gh-2571: Fixed matchedVertex behaviour and added new ITs (#2572)

* gh-2571: Fixed matchedVertex behaviour and added new ITs

* gh-2571: Fixed checkstyle

* gh-2571: Updated test name

* gh-2573: Replace hasTrait usages with Operation (#2574)

* gh-2573: Replace hasTrait usages with Operation

* gh-2573: Fix tests by making exception more explicit

* gh-2573: Fixed exception issues

* gh-2573: Simplified but still failing test

* gh-2573: Changed to user

* gh-2573: Changed FederatedGetTraitsHandler to return DYNAMIC_SCHEMA

* gh-2573: Use old function for FederatedOperationChainValidator

* gh-2573: Fixed FederatedStoreUtil

* gh-2573: Added Deprecation notice

* gh-2573: Cherry pick federated store tests fix from 2553

* Revert "gh-2573: Cherry pick federated store tests fix from 2553"

This reverts commit c367555.

* gh-2573: Manual fix of FederatedStoreGetTraitsTest cache

* gh-2573: Changed HasTraitHandler to not send Federated loop option

* Gh-2560 get traits operation configurable (#2579)

* Update docs links in README

* Revert "Update docs links in README"

This reverts commit 2d87bf3.

* gh-2559 added hasTrait, its handler and corresponding tests (#2561)

* gh-2559 added hasTrait, its handler and corresponding tests

* gh-2559 amended comment in HasTrait, added additional tests for the handler

* gh-2559 null check & tidy test

Co-authored-by: t92549 <80890692+t92549@users.noreply.github.com>

* Update links to Gaffer docs in all files (#2566)

Co-authored-by: t92549 <80890692+t92549@users.noreply.github.com>

* gh-2560 GetTraitsHandler is initalised with traits dependednt on store type

* gh-2560 reviewed comments

* gh-2560 unused imports

* gh-2560 review comments

* checkstyle

* gh-2560 fixed federated test

* gh-2560 fixed GraphTest

* gh-2560 fixed TestStore

* gh-2560-getTraitsOperation (#2582)

Removing redundant adding of GetTraitHandler from addAdditionalOperationHandlers() because it has its own method getGetTraitsHandler().

* gh-2560: Added fix to SingleUseMapStoreWithoutVisibilitySupport

* gh-2560: Fixed Set copy issue in GetTraitsHandler constructor

* gh-2560: Added extra protections to GetTraitsHandler

Co-authored-by: GCHQDeveloper314 <94527357+GCHQDeveloper314@users.noreply.github.com>
Co-authored-by: t92549 <80890692+t92549@users.noreply.github.com>
Co-authored-by: GCHQDev404 <45399082+GCHQDev404@users.noreply.github.com>

* gh-2552: Removed some remaining parquet properties files

* gh-2552: Review comments traits test

* gh-2552-remove-deprecated MultiSerialiser (#2587)

* gh-2552-remove-deprecated MultiSerialiser

update the MultiSerialiser wanting to emphasise the effectiveness of it during the deprecation of serialisers.
8 is the last and best.
24 is not latest regardless of natural-order.
7 is dead.

* gh-2552: MultiSerialiser spelling corrections

* Update core/serialisation/src/main/java/uk/gov/gchq/gaffer/serialisation/implementation/MultiSerialiser.java

Co-authored-by: t92549 <80890692+t92549@users.noreply.github.com>

Co-authored-by: p3430233 <61738524+p3430233@users.noreply.github.com>
Co-authored-by: GCHQDeveloper314 <94527357+GCHQDeveloper314@users.noreply.github.com>
Co-authored-by: GCHQDev404 <45399082+GCHQDev404@users.noreply.github.com>
  • Loading branch information
4 people committed Feb 23, 2022
1 parent 6c0be90 commit dd18afb
Show file tree
Hide file tree
Showing 409 changed files with 1,181 additions and 32,123 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ jobs:
values: :gaffer2,:core,:access,:cache,:common-util,:data,:exception,:graph,:operation,:serialisation,:store,:type
- name: Accumulo
values: :accumulo-store,:accumulo-rest
- name: Hbase
values: :hbase-store,:hbase-rest
- name: Parquet
values: :parquet-store,:parquet-rest
- name: Federated-And-Map
values: :integration-test,:federated-store,:map-store,:map-rest
- name: REST
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static java.util.Collections.emptyList;

Expand Down Expand Up @@ -147,11 +146,6 @@ public List<String> getWriteAccessRoles() {
return writeAccessRoles;
}

@Deprecated
public boolean hasWriteAccess(final String userId, final Set<String> opAuths, final String adminAuth) {
return hasWriteAccess(new User.Builder().userId(userId).opAuths(opAuths).build(), adminAuth);
}

@Override
public ResourceType getResourceType() {
return ResourceType.NamedView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,6 @@ public ElementAggregator getAggregator() {
return aggregator;
}

/**
* Sets the aggregator
*
* @param aggregator the aggregator to set.
* @deprecated a {@link ViewElementDefinition} should be constructed using the
* {@link uk.gov.gchq.gaffer.data.elementdefinition.view.ViewElementDefinition.Builder}.
*/
@Deprecated
public void setAggregator(final ElementAggregator aggregator) {
this.aggregator = aggregator;
}

@JsonIgnore
public ElementFilter getPostAggregationFilter() {
return postAggregationFilter;
Expand Down
4 changes: 3 additions & 1 deletion core/graph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ Here is an example of a `GraphConfig`:

```java
new GraphConfig.Builder()
.graphId("exampleGraphId")
.config(new GraphConfig.Builder()
.graphId("exampleGraphId")
.build())
.description("Example Graph description")
.view(new View.Builder()
.globalElements(new GlobalViewElementDefinition.Builder()
Expand Down
148 changes: 1 addition & 147 deletions core/graph/src/main/java/uk/gov/gchq/gaffer/graph/Graph.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package uk.gov.gchq.gaffer.graph;

import com.google.common.collect.Lists;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -444,21 +443,14 @@ public String getDescription() {
return config.getDescription();
}

/**
* @param storeTrait the store trait to check
* @return true if the store has the given trait.
*/
public boolean hasTrait(final StoreTrait storeTrait) {
return store.hasTrait(storeTrait);
}

/**
* Returns all the {@link StoreTrait}s for the contained {@link Store}
* implementation
*
* @return a {@link Set} of all of the {@link StoreTrait}s that the store
* has.
*/
@Deprecated
public Set<StoreTrait> getStoreTraits() {
return store.getTraits();
}
Expand Down Expand Up @@ -526,17 +518,6 @@ public static class Builder {
private String parentStorePropertiesId;
private boolean addToLibrary = true;

/**
* @param graphId the graph id to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder graphId(final String graphId) {
configBuilder.graphId(graphId);
return this;
}

public Builder config(final Path path) {
configBuilder.json(path);
return this;
Expand Down Expand Up @@ -567,72 +548,6 @@ public Builder addToLibrary(final boolean addToLibrary) {
return this;
}

/**
* @param library the graph library to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder library(final GraphLibrary library) {
configBuilder.library(library);
return this;
}

/**
* @param view the graph view to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder view(final View view) {
configBuilder.view(view);
return this;
}

/**
* @param view the graph view path to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder view(final Path view) {
configBuilder.view(view);
return this;
}

/**
* @param view the graph view input stream to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder view(final InputStream view) {
configBuilder.view(view);
return this;
}

/**
* @param view the graph view URI to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder view(final URI view) {
configBuilder.view(view);
return this;
}

/**
* @param jsonBytes the graph view json bytes to set
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder view(final byte[] jsonBytes) {
configBuilder.view(jsonBytes);
return this;
}

public Builder description(final String description) {
configBuilder.description(description);
return this;
Expand Down Expand Up @@ -885,67 +800,6 @@ public Builder store(final Store store) {
return this;
}

/**
* @param hooksPath the graph hooks path
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder addHooks(final Path hooksPath) {
if (null == hooksPath || !hooksPath.toFile().exists()) {
throw new IllegalArgumentException("Unable to find graph hooks file: " + hooksPath);
}
final GraphHook[] hooks;
try {
hooks = JSONSerialiser.deserialise(FileUtils.readFileToByteArray(hooksPath.toFile()), GraphHook[].class);
} catch (final IOException e) {
throw new IllegalArgumentException("Unable to load graph hooks file: " + hooksPath, e);
}
return addHooks(hooks);
}

/**
* @param hookPath the graph hook path
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder addHook(final Path hookPath) {
if (null == hookPath || !hookPath.toFile().exists()) {
throw new IllegalArgumentException("Unable to find graph hook file: " + hookPath);
}

final GraphHook hook;
try {
hook = JSONSerialiser.deserialise(FileUtils.readFileToByteArray(hookPath.toFile()), GraphHook.class);
} catch (final IOException e) {
throw new IllegalArgumentException("Unable to load graph hook file: " + hookPath, e);
}
return addHook(hook);
}

/**
* @param graphHook the graph hook to add
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder addHook(final GraphHook graphHook) {
configBuilder.addHook(graphHook);
return this;
}

/**
* @param graphHooks the graph hooks to add
* @return this Builder
* @deprecated use Builder.config instead.
*/
@Deprecated
public Builder addHooks(final GraphHook... graphHooks) {
configBuilder.addHooks(graphHooks);
return this;
}

public Graph build() {
final GraphConfig config = configBuilder.build();
if (null == config.getLibrary()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public Builder merge(final GraphConfig config) {
if (null != config.getView()) {
this.config.setView(config.getView());
}
if (null != config.getLibrary()) {
if (null != config.getLibrary() && !(config.getLibrary() instanceof NoGraphLibrary)) {
this.config.setLibrary(config.getLibrary());
}
if (null != config.getDescription()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@
import org.slf4j.LoggerFactory;

import uk.gov.gchq.gaffer.commonutil.StreamUtil;
import uk.gov.gchq.gaffer.core.exception.GafferRuntimeException;
import uk.gov.gchq.gaffer.graph.Graph;
import uk.gov.gchq.gaffer.graph.GraphConfig;
import uk.gov.gchq.gaffer.operation.OperationException;
import uk.gov.gchq.gaffer.store.Context;
import uk.gov.gchq.gaffer.store.StoreTrait;
import uk.gov.gchq.gaffer.store.operation.HasTrait;
import uk.gov.gchq.gaffer.store.schema.Schema;
import uk.gov.gchq.gaffer.store.schema.TypeDefinition;
import uk.gov.gchq.koryphe.impl.predicate.AgeOff;
Expand Down Expand Up @@ -52,7 +56,17 @@ public static Graph createGraph(final String graphId, final String cacheStorePro
.addSchema(createSchema(timeToLive));

final Graph graph = graphBuilder.build();
if (!graph.hasTrait(StoreTrait.STORE_VALIDATION)) {

Boolean hasStoreValidation;
try {
hasStoreValidation = graph.execute(new HasTrait.Builder()
.trait(StoreTrait.STORE_VALIDATION)
.currentTraits(false)
.build(), new Context());
} catch (final OperationException e) {
throw new GafferRuntimeException("Error performing HasTrait Operation while creating Graph.", e);
}
if (null == hasStoreValidation || !hasStoreValidation) {
LOGGER.warn("Gaffer JSON export graph does not have {} trait so results may not be aged off.", StoreTrait.STORE_VALIDATION.name());
}

Expand Down
Loading

0 comments on commit dd18afb

Please sign in to comment.