-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added fake datastore and service key store so kairos can run in pure …
…remote mode.
- Loading branch information
Showing
6 changed files
with
122 additions
and
2 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
55 changes: 55 additions & 0 deletions
55
src/main/java/org/kairosdb/plugin/remote/FakeDatastore.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,55 @@ | ||
package org.kairosdb.plugin.remote; | ||
|
||
import org.kairosdb.core.datastore.Datastore; | ||
import org.kairosdb.core.datastore.DatastoreMetricQuery; | ||
import org.kairosdb.core.datastore.QueryCallback; | ||
import org.kairosdb.core.datastore.TagSet; | ||
import org.kairosdb.core.datastore.TagSetImpl; | ||
import org.kairosdb.core.exception.DatastoreException; | ||
|
||
import java.util.Collections; | ||
|
||
public class FakeDatastore implements Datastore | ||
{ | ||
@Override | ||
public void close() throws InterruptedException, DatastoreException | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public Iterable<String> getMetricNames(String prefix) throws DatastoreException | ||
{ | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public Iterable<String> getTagNames() throws DatastoreException | ||
{ | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public Iterable<String> getTagValues() throws DatastoreException | ||
{ | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public void queryDatabase(DatastoreMetricQuery query, QueryCallback queryCallback) throws DatastoreException | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public void deleteDataPoints(DatastoreMetricQuery deleteQuery) throws DatastoreException | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public TagSet queryMetricTags(DatastoreMetricQuery query) throws DatastoreException | ||
{ | ||
return new TagSetImpl(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/kairosdb/plugin/remote/FakeDatastoreModule.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,17 @@ | ||
package org.kairosdb.plugin.remote; | ||
|
||
import com.google.inject.AbstractModule; | ||
import com.google.inject.Scopes; | ||
import org.kairosdb.core.datastore.Datastore; | ||
import org.kairosdb.core.datastore.ServiceKeyStore; | ||
|
||
public class FakeDatastoreModule extends AbstractModule | ||
|
||
{ | ||
@Override | ||
protected void configure() | ||
{ | ||
bind(Datastore.class).to(FakeDatastore.class).in(Scopes.SINGLETON); | ||
bind(ServiceKeyStore.class).to(FakeServiceKeyStore.class).in(Scopes.SINGLETON); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
src/main/java/org/kairosdb/plugin/remote/FakeServiceKeyStore.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,45 @@ | ||
package org.kairosdb.plugin.remote; | ||
|
||
import org.kairosdb.core.datastore.ServiceKeyStore; | ||
import org.kairosdb.core.exception.DatastoreException; | ||
|
||
import java.util.Collections; | ||
|
||
public class FakeServiceKeyStore implements ServiceKeyStore | ||
{ | ||
@Override | ||
public void setValue(String service, String serviceKey, String key, String value) throws DatastoreException | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public String getValue(String service, String serviceKey, String key) throws DatastoreException | ||
{ | ||
return null; | ||
} | ||
|
||
@Override | ||
public Iterable<String> listServiceKeys(String service) throws DatastoreException | ||
{ | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public Iterable<String> listKeys(String service, String serviceKey) throws DatastoreException | ||
{ | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public Iterable<String> listKeys(String service, String serviceKey, String keyStartsWith) throws DatastoreException | ||
{ | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public void deleteKey(String service, String serviceKey, String key) throws DatastoreException | ||
{ | ||
|
||
} | ||
} |
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