jiazhai closed pull request #740: Issue 739: Move the implementation of http services to be under server package URL: https://github.com/apache/bookkeeper/pull/740
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/package-info.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/package-info.java deleted file mode 100644 index d4725197c..000000000 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -/** - * Package for bookkeeper http service. - */ -package org.apache.bookkeeper.http; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AutoRecoveryMain.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AutoRecoveryMain.java index 5caac6f06..c818c623d 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AutoRecoveryMain.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/AutoRecoveryMain.java @@ -30,7 +30,7 @@ import org.apache.bookkeeper.bookie.BookieCriticalThread; import org.apache.bookkeeper.bookie.ExitCode; import org.apache.bookkeeper.conf.ServerConfiguration; -import org.apache.bookkeeper.http.BKHttpServiceProvider; +import org.apache.bookkeeper.server.http.BKHttpServiceProvider; import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.HttpServerLoader; import org.apache.bookkeeper.replication.ReplicationException.CompatibilityException; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java index 9ba9d7198..c2f7b8e5c 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java @@ -32,9 +32,9 @@ import org.apache.bookkeeper.common.component.LifecycleComponent; import org.apache.bookkeeper.common.component.LifecycleComponentStack; import org.apache.bookkeeper.conf.ServerConfiguration; -import org.apache.bookkeeper.http.BKHttpServiceProvider; import org.apache.bookkeeper.server.component.ServerLifecycleComponent; import org.apache.bookkeeper.server.conf.BookieConfiguration; +import org.apache.bookkeeper.server.http.BKHttpServiceProvider; import org.apache.bookkeeper.server.service.AutoRecoveryService; import org.apache.bookkeeper.server.service.BookieService; import org.apache.bookkeeper.server.service.HttpService; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/BKHttpServiceProvider.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/BKHttpServiceProvider.java similarity index 83% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/BKHttpServiceProvider.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/BKHttpServiceProvider.java index 38eb007c4..a733c508a 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/BKHttpServiceProvider.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/BKHttpServiceProvider.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,9 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http; import com.google.common.util.concurrent.ThreadFactoryBuilder; import java.io.IOException; @@ -30,12 +28,30 @@ import org.apache.bookkeeper.client.BookKeeperAdmin; import org.apache.bookkeeper.conf.ClientConfiguration; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer.ApiType; +import org.apache.bookkeeper.http.HttpServiceProvider; import org.apache.bookkeeper.http.service.ErrorHttpService; import org.apache.bookkeeper.http.service.HeartbeatService; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.proto.BookieServer; import org.apache.bookkeeper.replication.Auditor; import org.apache.bookkeeper.replication.AutoRecoveryMain; +import org.apache.bookkeeper.server.http.service.ConfigurationService; +import org.apache.bookkeeper.server.http.service.DecommissionService; +import org.apache.bookkeeper.server.http.service.DeleteLedgerService; +import org.apache.bookkeeper.server.http.service.ExpandStorageService; +import org.apache.bookkeeper.server.http.service.GetLastLogMarkService; +import org.apache.bookkeeper.server.http.service.GetLedgerMetaService; +import org.apache.bookkeeper.server.http.service.ListBookieInfoService; +import org.apache.bookkeeper.server.http.service.ListBookiesService; +import org.apache.bookkeeper.server.http.service.ListDiskFilesService; +import org.apache.bookkeeper.server.http.service.ListLedgerService; +import org.apache.bookkeeper.server.http.service.ListUnderReplicatedLedgerService; +import org.apache.bookkeeper.server.http.service.LostBookieRecoveryDelayService; +import org.apache.bookkeeper.server.http.service.ReadLedgerEntryService; +import org.apache.bookkeeper.server.http.service.RecoveryBookieService; +import org.apache.bookkeeper.server.http.service.TriggerAuditService; +import org.apache.bookkeeper.server.http.service.WhoIsAuditorService; import org.apache.bookkeeper.zookeeper.ZooKeeperClient; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.ZooKeeper; @@ -139,7 +155,7 @@ public BKHttpServiceProvider build() } @Override - public HttpEndpointService provideHttpEndpointService(HttpServer.ApiType type) { + public HttpEndpointService provideHttpEndpointService(ApiType type) { ServerConfiguration configuration = getServerConf(); if (configuration == null) { return new ErrorHttpService(); diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/package-info.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/package-info.java new file mode 100644 index 000000000..ce2991552 --- /dev/null +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/package-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +/** + * Package for bookkeeper http service. + */ +package org.apache.bookkeeper.server.http; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ConfigurationService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ConfigurationService.java similarity index 97% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ConfigurationService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ConfigurationService.java index a7f3407ae..0a8e8a378 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ConfigurationService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ConfigurationService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,9 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import java.util.HashMap; @@ -26,6 +24,7 @@ import java.util.Map; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/DecommissionService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/DecommissionService.java similarity index 97% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/DecommissionService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/DecommissionService.java index 428c007b4..dd3f76421 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/DecommissionService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/DecommissionService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,15 +15,15 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import java.util.HashMap; import java.util.concurrent.ExecutorService; import org.apache.bookkeeper.client.BookKeeperAdmin; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/DeleteLedgerService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/DeleteLedgerService.java similarity index 97% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/DeleteLedgerService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/DeleteLedgerService.java index 334aeed60..6b25e1e8d 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/DeleteLedgerService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/DeleteLedgerService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,15 +15,15 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import java.util.Map; import org.apache.bookkeeper.client.BookKeeper; import org.apache.bookkeeper.conf.ClientConfiguration; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ExpandStorageService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ExpandStorageService.java similarity index 97% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ExpandStorageService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ExpandStorageService.java index cd87a24a5..9ff54118b 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ExpandStorageService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ExpandStorageService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,14 +15,12 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import java.io.File; -import java.io.IOException; import java.util.Arrays; import java.util.List; import org.apache.bookkeeper.bookie.Bookie; @@ -31,6 +28,7 @@ import org.apache.bookkeeper.conf.ServerConfiguration; import org.apache.bookkeeper.discover.RegistrationManager; import org.apache.bookkeeper.discover.ZKRegistrationManager; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/GetLastLogMarkService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/GetLastLogMarkService.java similarity index 97% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/GetLastLogMarkService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/GetLastLogMarkService.java index 7d699dadc..92ad78d02 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/GetLastLogMarkService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/GetLastLogMarkService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,9 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; @@ -30,6 +28,7 @@ import org.apache.bookkeeper.bookie.LedgerDirsManager; import org.apache.bookkeeper.bookie.LogMark; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/GetLedgerMetaService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/GetLedgerMetaService.java similarity index 97% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/GetLedgerMetaService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/GetLedgerMetaService.java index db0bb62ed..43889d3e6 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/GetLedgerMetaService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/GetLedgerMetaService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,9 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import static com.google.common.base.Charsets.UTF_8; @@ -27,6 +25,7 @@ import java.util.Map; import org.apache.bookkeeper.client.LedgerMetadata; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListBookieInfoService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListBookieInfoService.java similarity index 98% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListBookieInfoService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListBookieInfoService.java index 083ee8b65..d0979c78e 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListBookieInfoService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListBookieInfoService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,9 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; @@ -30,6 +28,7 @@ import org.apache.bookkeeper.client.BookieInfoReader; import org.apache.bookkeeper.conf.ClientConfiguration; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListBookiesService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListBookiesService.java similarity index 97% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListBookiesService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListBookiesService.java index f7e5fe427..f0275a116 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListBookiesService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListBookiesService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,9 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; @@ -27,6 +25,7 @@ import java.util.Map; import org.apache.bookkeeper.client.BookKeeperAdmin; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListDiskFilesService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListDiskFilesService.java similarity index 98% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListDiskFilesService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListDiskFilesService.java index 72871b51f..d557f982a 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListDiskFilesService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListDiskFilesService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,9 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import static org.apache.bookkeeper.bookie.BookieShell.listFilesAndSort; @@ -28,6 +26,7 @@ import java.util.List; import java.util.Map; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListLedgerService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListLedgerService.java similarity index 98% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListLedgerService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListLedgerService.java index b500c1807..75d9629e2 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListLedgerService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListLedgerService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,9 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import static com.google.common.base.Charsets.UTF_8; @@ -32,6 +30,7 @@ import org.apache.bookkeeper.client.BKException; import org.apache.bookkeeper.client.LedgerMetadata; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListUnderReplicatedLedgerService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListUnderReplicatedLedgerService.java similarity index 98% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListUnderReplicatedLedgerService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListUnderReplicatedLedgerService.java index 01d585370..01929bb9b 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ListUnderReplicatedLedgerService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ListUnderReplicatedLedgerService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,9 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; @@ -27,6 +25,7 @@ import java.util.Map; import java.util.function.Predicate; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/LostBookieRecoveryDelayService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/LostBookieRecoveryDelayService.java similarity index 97% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/LostBookieRecoveryDelayService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/LostBookieRecoveryDelayService.java index 0098e076c..1a2ed6132 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/LostBookieRecoveryDelayService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/LostBookieRecoveryDelayService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,14 +15,14 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import java.util.HashMap; import org.apache.bookkeeper.client.BookKeeperAdmin; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ReadLedgerEntryService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ReadLedgerEntryService.java similarity index 98% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ReadLedgerEntryService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ReadLedgerEntryService.java index a380f196e..7454bc3a5 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/ReadLedgerEntryService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/ReadLedgerEntryService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,9 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import static com.google.common.base.Charsets.US_ASCII; @@ -29,6 +27,7 @@ import org.apache.bookkeeper.client.BookKeeperAdmin; import org.apache.bookkeeper.client.LedgerEntry; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/RecoveryBookieService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/RecoveryBookieService.java similarity index 98% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/RecoveryBookieService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/RecoveryBookieService.java index cfbb92134..ecce42865 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/RecoveryBookieService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/RecoveryBookieService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,9 +15,8 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import java.util.List; @@ -27,6 +25,7 @@ import org.apache.bookkeeper.client.BookKeeperAdmin; import org.apache.bookkeeper.conf.ServerConfiguration; import org.apache.bookkeeper.discover.RegistrationManager; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/TriggerAuditService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/TriggerAuditService.java similarity index 96% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/TriggerAuditService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/TriggerAuditService.java index 3f6ed8a80..30b580e94 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/TriggerAuditService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/TriggerAuditService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,13 +15,13 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import org.apache.bookkeeper.client.BookKeeperAdmin; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/WhoIsAuditorService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/WhoIsAuditorService.java similarity index 97% rename from bookkeeper-server/src/main/java/org/apache/bookkeeper/http/WhoIsAuditorService.java rename to bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/WhoIsAuditorService.java index 2e4837cad..baf9f8006 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/http/WhoIsAuditorService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/WhoIsAuditorService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,12 +15,12 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http.service; import com.google.common.base.Preconditions; import org.apache.bookkeeper.conf.ServerConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/package-info.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/package-info.java new file mode 100644 index 000000000..5dce07cea --- /dev/null +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/package-info.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Define the services running in bookkeeper admin http server. + */ +package org.apache.bookkeeper.server.http.service; \ No newline at end of file diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/service/HttpService.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/service/HttpService.java index 3f8137757..8a86ffa02 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/service/HttpService.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/server/service/HttpService.java @@ -21,11 +21,12 @@ import static com.google.common.base.Preconditions.checkNotNull; import java.io.IOException; -import org.apache.bookkeeper.http.BKHttpServiceProvider; + import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.HttpServerLoader; import org.apache.bookkeeper.server.component.ServerLifecycleComponent; import org.apache.bookkeeper.server.conf.BookieConfiguration; +import org.apache.bookkeeper.server.http.BKHttpServiceProvider; import org.apache.bookkeeper.stats.StatsLogger; /** diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/http/TestHttpService.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/server/http/TestHttpService.java similarity index 99% rename from bookkeeper-server/src/test/java/org/apache/bookkeeper/http/TestHttpService.java rename to bookkeeper-server/src/test/java/org/apache/bookkeeper/server/http/TestHttpService.java index 5be680f47..62fe6dee1 100644 --- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/http/TestHttpService.java +++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/server/http/TestHttpService.java @@ -1,5 +1,4 @@ -/** - * +/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,35 +15,32 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ -package org.apache.bookkeeper.http; +package org.apache.bookkeeper.server.http; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import com.google.common.base.Stopwatch; import com.google.common.collect.Maps; import java.io.File; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeUnit; import org.apache.bookkeeper.client.BookKeeper; import org.apache.bookkeeper.client.LedgerHandle; import org.apache.bookkeeper.client.LedgerHandleAdapter; import org.apache.bookkeeper.client.LedgerMetadata; import org.apache.bookkeeper.conf.ServerConfiguration; import org.apache.bookkeeper.conf.TestBKConfiguration; +import org.apache.bookkeeper.http.HttpServer; import org.apache.bookkeeper.http.service.HttpEndpointService; import org.apache.bookkeeper.http.service.HttpServiceRequest; import org.apache.bookkeeper.http.service.HttpServiceResponse; import org.apache.bookkeeper.meta.LedgerManager; import org.apache.bookkeeper.meta.LedgerManagerFactory; import org.apache.bookkeeper.meta.LedgerUnderreplicationManager; -import org.apache.bookkeeper.metastore.InMemoryMetaStore; import org.apache.bookkeeper.net.BookieSocketAddress; import org.apache.bookkeeper.replication.AuditorElector; import org.apache.bookkeeper.test.BookKeeperClusterTestCase; ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
