Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
720957e8
Commit
720957e8
authored
Jun 11, 2015
by
Suma Shivaprasad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to pass a set of type change listeners through Guice
parent
8f9dec9d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
14 deletions
+15
-14
pom.xml
pom.xml
+5
-5
RepositoryMetadataModule.java
.../main/java/org/apache/atlas/RepositoryMetadataModule.java
+2
-8
GraphBackedSearchIndexer.java
...ache/atlas/repository/graph/GraphBackedSearchIndexer.java
+8
-1
No files found.
pom.xml
View file @
720957e8
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
<log4j.version>
1.2.17
</log4j.version>
<log4j.version>
1.2.17
</log4j.version>
<akka.version>
2.3.7
</akka.version>
<akka.version>
2.3.7
</akka.version>
<spray.version>
1.3.1
</spray.version>
<spray.version>
1.3.1
</spray.version>
<guava.version>
1
1.0.2
</guava.version>
<guava.version>
1
4.0
</guava.version>
<fastutil.version>
6.5.16
</fastutil.version>
<fastutil.version>
6.5.16
</fastutil.version>
<PermGen>
64m
</PermGen>
<PermGen>
64m
</PermGen>
...
@@ -317,25 +317,25 @@
...
@@ -317,25 +317,25 @@
<dependency>
<dependency>
<groupId>
com.google.inject
</groupId>
<groupId>
com.google.inject
</groupId>
<artifactId>
guice
</artifactId>
<artifactId>
guice
</artifactId>
<version>
3
.0
</version>
<version>
4
.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.google.inject.extensions
</groupId>
<groupId>
com.google.inject.extensions
</groupId>
<artifactId>
guice-throwingproviders
</artifactId>
<artifactId>
guice-throwingproviders
</artifactId>
<version>
3
.0
</version>
<version>
4
.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.google.inject.extensions
</groupId>
<groupId>
com.google.inject.extensions
</groupId>
<artifactId>
guice-multibindings
</artifactId>
<artifactId>
guice-multibindings
</artifactId>
<version>
3
.0
</version>
<version>
4
.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.google.inject.extensions
</groupId>
<groupId>
com.google.inject.extensions
</groupId>
<artifactId>
guice-servlet
</artifactId>
<artifactId>
guice-servlet
</artifactId>
<version>
3
.0
</version>
<version>
4
.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
...
repository/src/main/java/org/apache/atlas/RepositoryMetadataModule.java
View file @
720957e8
...
@@ -45,7 +45,6 @@ import org.apache.atlas.services.MetadataService;
...
@@ -45,7 +45,6 @@ import org.apache.atlas.services.MetadataService;
* Guice module for Repository module.
* Guice module for Repository module.
*/
*/
public
class
RepositoryMetadataModule
extends
com
.
google
.
inject
.
AbstractModule
{
public
class
RepositoryMetadataModule
extends
com
.
google
.
inject
.
AbstractModule
{
private
Multibinder
<
Provider
<
TypesChangeListener
>>
typesChangeListenerBinder
;
@Override
@Override
protected
void
configure
()
{
protected
void
configure
()
{
...
@@ -63,13 +62,8 @@ public class RepositoryMetadataModule extends com.google.inject.AbstractModule {
...
@@ -63,13 +62,8 @@ public class RepositoryMetadataModule extends com.google.inject.AbstractModule {
// bind the ITypeStore interface to an implementation
// bind the ITypeStore interface to an implementation
bind
(
ITypeStore
.
class
).
to
(
GraphBackedTypeStore
.
class
).
asEagerSingleton
();
bind
(
ITypeStore
.
class
).
to
(
GraphBackedTypeStore
.
class
).
asEagerSingleton
();
// bind the GraphService interface to an implementation
Multibinder
<
TypesChangeListener
>
typesChangeListenerBinder
=
Multibinder
.
newSetBinder
(
binder
(),
TypesChangeListener
.
class
);
// bind(GraphService.class).to(graphServiceClass);
typesChangeListenerBinder
.
addBinding
().
toProvider
(
GraphBackedSearchIndexer
.
class
);
typesChangeListenerBinder
=
Multibinder
.
newSetBinder
(
binder
(),
new
TypeLiteral
<
TypesChangeListener
>());
typesChangeListenerBinder
.
addBinding
().
to
(
GraphBackedSearchIndexer
.
class
);
bind
(
TypesChangeListener
.
class
).
to
(
GraphBackedSearchIndexer
.
class
);
// bind the MetadataService interface to an implementation
// bind the MetadataService interface to an implementation
bind
(
MetadataService
.
class
).
to
(
DefaultMetadataService
.
class
).
asEagerSingleton
();
bind
(
MetadataService
.
class
).
to
(
DefaultMetadataService
.
class
).
asEagerSingleton
();
...
...
repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
View file @
720957e8
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
package
org
.
apache
.
atlas
.
repository
.
graph
;
package
org
.
apache
.
atlas
.
repository
.
graph
;
import
com.google.inject.Provider
;
import
com.thinkaurelius.titan.core.Cardinality
;
import
com.thinkaurelius.titan.core.Cardinality
;
import
com.thinkaurelius.titan.core.PropertyKey
;
import
com.thinkaurelius.titan.core.PropertyKey
;
import
com.thinkaurelius.titan.core.TitanGraph
;
import
com.thinkaurelius.titan.core.TitanGraph
;
...
@@ -28,6 +29,7 @@ import com.tinkerpop.blueprints.Edge;
...
@@ -28,6 +29,7 @@ import com.tinkerpop.blueprints.Edge;
import
com.tinkerpop.blueprints.Vertex
;
import
com.tinkerpop.blueprints.Vertex
;
import
org.apache.atlas.MetadataException
;
import
org.apache.atlas.MetadataException
;
import
org.apache.atlas.discovery.SearchIndexer
;
import
org.apache.atlas.discovery.SearchIndexer
;
import
org.apache.atlas.listener.TypesChangeListener
;
import
org.apache.atlas.repository.Constants
;
import
org.apache.atlas.repository.Constants
;
import
org.apache.atlas.repository.IndexCreationException
;
import
org.apache.atlas.repository.IndexCreationException
;
import
org.apache.atlas.repository.IndexException
;
import
org.apache.atlas.repository.IndexException
;
...
@@ -51,7 +53,7 @@ import java.util.Map;
...
@@ -51,7 +53,7 @@ import java.util.Map;
/**
/**
* Adds index for properties of a given type when its added before any instances are added.
* Adds index for properties of a given type when its added before any instances are added.
*/
*/
public
class
GraphBackedSearchIndexer
implements
SearchIndexer
{
public
class
GraphBackedSearchIndexer
implements
SearchIndexer
,
Provider
<
TypesChangeListener
>
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
GraphBackedSearchIndexer
.
class
);
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
GraphBackedSearchIndexer
.
class
);
...
@@ -368,6 +370,11 @@ public class GraphBackedSearchIndexer implements SearchIndexer {
...
@@ -368,6 +370,11 @@ public class GraphBackedSearchIndexer implements SearchIndexer {
}
}
}
}
@Override
public
TypesChangeListener
get
()
{
return
this
;
}
/* Commenting this out since we do not need an index for edge label here
/* Commenting this out since we do not need an index for edge label here
private void createEdgeMixedIndex(String propertyName) {
private void createEdgeMixedIndex(String propertyName) {
EdgeLabel edgeLabel = management.getEdgeLabel(propertyName);
EdgeLabel edgeLabel = management.getEdgeLabel(propertyName);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment