Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
822 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
community/kernel/src/main/java/org/neo4j/kernel/api/legacyindex/AutoIndexOperations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/* | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.kernel.api.legacyindex; | ||
|
||
import java.util.Set; | ||
|
||
import org.neo4j.kernel.api.DataWriteOperations; | ||
import org.neo4j.kernel.api.exceptions.legacyindex.AutoIndexingKernelException; | ||
import org.neo4j.kernel.api.properties.Property; | ||
|
||
/** | ||
* Abstract interface for accessing legacy auto indexing facilities for a given type of entity (nodes or relationships) | ||
* | ||
* Instances have three main concerns: | ||
* - Controlling if auto indexing of the underlying entity type (node/relationship) is enabled or disabled | ||
* - Controlling which properties are being indexed currently | ||
* - Tracking updates | ||
* | ||
* @see AutoIndexing | ||
* @see org.neo4j.kernel.impl.api.legacyindex.InternalAutoIndexOperations | ||
*/ | ||
public interface AutoIndexOperations | ||
{ | ||
void propertyAdded( DataWriteOperations ops, long entityId, Property property ) throws AutoIndexingKernelException; | ||
void propertyChanged( DataWriteOperations ops, long entityId, Property oldProperty, Property newProperty ) | ||
throws AutoIndexingKernelException; | ||
void propertyRemoved( DataWriteOperations ops, long entityId, int propertyKey ) | ||
throws AutoIndexingKernelException; | ||
|
||
void entityRemoved( DataWriteOperations ops, long entityId ) throws AutoIndexingKernelException; | ||
|
||
boolean enabled(); | ||
void enabled( boolean enabled ); | ||
|
||
void startAutoIndexingProperty( String propName ); | ||
void stopAutoIndexingProperty( String propName ); | ||
|
||
Set<String> getAutoIndexedProperties(); | ||
|
||
/** | ||
* Instance of {@link AutoIndexOperations} that throws {@link UnsupportedOperationException} when any of its methods is invoked | ||
*/ | ||
AutoIndexOperations UNSUPPORTED = new AutoIndexOperations() | ||
{ | ||
@Override | ||
public void propertyAdded( DataWriteOperations ops, long entityId, Property property ) throws AutoIndexingKernelException | ||
{ | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public void propertyChanged( DataWriteOperations ops, long entityId, Property oldProperty, Property newProperty ) throws AutoIndexingKernelException | ||
{ | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public void propertyRemoved( DataWriteOperations ops, long entityId, int propertyKey ) throws | ||
AutoIndexingKernelException | ||
{ | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public void entityRemoved( DataWriteOperations ops, long entityId ) throws AutoIndexingKernelException | ||
{ | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public boolean enabled() | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
public void enabled( boolean enabled ) | ||
{ | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public void startAutoIndexingProperty( String propName ) | ||
{ | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public void stopAutoIndexingProperty( String propName ) | ||
{ | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public Set<String> getAutoIndexedProperties() | ||
{ | ||
throw new UnsupportedOperationException(); | ||
} | ||
}; | ||
} |
58 changes: 58 additions & 0 deletions
58
community/kernel/src/main/java/org/neo4j/kernel/api/legacyindex/AutoIndexing.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.kernel.api.legacyindex; | ||
|
||
/** | ||
* Abstract interface for accessing legacy auto indexing facilities for nodes and relationships | ||
* | ||
* @see AutoIndexOperations | ||
* @see org.neo4j.kernel.impl.api.legacyindex.InternalAutoIndexing | ||
*/ | ||
public interface AutoIndexing | ||
{ | ||
/** | ||
* An instance of {@link AutoIndexing} that only returns {@link AutoIndexOperations} | ||
* that throw {@link UnsupportedOperationException} when any method is invoked on them. | ||
*/ | ||
AutoIndexing UNSUPPORTED = new AutoIndexing() | ||
{ | ||
@Override | ||
public AutoIndexOperations nodes() | ||
{ | ||
return AutoIndexOperations.UNSUPPORTED; | ||
} | ||
|
||
@Override | ||
public AutoIndexOperations relationships() | ||
{ | ||
return AutoIndexOperations.UNSUPPORTED; | ||
} | ||
}; | ||
|
||
/** | ||
* @return {@link AutoIndexOperations} for nodes | ||
*/ | ||
AutoIndexOperations nodes(); | ||
|
||
/** | ||
* @return {@link AutoIndexOperations} for relationships | ||
*/ | ||
AutoIndexOperations relationships(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.