Skip to content

implementation of redis datastore#1454

Merged
rfecher merged 7 commits intolocationtech:masterfrom
rfecher:redis-rebase
Nov 2, 2018
Merged

implementation of redis datastore#1454
rfecher merged 7 commits intolocationtech:masterfrom
rfecher:redis-rebase

Conversation

@rfecher
Copy link
Copy Markdown
Contributor

@rfecher rfecher commented Oct 31, 2018

No description provided.

Copy link
Copy Markdown
Contributor

@jdgarrett jdgarrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly extra comments need to be addressed. There was one TODO that could affect mergeData, and one issue with the RedisStoreTestEnvironment.

private Iterator<T> transformAndFilter(
final Collection<ScoredEntry<GeoWaveRedisPersistedRow>> result,
final byte[] partitionKey ) {
// final List<ScoredEntry<GeoWaveRedisPersistedRow>> list = new
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed comment block?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, removing

public class RedisOperations implements
MapReduceDataStoreOperations
{
// private final static int WRITE_RESPONSE_THREAD_SIZE = 16;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, yeah another block to remove

gwNamespace = options.getGeowaveNamespace();
}
this.options = options;
// this.options = options;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

private void deleteByPattern(
final String pattern ) {
final RKeys keySet = client.getKeys();
// final String[] keys = Iterators.toArray(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code

@Override
public void close()
throws Exception {
// TODO its unclear whether this is necessary
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is necessary, it may need to be done on flush() as well to make sure the delete happens before the write when merging rows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I agree, I actually did look at this unnecessary block of code and debated deleting it a couple times - I should write some test to see if its necessary and then either delete or not

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrote some code - its unncecessary

RedisServer server= RedisServer.builder().port(
				6379).setting(
				"bind 127.0.0.1") // secure + prevents popups on Windows
				.setting(
						"maxmemory 512M")
				.setting(
						"timeout 30000")
				.build();
		server.start();
		Config config = new Config();
		config.useSingleServer().setAddress("redis://127.0.0.1:6379");
		
		RedissonClient r = Redisson.create(config);
		r.getKeys().getKeys().forEach(k -> System.err.println(k));
		
		RList list = r.getList("test");

		System.err.println("1");
		r.getKeys().getKeys().forEach(k -> System.err.println(k));
		list.add(new Integer(100));
		System.err.println("2");
		r.getKeys().getKeys().forEach(k -> System.err.println(k));
		list.remove(new Integer(100));
		r.getKeys().getKeys().forEach(k -> System.err.println(k));
		System.err.println("3");
		list.delete();
		System.err.println("4");
		r.getKeys().getKeys().forEach(k -> System.err.println(k));
		server.stop();

produces:
1
2
test
3
4

public static Collection<ScoredEntry<GeoWaveRedisPersistedRow>> groupByRow(
final Collection<ScoredEntry<GeoWaveRedisPersistedRow>> result,
final boolean sortByTime ) {
// final List<ScoredEntry<GeoWaveRedisPersistedRow>> list = new
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing


@Override
public void setup() {
// DynamoDB IT's rely on an external dynamo local process
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dynamodb comment


@Override
protected GeoWaveStoreType getStoreType() {
return GeoWaveStoreType.DYNAMODB;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be REDIS?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently thats fairly unnecessary

@rfecher rfecher merged commit 42acd02 into locationtech:master Nov 2, 2018
@rfecher rfecher deleted the redis-rebase branch November 2, 2018 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants