Skip to content

Conversation

@mgobec
Copy link
Member

@mgobec mgobec commented Jun 6, 2017

Changes towards 2.0.0 version
Switching to actors and decoupling of components

mgobec added 5 commits May 30, 2017 10:20
Guardian actors
Reporter and module actor
Subscriptions and message types
Initial patching
}

/**
* * Create actor props from class type without {@code Configuration} parameter.
Copy link

Choose a reason for hiding this comment

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

How without config param when it is second argument in method?

/**
* Measurement tags.
*/
public final Map<String, String> tags;
Copy link

Choose a reason for hiding this comment

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

Shouldn't it be better to have Map<String, Object> tags instead of Map<String, String>?

Copy link
Member Author

Choose a reason for hiding this comment

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

We discussed about this. It does make sense for it to be <String, Object> but these changes should be implemented after the switch to actors.

/**
* Measurement fields.
*/
public final Map<String, String> fields;
Copy link

Choose a reason for hiding this comment

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

Same comment as for tags

* @return JSON-formatted string representation of measurement.
*/
public String toJson() {
return "{\"name\":\"" + name + "\"" + ",\"type\":\"" + type + "\"" + ",\"value\":" + value + ",\"time\":" + time
Copy link

@vajda vajda Jun 12, 2017

Choose a reason for hiding this comment

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

Why not use Jackson or some other library to convert value to JSON instead of coding it?

(reporter) -> mediator.tell(new DistributedPubSubMediator.Publish(reporter, measurement), getSelf()));
}

private void terminate() {
Copy link

Choose a reason for hiding this comment

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

Why is terminate private and other methods are protected (stop, start, process) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is an internal call for ModuleActor termination and there is no need for it to be public. The function itself is missing and will be added.

/**
* Connector implementation.
*/
public class ConnectorProxyImpl implements ConnectorProxy {
Copy link

@vajda vajda Jun 12, 2017

Choose a reason for hiding this comment

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

It might be personal, but I don't like implementation classes having *Impl sufix. This does not explain anything specific to this concrete implementation. If there is nothing specific for this implementation, it is better to call it DefaultConnectorProxy or BasicConnectorProxy

Copy link
Member Author

Choose a reason for hiding this comment

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

Personally I prefer IConnectorProxy naming of interfaces where the default implementation would then be ConnectorProxy.

.named("org.apache.cassandra.cql3.QueryProcessor");

// Transformer for QueryProcessor
final ByteBuddy byteBuddy = new ByteBuddy().with(Implementation.Context.Disabled.Factory.INSTANCE);
Copy link

Choose a reason for hiding this comment

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

What is Implementation.Context.Disabled.Factory.INSTANCE ?


private static final Logger logger = LoggerFactory.getLogger(ConnectorProxyImpl.class);

private static QueryProcessorWrapper queryProcessorWrapper;
Copy link

Choose a reason for hiding this comment

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

Why are those fields static?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because of funky bytebuddy initialization. I'll add an issue to switch to a much newer version of bytebuddy when this part of the work is done.

/**
* Connector proxy implementation.
*/
public class ConnectorProxyImpl implements ConnectorProxy {
Copy link

Choose a reason for hiding this comment

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

Same comment for naming as for ConnectorProxyImpl within cassandra 2.1

initEndpoints();
nodeGuardian.tell(new Command.Start(), null);

// this.diagnosticsProcessor = new DiagnosticsProcessor(config);
Copy link

Choose a reason for hiding this comment

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

Why is this commented out? If it is not needed, we should remove it.

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.

3 participants