@@ -159,9 +159,7 @@ public static void main(String[] args) throws Exception {
159
159
commandLineConf .clear ();
160
160
161
161
GenericOptionsParser parser = new GenericOptionsParser (commandLineConf , args );
162
- String restArgs [] =parser .getRemainingArgs ();
163
-
164
-
162
+ String [] restArgs = parser .getRemainingArgs ();
165
163
166
164
try {
167
165
commandLine = new BasicParser ().parse (options , restArgs );
@@ -279,10 +277,8 @@ public static void setupZookeeperZnodes(CuratorFramework zk, String rootZnode,St
279
277
byte []uuidBytes = Bytes .toBytes (newValue );
280
278
String idPath =rootZnode +"/hbaseid" ;
281
279
if (zk .checkExists ().forPath (idPath ) == null ) {
282
- // zk.create().creatingParentsIfNeeded().forPath(rootZnode +
283
- // "/hbaseid",uuidBytes);
284
- zk .create ().forPath (rootZnode );
285
- zk .create ().forPath (rootZnode +"/hbaseid" ,uuidBytes );
280
+ zk .create ().forPath (rootZnode );
281
+ zk .create ().forPath (rootZnode +"/hbaseid" ,uuidBytes );
286
282
} else {
287
283
// If the znode is there already make sure it has the
288
284
// expected value for the peer name.
@@ -340,14 +336,14 @@ public static void checkForOrCreateReplicationPeer(Configuration hbaseConf,
340
336
341
337
if (peerThere ) {
342
338
if (enablePeer ){
343
- LOG .info ("enable peer," + peerName );
344
- List <ReplicationPeerDescription > peers = admin .listReplicationPeers ().stream ()
345
- .filter (( peer )-> peer .getPeerId ().equals (peerName ))
346
- .filter (( peer )-> peer .isEnabled ()== false )
347
- .collect (Collectors .toList ());
348
- if (!peers .isEmpty ()){
349
- admin .enableReplicationPeer (peerName );
350
- }
339
+ LOG .info ("enable peer,{}" , peerName );
340
+ List <ReplicationPeerDescription > peers = admin .listReplicationPeers ().stream ()
341
+ .filter (peer -> peer .getPeerId ().equals (peerName ))
342
+ .filter (peer -> ! peer .isEnabled ())
343
+ .collect (Collectors .toList ());
344
+ if (!peers .isEmpty ()){
345
+ admin .enableReplicationPeer (peerName );
346
+ }
351
347
}
352
348
break ;
353
349
} else {
0 commit comments