From 5982c95d8e9fd168dff581490a1377757245c947 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Mon, 22 Sep 2008 21:47:59 +0000 Subject: [PATCH] HBASE-891 HRS.validateValuesLength throws IOE, gets caught in the retries git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@698008 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../hbase/ValueOverMaxLengthException.java | 42 +++++++++++++++++++ .../hbase/regionserver/HRegionServer.java | 3 +- 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/java/org/apache/hadoop/hbase/ValueOverMaxLengthException.java diff --git a/CHANGES.txt b/CHANGES.txt index f3989f61690..3811eae74b5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,6 +3,7 @@ Release 0.19.0 - Unreleased INCOMPATIBLE CHANGES BUG FIXES + HBASE-891 HRS.validateValuesLength throws IOE, gets caught in the retries IMPROVEMENTS HBASE-890 Alter table operation and also related changes in REST interface diff --git a/src/java/org/apache/hadoop/hbase/ValueOverMaxLengthException.java b/src/java/org/apache/hadoop/hbase/ValueOverMaxLengthException.java new file mode 100644 index 00000000000..988b6d35384 --- /dev/null +++ b/src/java/org/apache/hadoop/hbase/ValueOverMaxLengthException.java @@ -0,0 +1,42 @@ +/** + * 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; + +/** + * Thrown when a value is longer than the specified LENGTH + */ +@SuppressWarnings("serial") +public class ValueOverMaxLengthException extends DoNotRetryIOException { + + /** + * default constructor + */ + public ValueOverMaxLengthException() { + super(); + } + + /** + * @param message + */ + public ValueOverMaxLengthException(String message) { + super(message); + } + +} diff --git a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 8a5a72d9183..6d8f9c79b8b 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -70,6 +70,7 @@ import org.apache.hadoop.hbase.RegionHistorian; import org.apache.hadoop.hbase.RemoteExceptionHandler; import org.apache.hadoop.hbase.UnknownScannerException; import org.apache.hadoop.hbase.UnknownRowLockException; +import org.apache.hadoop.hbase.ValueOverMaxLengthException; import org.apache.hadoop.hbase.Leases.LeaseStillHeldException; import org.apache.hadoop.hbase.filter.RowFilterInterface; import org.apache.hadoop.hbase.io.BatchOperation; @@ -1134,7 +1135,7 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { if (fam != null) { int maxLength = fam.getMaxValueLength(); if (operation.getValue().length > maxLength) { - throw new IOException("Value in column " + throw new ValueOverMaxLengthException("Value in column " + Bytes.toString(operation.getColumn()) + " is too long. " + operation.getValue().length + " instead of " + maxLength); }