From 2dceb8340d16c7cd3116c546b9c5527415d1c5f9 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Thu, 3 Jul 2008 19:30:35 +0000 Subject: [PATCH] HBASE-562 Move Exceptions to subpackages git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@673771 13f79535-47bb-0310-9956-ffa450edef68 --- .../hbase/FileSystemVersionException.java | 39 ---------------- .../hbase/InvalidColumnNameException.java | 40 ----------------- .../hbase/NoServerForRegionException.java | 42 ------------------ .../hbase/RegionServerRunningException.java | 44 ------------------- .../hadoop/hbase/WrongRegionException.java | 42 ------------------ .../hbase/client/HConnectionManager.java | 1 - .../client/NoServerForRegionException.java | 42 ++++++++++++++++++ .../master/InvalidColumnNameException.java | 42 ++++++++++++++++++ .../hadoop/hbase/master/ModifyColumn.java | 1 - .../hbase/master/RetryableMetaOperation.java | 1 - .../hadoop/hbase/regionserver/HRegion.java | 1 - .../hbase/regionserver/HRegionServer.java | 1 - .../RegionServerRunningException.java | 44 +++++++++++++++++++ .../regionserver/WrongRegionException.java | 42 ++++++++++++++++++ .../org/apache/hadoop/hbase/util/FSUtils.java | 1 - .../util/FileSystemVersionException.java | 39 ++++++++++++++++ 16 files changed, 209 insertions(+), 213 deletions(-) create mode 100644 src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java create mode 100644 src/java/org/apache/hadoop/hbase/master/InvalidColumnNameException.java create mode 100644 src/java/org/apache/hadoop/hbase/regionserver/RegionServerRunningException.java create mode 100644 src/java/org/apache/hadoop/hbase/regionserver/WrongRegionException.java create mode 100644 src/java/org/apache/hadoop/hbase/util/FileSystemVersionException.java diff --git a/src/java/org/apache/hadoop/hbase/FileSystemVersionException.java b/src/java/org/apache/hadoop/hbase/FileSystemVersionException.java index 27e3fba90cf..e69de29bb2d 100644 --- a/src/java/org/apache/hadoop/hbase/FileSystemVersionException.java +++ b/src/java/org/apache/hadoop/hbase/FileSystemVersionException.java @@ -1,39 +0,0 @@ -/** - * Copyright 2008 The Apache Software Foundation - * - * 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 org.apache.hadoop.hbase; - -import java.io.IOException; - -/** Thrown when the file system needs to be upgraded */ -public class FileSystemVersionException extends IOException { - private static final long serialVersionUID = 1004053363L; - - /** default constructor */ - public FileSystemVersionException() { - super(); - } - - /** @param s message */ - public FileSystemVersionException(String s) { - super(s); - } - -} diff --git a/src/java/org/apache/hadoop/hbase/InvalidColumnNameException.java b/src/java/org/apache/hadoop/hbase/InvalidColumnNameException.java index e6e3ffe89b9..e69de29bb2d 100644 --- a/src/java/org/apache/hadoop/hbase/InvalidColumnNameException.java +++ b/src/java/org/apache/hadoop/hbase/InvalidColumnNameException.java @@ -1,40 +0,0 @@ -/** - * Copyright 2007 The Apache Software Foundation - * - * 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 org.apache.hadoop.hbase; - - -/** - * Thrown when an invalid column name is encountered - */ -public class InvalidColumnNameException extends DoNotRetryIOException { - private static final long serialVersionUID = 1L << 29 - 1L; - /** default constructor */ - public InvalidColumnNameException() { - super(); - } - - /** - * Constructor - * @param s message - */ - public InvalidColumnNameException(String s) { - super(s); - } -} \ No newline at end of file diff --git a/src/java/org/apache/hadoop/hbase/NoServerForRegionException.java b/src/java/org/apache/hadoop/hbase/NoServerForRegionException.java index 841b9637494..e69de29bb2d 100644 --- a/src/java/org/apache/hadoop/hbase/NoServerForRegionException.java +++ b/src/java/org/apache/hadoop/hbase/NoServerForRegionException.java @@ -1,42 +0,0 @@ -/** - * Copyright 2007 The Apache Software Foundation - * - * 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 org.apache.hadoop.hbase; - -import java.io.IOException; - -/** - * Thrown when no region server can be found for a region - */ -public class NoServerForRegionException extends IOException { - private static final long serialVersionUID = 1L << 11 - 1L; - - /** default constructor */ - public NoServerForRegionException() { - super(); - } - - /** - * Constructor - * @param s message - */ - public NoServerForRegionException(String s) { - super(s); - } -} diff --git a/src/java/org/apache/hadoop/hbase/RegionServerRunningException.java b/src/java/org/apache/hadoop/hbase/RegionServerRunningException.java index 571fd550606..e69de29bb2d 100644 --- a/src/java/org/apache/hadoop/hbase/RegionServerRunningException.java +++ b/src/java/org/apache/hadoop/hbase/RegionServerRunningException.java @@ -1,44 +0,0 @@ -/** - * Copyright 2007 The Apache Software Foundation - * - * 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 org.apache.hadoop.hbase; - -import java.io.IOException; - -/** - * Thrown if the region server log directory exists (which indicates another - * region server is running at the same address) - */ -public class RegionServerRunningException extends IOException { - private static final long serialVersionUID = 1L << 31 - 1L; - - /** Default Constructor */ - public RegionServerRunningException() { - super(); - } - - /** - * Constructs the exception and supplies a string as the message - * @param s - message - */ - public RegionServerRunningException(String s) { - super(s); - } - -} diff --git a/src/java/org/apache/hadoop/hbase/WrongRegionException.java b/src/java/org/apache/hadoop/hbase/WrongRegionException.java index 3a49568c40b..e69de29bb2d 100644 --- a/src/java/org/apache/hadoop/hbase/WrongRegionException.java +++ b/src/java/org/apache/hadoop/hbase/WrongRegionException.java @@ -1,42 +0,0 @@ -/** - * Copyright 2007 The Apache Software Foundation - * - * 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 org.apache.hadoop.hbase; - -import java.io.IOException; - -/** - * Thrown when a request contains a key which is not part of this region - */ -public class WrongRegionException extends IOException { - private static final long serialVersionUID = 993179627856392526L; - - /** constructor */ - public WrongRegionException() { - super(); - } - - /** - * Constructor - * @param s message - */ - public WrongRegionException(String s) { - super(s); - } -} \ No newline at end of file diff --git a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java index 6ac3ec8782c..8dbb2cc8b9c 100644 --- a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -40,7 +40,6 @@ import org.apache.hadoop.hbase.HServerAddress; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.LocalHBaseCluster; import org.apache.hadoop.hbase.MasterNotRunningException; -import org.apache.hadoop.hbase.NoServerForRegionException; import org.apache.hadoop.hbase.RemoteExceptionHandler; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor; diff --git a/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java b/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java new file mode 100644 index 00000000000..3187ab1a3e5 --- /dev/null +++ b/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java @@ -0,0 +1,42 @@ +/** + * Copyright 2007 The Apache Software Foundation + * + * 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 org.apache.hadoop.hbase.client; + +import java.io.IOException; + +/** + * Thrown when no region server can be found for a region + */ +public class NoServerForRegionException extends IOException { + private static final long serialVersionUID = 1L << 11 - 1L; + + /** default constructor */ + public NoServerForRegionException() { + super(); + } + + /** + * Constructor + * @param s message + */ + public NoServerForRegionException(String s) { + super(s); + } +} diff --git a/src/java/org/apache/hadoop/hbase/master/InvalidColumnNameException.java b/src/java/org/apache/hadoop/hbase/master/InvalidColumnNameException.java new file mode 100644 index 00000000000..779420575da --- /dev/null +++ b/src/java/org/apache/hadoop/hbase/master/InvalidColumnNameException.java @@ -0,0 +1,42 @@ +/** + * Copyright 2007 The Apache Software Foundation + * + * 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 org.apache.hadoop.hbase.master; + +import org.apache.hadoop.hbase.DoNotRetryIOException; + + +/** + * Thrown when an invalid column name is encountered + */ +public class InvalidColumnNameException extends DoNotRetryIOException { + private static final long serialVersionUID = 1L << 29 - 1L; + /** default constructor */ + public InvalidColumnNameException() { + super(); + } + + /** + * Constructor + * @param s message + */ + public InvalidColumnNameException(String s) { + super(s); + } +} \ No newline at end of file diff --git a/src/java/org/apache/hadoop/hbase/master/ModifyColumn.java b/src/java/org/apache/hadoop/hbase/master/ModifyColumn.java index aea9e90099b..f9962eba928 100644 --- a/src/java/org/apache/hadoop/hbase/master/ModifyColumn.java +++ b/src/java/org/apache/hadoop/hbase/master/ModifyColumn.java @@ -22,7 +22,6 @@ package org.apache.hadoop.hbase.master; import java.util.Map; import java.io.IOException; import org.apache.hadoop.hbase.HColumnDescriptor; -import org.apache.hadoop.hbase.InvalidColumnNameException; import org.apache.hadoop.hbase.ipc.HRegionInterface; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.HRegionInfo; diff --git a/src/java/org/apache/hadoop/hbase/master/RetryableMetaOperation.java b/src/java/org/apache/hadoop/hbase/master/RetryableMetaOperation.java index 1b573eb4fa2..c50b646f5c5 100644 --- a/src/java/org/apache/hadoop/hbase/master/RetryableMetaOperation.java +++ b/src/java/org/apache/hadoop/hbase/master/RetryableMetaOperation.java @@ -28,7 +28,6 @@ import java.util.concurrent.Callable; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.ipc.RemoteException; -import org.apache.hadoop.hbase.InvalidColumnNameException; import org.apache.hadoop.hbase.RemoteExceptionHandler; import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.TableNotDisabledException; diff --git a/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 1f46512be1d..64c52487814 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -52,7 +52,6 @@ import org.apache.hadoop.hbase.HStoreKey; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.RegionHistorian; -import org.apache.hadoop.hbase.WrongRegionException; import org.apache.hadoop.hbase.filter.RowFilterInterface; import org.apache.hadoop.hbase.io.BatchOperation; import org.apache.hadoop.hbase.io.BatchUpdate; diff --git a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index f691df3a9b9..e58f79281a0 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -66,7 +66,6 @@ import org.apache.hadoop.hbase.Leases; import org.apache.hadoop.hbase.LocalHBaseCluster; import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.RegionHistorian; -import org.apache.hadoop.hbase.RegionServerRunningException; import org.apache.hadoop.hbase.RemoteExceptionHandler; import org.apache.hadoop.hbase.UnknownScannerException; import org.apache.hadoop.hbase.Leases.LeaseStillHeldException; diff --git a/src/java/org/apache/hadoop/hbase/regionserver/RegionServerRunningException.java b/src/java/org/apache/hadoop/hbase/regionserver/RegionServerRunningException.java new file mode 100644 index 00000000000..8bdfedb2f72 --- /dev/null +++ b/src/java/org/apache/hadoop/hbase/regionserver/RegionServerRunningException.java @@ -0,0 +1,44 @@ +/** + * Copyright 2007 The Apache Software Foundation + * + * 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 org.apache.hadoop.hbase.regionserver; + +import java.io.IOException; + +/** + * Thrown if the region server log directory exists (which indicates another + * region server is running at the same address) + */ +public class RegionServerRunningException extends IOException { + private static final long serialVersionUID = 1L << 31 - 1L; + + /** Default Constructor */ + public RegionServerRunningException() { + super(); + } + + /** + * Constructs the exception and supplies a string as the message + * @param s - message + */ + public RegionServerRunningException(String s) { + super(s); + } + +} diff --git a/src/java/org/apache/hadoop/hbase/regionserver/WrongRegionException.java b/src/java/org/apache/hadoop/hbase/regionserver/WrongRegionException.java new file mode 100644 index 00000000000..acff9fecafa --- /dev/null +++ b/src/java/org/apache/hadoop/hbase/regionserver/WrongRegionException.java @@ -0,0 +1,42 @@ +/** + * Copyright 2007 The Apache Software Foundation + * + * 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 org.apache.hadoop.hbase.regionserver; + +import java.io.IOException; + +/** + * Thrown when a request contains a key which is not part of this region + */ +public class WrongRegionException extends IOException { + private static final long serialVersionUID = 993179627856392526L; + + /** constructor */ + public WrongRegionException() { + super(); + } + + /** + * Constructor + * @param s message + */ + public WrongRegionException(String s) { + super(s); + } +} \ No newline at end of file diff --git a/src/java/org/apache/hadoop/hbase/util/FSUtils.java b/src/java/org/apache/hadoop/hbase/util/FSUtils.java index 8121c2ee5fd..cf74c719962 100644 --- a/src/java/org/apache/hadoop/hbase/util/FSUtils.java +++ b/src/java/org/apache/hadoop/hbase/util/FSUtils.java @@ -34,7 +34,6 @@ import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hbase.FileSystemVersionException; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.RemoteExceptionHandler; diff --git a/src/java/org/apache/hadoop/hbase/util/FileSystemVersionException.java b/src/java/org/apache/hadoop/hbase/util/FileSystemVersionException.java new file mode 100644 index 00000000000..ce5f141401d --- /dev/null +++ b/src/java/org/apache/hadoop/hbase/util/FileSystemVersionException.java @@ -0,0 +1,39 @@ +/** + * Copyright 2008 The Apache Software Foundation + * + * 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 org.apache.hadoop.hbase.util; + +import java.io.IOException; + +/** Thrown when the file system needs to be upgraded */ +public class FileSystemVersionException extends IOException { + private static final long serialVersionUID = 1004053363L; + + /** default constructor */ + public FileSystemVersionException() { + super(); + } + + /** @param s message */ + public FileSystemVersionException(String s) { + super(s); + } + +}