-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-3610] Cluster Raft module design #3183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
zeppelin-interpreter/pom.xml
Outdated
| <version>${atomix.version}</version> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>io.netty</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the netty version of io.atomic and instead use another version of netty ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If don't modify the dependencies, compiling the zengine module will fail, I won't know how to fix it.
[INFO] Zeppelin: Zengine .................................. FAILURE [ 3.343 s]
[INFO] Zeppelin: Server 0.9.0-SNAPSHOT .................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:27 min
[INFO] Finished at: 2018-09-20T10:05:32+08:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "hadoop-2.7" could not be activated because it does not exist.
[WARNING] The requested profile "yarn" could not be activated because it does not exist.
[WARNING] The requested profile "pyspark" could not be activated because it does not exist.
[WARNING] The requested profile "sparkr" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (enforce) on project zeppelin-zengine: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
[ERROR] Failed while enforcing releasability the error(s) are [
[ERROR] Dependency convergence error for com.google.guava:guava:22.0 paths to dependency are:
[ERROR] +-org.apache.zeppelin:zeppelin-zengine:0.9.0-SNAPSHOT
[ERROR] +-org.apache.zeppelin:zeppelin-interpreter:0.9.0-SNAPSHOT
[ERROR] +-io.atomix:atomix:3.0.0-rc4
[ERROR] +-io.atomix:atomix-utils:3.0.0-rc4
[ERROR] +-com.google.guava:guava:22.0
[ERROR] and
[ERROR] +-org.apache.zeppelin:zeppelin-zengine:0.9.0-SNAPSHOT
[ERROR] +-com.google.guava:guava:20.0
[ERROR] ,
[ERROR] Dependency convergence error for org.apache.commons:commons-lang3:3.7 paths to dependency are:
[ERROR] +-org.apache.zeppelin:zeppelin-zengine:0.9.0-SNAPSHOT
[ERROR] +-org.apache.zeppelin:zeppelin-interpreter:0.9.0-SNAPSHOT
[ERROR] +-io.atomix:atomix:3.0.0-rc4
[ERROR] +-io.atomix:atomix-utils:3.0.0-rc4
[ERROR] +-org.apache.commons:commons-lang3:3.7
[ERROR] and
[ERROR] +-org.apache.zeppelin:zeppelin-zengine:0.9.0-SNAPSHOT
[ERROR] +-org.apache.commons:commons-lang3:3.4
[ERROR] ,
[ERROR] Dependency convergence error for io.netty:netty-handler:4.1.27.Final paths to dependency are:
[ERROR] +-org.apache.zeppelin:zeppelin-zengine:0.9.0-SNAPSHOT
[ERROR] +-org.apache.zeppelin:zeppelin-interpreter:0.9.0-SNAPSHOT
[ERROR] +-io.atomix:atomix:3.0.0-rc4
[ERROR] +-io.atomix:atomix-cluster:3.0.0-rc4
[ERROR] +-io.netty:netty-handler:4.1.27.Final
[ERROR] and
[ERROR] +-org.apache.zeppelin:zeppelin-zengine:0.9.0-SNAPSHOT
[ERROR] +-org.apache.zeppelin:spark-interpreter:0.9.0-SNAPSHOT
[ERROR] +-org.apache.zeppelin:zeppelin-python:0.9.0-SNAPSHOT
[ERROR] +-io.grpc:grpc-netty:1.4.0
[ERROR] +-io.netty:netty-codec-http2:4.1.11.Final
[ERROR] +-io.netty:netty-handler:4.1.11.Final
[ERROR] ,
[ERROR] Dependency convergence error for io.netty:netty-transport:4.1.27.Final paths to dependency are:
[ERROR] +-org.apache.zeppelin:zeppelin-zengine:0.9.0-SNAPSHOT
[ERROR] +-org.apache.zeppelin:zeppelin-interpreter:0.9.0-SNAPSHOT
[ERROR] +-io.atomix:atomix:3.0.0-rc4
[ERROR] +-io.atomix:atomix-cluster:3.0.0-rc4
[ERROR] +-io.netty:netty-transport:4.1.27.Final
[ERROR] and
[ERROR] +-org.apache.zeppelin:zeppelin-zengine:0.9.0-SNAPSHOT
[ERROR] +-org.apache.zeppelin:zeppelin-interpreter:0.9.0-SNAPSHOT
[ERROR] +-io.atomix:atomix:3.0.0-rc4
[ERROR] +-io.atomix:atomix-cluster:3.0.0-rc4
[ERROR] +-io.netty:netty-codec:4.1.27.Final
[ERROR] +-io.netty:netty-transport:4.1.27.Final
[ERROR] +-org.apache.zeppelin:zeppelin-zengine:0.9.0-SNAPSHOT
[ERROR] +-org.apache.zeppelin:zeppelin-interpreter:0.9.0-SNAPSHOT
[ERROR] +-io.atomix:atomix:3.0.0-rc4
[ERROR] +-io.atomix:atomix-cluster:3.0.0-rc4
[ERROR] +-io.netty:netty-transport-native-epoll:4.1.27.Final
[ERROR] +-io.netty:netty-transport:4.1.27.Final
[ERROR] ]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :zeppelin-zengine
| import java.util.function.Consumer; | ||
|
|
||
| /** | ||
| * Broadcast Service Adapter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add more doc to explain this class's responsibility ? e.g. How does it communicate with other components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add more doc about who broadcast message to whom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is added in line 25, So it didn't show up.
The next few places that need to be modified are also the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean to be more specific on which node this service should run. Overall there's 2 kinds of nodes. Zeppelin Server nodes and Interpreter Process node. And regarding the broadcast method, who broadcast message to whom
| * 3. Cluster monitoring | ||
| */ | ||
| public abstract class ClusterManager { | ||
| private static Logger logger = LoggerFactory.getLogger(ClusterManager.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger --> LOGGER
This is just code convention zeppelin use. Static fields should use uppercase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| protected LocalRaftProtocolFactory protocolFactory | ||
| = new LocalRaftProtocolFactory(protocolSerializer); | ||
| protected List<MessagingService> messagingServices = new ArrayList<>(); | ||
| protected Collection<MemberId> clusterMemberIds = new ArrayList<MemberId>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collection --> List (to make code style consistent)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } | ||
| } | ||
| } catch (UnknownHostException e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use LOGGER.error instead of e.printStackTrace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| e.printStackTrace(); | ||
| } catch (SocketException e) { | ||
| e.printStackTrace(); | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return is not necessary for constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| raftClient.close().get(3, TimeUnit.SECONDS); | ||
| } | ||
| } catch (InterruptedException e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } catch (InterruptedException e) { | ||
| e.printStackTrace(); | ||
| } catch (ExecutionException e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } catch (ExecutionException e) { | ||
| e.printStackTrace(); | ||
| } catch (TimeoutException e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| import io.atomix.primitive.service.ServiceConfig; | ||
|
|
||
| /** | ||
| * Cluster primitive type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need more doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Cluster State Machine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need more doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| import org.slf4j.LoggerFactory; | ||
|
|
||
| /** | ||
| * Zeppelin ClusterMembershipEventListener |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need more doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| import java.util.function.Function; | ||
|
|
||
| /** | ||
| * Cluster Raft client protocol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need more docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
|
||
| @Test | ||
| public void testColumnAliasQuery() throws IOException { | ||
| Properties properties = new Properties(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something must be wrong, this is not supposed to be in your commit. It is someone else's commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the code I submitted, I did not modify this, is it caused by Git's bug?
335dbfb to
f25005f
Compare
By using the Raft protocol, multiple Zeppelin-Server groups are built into a Zeppelin cluster, the cluster State Machine is maintained through the Raft protocol, and the services in the cluster are agreed upon. The Zeppelin-Server and Zeppelin-Interperter services and processes are stored in the Cluster MetaData. Metadata information; [Feature] * [x] add raft algorithm atomix jar * [x] add cluster state machine * [x] add state machine query command * [x] add state machine delete command * [x] add state machine put command * [x] Isolate the netty JAR package introduced by atomix * https://issues.apache.org/jira/browse/ZEPPELIN-3610 CI pass * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? Yes
f25005f to
97f17ac
Compare
|
Has passed the CI |
zeppelin-interpreter-parent/pom.xml
Outdated
| <!--<configuration>--> | ||
| <!--<skip>true</skip>--> | ||
| <!--</configuration>--> | ||
| <!--</plugin>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you uncomment this ? It is my mistake in my PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not modified this pom.xml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is due to my PR which you merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
| * 1. RaftClient as the raft client | ||
| * 2. Threading to provide retry after cluster metadata submission failure | ||
| * 3. Cluster monitoring | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this class run ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ClusterManager.java is the base class for cluster management.
My next PR will submit ClusterManagerClient.java and ClusterManagerServer.java that are extends from ClusterManager.java.
|
LGTM, will merge if no more comments |
What is this PR for?
By using the Raft protocol, multiple Zeppelin-Server groups are built into a Zeppelin cluster, the cluster State Machine is maintained through the Raft protocol, and the services in the cluster are agreed upon. The Zeppelin-Server and Zeppelin-Interperter services and processes are stored in the Cluster MetaData. Metadata information;
What type of PR is it?
[Feature]
Todos
What is the Jira issue?
How should this be tested?
CI pass
Screenshots (if appropriate)
Questions: