├── conf
├── regionservers
└── hbase-site.xml
├── src
├── site
│ ├── resources
│ │ └── images
│ │ │ ├── hfile.png
│ │ │ ├── favicon.ico
│ │ │ ├── hfilev2.png
│ │ │ ├── big_h_logo.png
│ │ │ ├── hadoop-logo.jpg
│ │ │ ├── hbase_logo.png
│ │ │ ├── architecture.gif
│ │ │ └── replication_overview.png
│ └── xdoc
│ │ ├── bulk-loads.xml
│ │ └── pseudo-distributed.xml
├── test
│ ├── data
│ │ └── hbase-4388-root.dir.tgz
│ ├── resources
│ │ └── org
│ │ │ └── apache
│ │ │ └── hadoop
│ │ │ └── hbase
│ │ │ ├── io
│ │ │ └── hfile
│ │ │ │ └── 8e8ab58dcf39412da19833fcd8f687ac
│ │ │ └── PerformanceEvaluation_Counter.properties
│ ├── java
│ │ └── org
│ │ │ └── apache
│ │ │ └── hadoop
│ │ │ └── hbase
│ │ │ ├── coprocessor
│ │ │ └── GenericEndpoint.java
│ │ │ ├── constraint
│ │ │ ├── AllPassConstraint.java
│ │ │ ├── AllFailConstraint.java
│ │ │ ├── RuntimeFailConstraint.java
│ │ │ └── WorksConstraint.java
│ │ │ ├── SmallTests.java
│ │ │ ├── util
│ │ │ ├── StoppableImplementation.java
│ │ │ └── EnvironmentEdgeManagerTestHelper.java
│ │ │ ├── regionserver
│ │ │ └── wal
│ │ │ │ └── TestHLogSplitCompressed.java
│ │ │ └── MediumTests.java
│ └── ruby
│ │ └── shell
│ │ └── commands_test.rb
├── main
│ ├── resources
│ │ ├── hbase-webapps
│ │ │ ├── static
│ │ │ │ ├── favicon.ico
│ │ │ │ ├── hbase_logo.png
│ │ │ │ └── hbase_logo_med.gif
│ │ │ ├── rest
│ │ │ │ └── index.html
│ │ │ ├── master
│ │ │ │ ├── index.html
│ │ │ │ └── master.jsp
│ │ │ ├── thrift
│ │ │ │ └── index.html
│ │ │ └── regionserver
│ │ │ │ ├── index.html
│ │ │ │ └── regionserver.jsp
│ │ └── org
│ │ │ └── apache
│ │ │ └── hadoop
│ │ │ └── hbase
│ │ │ ├── mapred
│ │ │ └── RowCounter_Counters.properties
│ │ │ ├── mapreduce
│ │ │ └── RowCounter_Counters.properties
│ │ │ └── rest
│ │ │ └── protobuf
│ │ │ ├── TableListMessage.proto
│ │ │ ├── CellMessage.proto
│ │ │ ├── CellSetMessage.proto
│ │ │ ├── VersionMessage.proto
│ │ │ ├── ScannerMessage.proto
│ │ │ ├── TableInfoMessage.proto
│ │ │ ├── ColumnSchemaMessage.proto
│ │ │ └── TableSchemaMessage.proto
│ ├── javadoc
│ │ └── org
│ │ │ └── apache
│ │ │ └── hadoop
│ │ │ └── hbase
│ │ │ ├── io
│ │ │ └── hfile
│ │ │ │ └── package.html
│ │ │ ├── ipc
│ │ │ └── package.html
│ │ │ └── thrift
│ │ │ └── doc-files
│ │ │ └── style.css
│ ├── java
│ │ └── org
│ │ │ └── apache
│ │ │ └── hadoop
│ │ │ └── hbase
│ │ │ ├── regionserver
│ │ │ ├── ScanType.java
│ │ │ ├── RegionOpeningState.java
│ │ │ ├── ChangedReadersObserver.java
│ │ │ ├── RegionServerStoppedException.java
│ │ │ ├── RegionAlreadyInTransitionException.java
│ │ │ ├── DisabledRegionSplitPolicy.java
│ │ │ ├── LeaseException.java
│ │ │ ├── LeaseListener.java
│ │ │ ├── wal
│ │ │ │ ├── OrphanHLogAfterSplitException.java
│ │ │ │ └── FailedLogCloseException.java
│ │ │ ├── MXBean.java
│ │ │ └── WrongRegionException.java
│ │ │ ├── ipc
│ │ │ ├── Status.java
│ │ │ ├── ServerNotRunningYetException.java
│ │ │ ├── RpcCallContext.java
│ │ │ ├── HBaseRPCErrorHandler.java
│ │ │ └── CallerDisconnectedException.java
│ │ │ ├── util
│ │ │ ├── KeyRange.java
│ │ │ ├── EnvironmentEdge.java
│ │ │ ├── DefaultEnvironmentEdge.java
│ │ │ ├── FileSystemVersionException.java
│ │ │ ├── GetJavaProperty.java
│ │ │ ├── RetryCounterFactory.java
│ │ │ └── IncrementingEnvironmentEdge.java
│ │ │ ├── TableExistsException.java
│ │ │ ├── client
│ │ │ ├── Row.java
│ │ │ ├── RegionOfflineException.java
│ │ │ ├── ScannerTimeoutException.java
│ │ │ └── NoServerForRegionException.java
│ │ │ ├── rest
│ │ │ ├── ResourceConfig.java
│ │ │ └── ResourceBase.java
│ │ │ ├── constraint
│ │ │ └── BaseConstraint.java
│ │ │ ├── io
│ │ │ ├── encoding
│ │ │ │ └── EncoderBufferTooSmallException.java
│ │ │ ├── WritableWithSize.java
│ │ │ └── hfile
│ │ │ │ ├── CacheableDeserializer.java
│ │ │ │ ├── CorruptHFileException.java
│ │ │ │ └── InvalidHFileException.java
│ │ │ ├── Stoppable.java
│ │ │ ├── coprocessor
│ │ │ ├── RegionServerCoprocessorEnvironment.java
│ │ │ ├── WALCoprocessorEnvironment.java
│ │ │ ├── MasterCoprocessorEnvironment.java
│ │ │ └── RegionServerObserver.java
│ │ │ ├── ClockOutOfSyncException.java
│ │ │ ├── EmptyWatcher.java
│ │ │ ├── DroppedSnapshotException.java
│ │ │ ├── UnknownRegionException.java
│ │ │ ├── thrift2
│ │ │ └── generated
│ │ │ │ └── TDeleteType.java
│ │ │ ├── TableNotFoundException.java
│ │ │ ├── YouAreDeadException.java
│ │ │ ├── master
│ │ │ └── handler
│ │ │ │ └── TotesHRegionInfo.java
│ │ │ ├── security
│ │ │ ├── TokenInfo.java
│ │ │ └── KerberosInfo.java
│ │ │ ├── filter
│ │ │ ├── InvalidRowFilterException.java
│ │ │ ├── IncompatibleFilterException.java
│ │ │ └── package-info.java
│ │ │ ├── PleaseHoldException.java
│ │ │ ├── TableInfoMissingException.java
│ │ │ ├── RegionException.java
│ │ │ ├── UnknownRowLockException.java
│ │ │ ├── mapred
│ │ │ └── TableReduce.java
│ │ │ └── mapreduce
│ │ │ └── TableMapper.java
│ └── ruby
│ │ └── shell
│ │ └── commands
│ │ ├── zk_dump.rb
│ │ ├── whoami.rb
│ │ ├── enable.rb
│ │ ├── disable.rb
│ │ ├── drop.rb
│ │ ├── delete_snapshot.rb
│ │ ├── snapshot.rb
│ │ ├── alter_status.rb
│ │ ├── is_enabled.rb
│ │ ├── is_disabled.rb
│ │ ├── remove_peer.rb
│ │ ├── assign.rb
│ │ ├── exists.rb
│ │ ├── truncate.rb
│ │ ├── enable_peer.rb
│ │ ├── status.rb
│ │ ├── truncate_preserve.rb
│ │ ├── disable_peer.rb
│ │ ├── version.rb
│ │ ├── flush.rb
│ │ ├── restore_snapshot.rb
│ │ ├── revoke.rb
│ │ ├── clone_snapshot.rb
│ │ ├── describe.rb
│ │ ├── balance_switch.rb
│ │ ├── stop_replication.rb
│ │ ├── start_replication.rb
│ │ ├── balancer.rb
│ │ ├── put.rb
│ │ ├── incr.rb
│ │ ├── list_peers.rb
│ │ └── deleteall.rb
├── packages
│ └── deb
│ │ ├── hbase.control
│ │ ├── conffile
│ │ ├── postrm
│ │ ├── postinst
│ │ ├── preinst
│ │ ├── prerm
│ │ └── control
│ │ └── conf-pseudo.control
│ │ ├── conffile
│ │ ├── prerm
│ │ ├── control
│ │ └── postinst
└── examples
│ ├── README.txt
│ ├── thrift
│ ├── README.txt
│ └── Makefile
│ └── mapreduce
│ └── index-builder-setup.rb
├── .gitignore
├── .arcconfig
├── bin
└── hbase-jruby
├── NOTICE.txt
├── secondaryindex
└── src
│ └── main
│ └── java
│ └── org
│ └── apache
│ └── hadoop
│ └── hbase
│ └── index
│ ├── GroupingCondition.java
│ ├── coprocessor
│ └── regionserver
│ │ ├── SeekUnderValueException.java
│ │ ├── ReInitializableRegionScanner.java
│ │ ├── LeafFilterNode.java
│ │ ├── IndexRegionScanner.java
│ │ └── TTLExpiryChecker.java
│ ├── ValuePartition.java
│ └── client
│ └── NoIndexExpression.java
├── dev-support
├── test-patch.properties
└── findHangingTest.sh
└── security
└── src
└── main
└── java
└── org
└── apache
└── hadoop
└── hbase
└── security
└── AccessDeniedException.java
/conf/regionservers:
--------------------------------------------------------------------------------
1 | localhost
2 |
--------------------------------------------------------------------------------
/src/site/resources/images/hfile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/site/resources/images/hfile.png
--------------------------------------------------------------------------------
/src/site/resources/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/site/resources/images/favicon.ico
--------------------------------------------------------------------------------
/src/site/resources/images/hfilev2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/site/resources/images/hfilev2.png
--------------------------------------------------------------------------------
/src/test/data/hbase-4388-root.dir.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/test/data/hbase-4388-root.dir.tgz
--------------------------------------------------------------------------------
/src/site/resources/images/big_h_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/site/resources/images/big_h_logo.png
--------------------------------------------------------------------------------
/src/site/resources/images/hadoop-logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/site/resources/images/hadoop-logo.jpg
--------------------------------------------------------------------------------
/src/site/resources/images/hbase_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/site/resources/images/hbase_logo.png
--------------------------------------------------------------------------------
/src/site/resources/images/architecture.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/site/resources/images/architecture.gif
--------------------------------------------------------------------------------
/src/main/resources/hbase-webapps/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/main/resources/hbase-webapps/static/favicon.ico
--------------------------------------------------------------------------------
/src/site/resources/images/replication_overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/site/resources/images/replication_overview.png
--------------------------------------------------------------------------------
/src/main/resources/hbase-webapps/static/hbase_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/main/resources/hbase-webapps/static/hbase_logo.png
--------------------------------------------------------------------------------
/src/main/resources/hbase-webapps/static/hbase_logo_med.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/main/resources/hbase-webapps/static/hbase_logo_med.gif
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.arc_jira_lib
2 | /.classpath
3 | /.externalToolBuilders
4 | /.project
5 | /.settings
6 | /build
7 | /.idea/
8 | /logs
9 | /target
10 | *.iml
11 | *.orig
12 | *~
13 |
--------------------------------------------------------------------------------
/src/packages/deb/hbase.control/conffile:
--------------------------------------------------------------------------------
1 | /etc/hbase/hadoop-metrics.properties
2 | /etc/hbase/hbase-env.sh
3 | /etc/hbase/hbase-site.xml
4 | /etc/hbase/log4j.properties
5 | /etc/hbase/regionservers
6 |
--------------------------------------------------------------------------------
/src/test/resources/org/apache/hadoop/hbase/io/hfile/8e8ab58dcf39412da19833fcd8f687ac:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Huawei-Hadoop/hindex/HEAD/src/test/resources/org/apache/hadoop/hbase/io/hfile/8e8ab58dcf39412da19833fcd8f687ac
--------------------------------------------------------------------------------
/.arcconfig:
--------------------------------------------------------------------------------
1 | {
2 | "project_id" : "hbase",
3 | "conduit_uri" : "https://reviews.facebook.net/",
4 | "copyright_holder" : "Apache Software Foundation",
5 | "phutil_libraries" : {
6 | "arclib" : ".arc_jira_lib"
7 | },
8 | "arcanist_configuration" : "ArcJIRAConfiguration",
9 | "jira_project" : "HBASE",
10 | "jira_api_url" : "https://issues.apache.org/jira/si/"
11 | }
12 |
--------------------------------------------------------------------------------
/src/examples/README.txt:
--------------------------------------------------------------------------------
1 | Example code.
2 |
3 | * src/examples/thrift
4 | Examples for interacting with HBase via Thrift from C++, PHP, Python and Ruby.
5 | * org.apache.hadoop.hbase.mapreduce.SampleUploader
6 | Demonstrates uploading data from text files (presumably stored in HDFS) to HBase.
7 | * org.apache.hadoop.hbase.mapreduce.IndexBuilder
8 | Demonstrates map/reduce with a table as the source and other tables as the sink.
9 |
10 | As of 0.20 there is no ant target for building the examples. You can easily build
11 | the Java examples by copying them to the right location in the main source hierarchy.
--------------------------------------------------------------------------------
/src/examples/thrift/README.txt:
--------------------------------------------------------------------------------
1 | Hbase Thrift Client Examples
2 | ============================
3 |
4 | Included in this directory are sample clients of the HBase ThriftServer. They
5 | all perform the same actions but are implemented in C++, Java, Ruby, PHP, and
6 | Python respectively.
7 |
8 | To run/compile this clients, you will first need to install the thrift package
9 | (from http://developers.facebook.com/thrift/) and then run thrift to generate
10 | the language files:
11 |
12 | thrift --gen cpp --gen java --gen rb --gen py -php \
13 | ../../../src/java/org/apache/hadoop/hbase/thrift/Hbase.thrift
14 |
15 | See the individual DemoClient test files for more specific instructions on
16 | running each test.
17 |
--------------------------------------------------------------------------------
/src/packages/deb/conf-pseudo.control/conffile:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | /etc/hbase/hbase-site.xml
17 |
--------------------------------------------------------------------------------
/src/packages/deb/hbase.control/postrm:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | /usr/sbin/userdel hbase 2> /dev/null >/dev/null
19 | exit 0
20 |
21 |
--------------------------------------------------------------------------------
/bin/hbase-jruby:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #/**
3 | # * Licensed to the Apache Software Foundation (ASF) under one
4 | # * or more contributor license agreements. See the NOTICE file
5 | # * distributed with this work for additional information
6 | # * regarding copyright ownership. The ASF licenses this file
7 | # * to you under the Apache License, Version 2.0 (the
8 | # * "License"); you may not use this file except in compliance
9 | # * with the License. You may obtain a copy of the License at
10 | # *
11 | # * http://www.apache.org/licenses/LICENSE-2.0
12 | # *
13 | # * Unless required by applicable law or agreed to in writing, software
14 | # * distributed under the License is distributed on an "AS IS" BASIS,
15 | # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # * See the License for the specific language governing permissions and
17 | # * limitations under the License.
18 | # */
19 |
20 |
21 | `dirname $0`/hbase org.jruby.Main $*
22 |
23 |
--------------------------------------------------------------------------------
/NOTICE.txt:
--------------------------------------------------------------------------------
1 | This product includes software developed by The Apache Software
2 | Foundation (http://www.apache.org/).
3 |
4 | In addition, this product includes software developed by:
5 |
6 | Jamon (http://www.jamon.org/) is a text template engine for Java used by our
7 | UI. It uses the Mozilla Public License (http://www.mozilla.org/MPL/)
8 | See the tail of http://www.jamon.org/About.html
9 |
10 | JUnit (http://www.junit.org/) included under the Common Public License v1.0. See
11 | the full text here: http://junit.sourceforge.net/cpl-v10.html
12 |
13 | JRuby (http://jruby.org) is tri-licensed. We include it under terms of the
14 | Common Public License v1.0.
15 |
16 | JRuby itself includes libraries variously licensed. See its COPYING document
17 | for details: https://github.com/jruby/jruby/blob/master/COPYING
18 |
19 | The JRuby community went out of their way to make JRuby compatible with Apache
20 | projects: See https://issues.apache.org/jira/browse/HBASE-3374)
21 |
--------------------------------------------------------------------------------
/src/main/resources/hbase-webapps/rest/index.html:
--------------------------------------------------------------------------------
1 |
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/hbase-webapps/master/index.html:
--------------------------------------------------------------------------------
1 |
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/hbase-webapps/master/master.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | /**
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 | --%>
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/hbase-webapps/thrift/index.html:
--------------------------------------------------------------------------------
1 |
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/hbase-webapps/regionserver/index.html:
--------------------------------------------------------------------------------
1 |
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/hbase-webapps/regionserver/regionserver.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | /**
3 | * Licensed to the Apache Software Foundation (ASF) under one
4 | * or more contributor license agreements. See the NOTICE file
5 | * distributed with this work for additional information
6 | * regarding copyright ownership. The ASF licenses this file
7 | * to you under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance
9 | * with the License. You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 | --%>
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/org/apache/hadoop/hbase/mapred/RowCounter_Counters.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | # ResourceBundle properties file for RowCounter MR job
18 |
19 | CounterGroupName= RowCounter
20 |
21 | ROWS.name= Rows
22 |
--------------------------------------------------------------------------------
/src/main/resources/org/apache/hadoop/hbase/mapreduce/RowCounter_Counters.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | # ResourceBundle properties file for RowCounter MR job
18 |
19 | CounterGroupName= RowCounter
20 |
21 | ROWS.name= Rows
22 |
--------------------------------------------------------------------------------
/conf/hbase-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/packages/deb/conf-pseudo.control/prerm:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | /etc/init.d/hbase-regionserver stop 2>/dev/null >/dev/null
19 | /etc/init.d/hbase-master stop 2>/dev/null >/dev/null
20 | rm -f /etc/rc2.d/S94hbase-master
21 | rm -f /etc/rc2.d/S94hbase-regionserver
22 |
--------------------------------------------------------------------------------
/src/packages/deb/hbase.control/postinst:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | bash /usr/share/hbase/sbin/update-hbase-env.sh \
19 | --prefix=/usr \
20 | --bin-dir=/usr/bin \
21 | --conf-dir=/etc/hbase \
22 | --log-dir=/var/log/hbase \
23 | --pid-dir=/var/run/hbase
24 |
25 |
--------------------------------------------------------------------------------
/src/packages/deb/hbase.control/preinst:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | getent group hadoop 2>/dev/null >/dev/null || /usr/sbin/groupadd -r hadoop
19 |
20 | /usr/sbin/useradd --comment "HBase" --shell /bin/bash -M -r --groups hadoop --home /usr/share/hbase hbase 2> /dev/null || :
21 |
22 |
--------------------------------------------------------------------------------
/secondaryindex/src/main/java/org/apache/hadoop/hbase/index/GroupingCondition.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.index;
21 |
22 | public enum GroupingCondition {
23 | AND, OR
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/javadoc/org/apache/hadoop/hbase/io/hfile/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
20 |
21 |
23 | Provides the hbase data+index+metadata file.
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/main/javadoc/org/apache/hadoop/hbase/ipc/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
21 | Tools to help define network clients and servers.
22 | This is the hadoop copied local so can fix bugs and make hbase-specific optimizations.
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/main/resources/org/apache/hadoop/hbase/rest/protobuf/TableListMessage.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Apache Software Foundation
2 | //
3 | // Licensed to the Apache Software Foundation (ASF) under one
4 | // or more contributor license agreements. See the NOTICE file
5 | // distributed with this work for additional information
6 | // regarding copyright ownership. The ASF licenses this file
7 | // to you under the Apache License, Version 2.0 (the
8 | // "License"); you may not use this file except in compliance
9 | // with the License. You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | // Unless required by applicable law or agreed to in writing, software
14 | // distributed under the License is distributed on an "AS IS" BASIS,
15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | // See the License for the specific language governing permissions and
17 | // limitations under the License.
18 |
19 | package org.apache.hadoop.hbase.rest.protobuf.generated;
20 |
21 | message TableList {
22 | repeated string name = 1;
23 | }
24 |
--------------------------------------------------------------------------------
/dev-support/test-patch.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | MAVEN_OPTS="-Xmx3g"
17 |
18 | # The number of acceptable warning for *all* modules
19 | # Please update the per-module test-patch.properties if you update this file.
20 |
21 | OK_RELEASEAUDIT_WARNINGS=84
22 | OK_FINDBUGS_WARNINGS=768
23 | OK_JAVADOC_WARNINGS=169
24 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/ScanType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.regionserver;
19 |
20 | /**
21 | * Enum to distinguish general scan types.
22 | */
23 | public enum ScanType {
24 | MAJOR_COMPACT,
25 | MINOR_COMPACT,
26 | USER_SCAN
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/RegionOpeningState.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.regionserver;
21 |
22 | public enum RegionOpeningState {
23 |
24 | OPENED,
25 |
26 | ALREADY_OPENED,
27 |
28 | FAILED_OPENING;
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/ipc/Status.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.ipc;
19 |
20 | /**
21 | * Status of a Hadoop IPC call.
22 | */
23 | enum Status {
24 | SUCCESS (0),
25 | ERROR (1),
26 | FATAL (-1);
27 |
28 | int state;
29 | private Status(int state) {
30 | this.state = state;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/util/KeyRange.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.util;
21 |
22 | /**
23 | * A key range use in split coverage.
24 | */
25 | public interface KeyRange {
26 | abstract byte[] getStartKey();
27 |
28 | abstract byte[] getEndKey();
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/hadoop/hbase/coprocessor/GenericEndpoint.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.coprocessor;
19 |
20 | public class GenericEndpoint extends BaseEndpointCoprocessor implements
21 | GenericProtocol {
22 |
23 | @Override
24 | public T doWork(T genericObject) {
25 | return genericObject;
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/packages/deb/hbase.control/prerm:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | /etc/init.d/hbase-master stop 2>/dev/null >/dev/null
19 | /etc/init.d/hbase-regionserver stop 2>/dev/null >/dev/null
20 | bash /usr/share/hbase/sbin/update-hbase-env.sh \
21 | --prefix=/usr \
22 | --bin-dir=/usr/bin \
23 | --conf-dir=/etc/hbase \
24 | --log-dir=/var/log/hbase \
25 | --pid-dir=/var/run/hbase \
26 | --uninstal
27 |
28 |
--------------------------------------------------------------------------------
/src/packages/deb/conf-pseudo.control/control:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | Package: hbase-conf-pseudo
17 | Version: @version@
18 | Section: misc
19 | Priority: optional
20 | Architecture: all
21 | Depends: openjdk-6-jre-headless, hadoop, zookeeper, hbase
22 | Maintainer: Apache Software Foundation
23 | Description: HBase pseudo cluster configuration for single node cluster testing.
24 | Distribution: development
25 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/ipc/ServerNotRunningYetException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase.ipc;
22 |
23 | import java.io.IOException;
24 |
25 | public class ServerNotRunningYetException extends IOException {
26 | public ServerNotRunningYetException(String s) {
27 | super(s);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/resources/org/apache/hadoop/hbase/rest/protobuf/CellMessage.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Apache Software Foundation
2 | //
3 | // Licensed to the Apache Software Foundation (ASF) under one
4 | // or more contributor license agreements. See the NOTICE file
5 | // distributed with this work for additional information
6 | // regarding copyright ownership. The ASF licenses this file
7 | // to you under the Apache License, Version 2.0 (the
8 | // "License"); you may not use this file except in compliance
9 | // with the License. You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | // Unless required by applicable law or agreed to in writing, software
14 | // distributed under the License is distributed on an "AS IS" BASIS,
15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | // See the License for the specific language governing permissions and
17 | // limitations under the License.
18 |
19 | package org.apache.hadoop.hbase.rest.protobuf.generated;
20 |
21 | message Cell {
22 | optional bytes row = 1; // unused if Cell is in a CellSet
23 | optional bytes column = 2;
24 | optional int64 timestamp = 3;
25 | optional bytes data = 4;
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/resources/org/apache/hadoop/hbase/rest/protobuf/CellSetMessage.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Apache Software Foundation
2 | //
3 | // Licensed to the Apache Software Foundation (ASF) under one
4 | // or more contributor license agreements. See the NOTICE file
5 | // distributed with this work for additional information
6 | // regarding copyright ownership. The ASF licenses this file
7 | // to you under the Apache License, Version 2.0 (the
8 | // "License"); you may not use this file except in compliance
9 | // with the License. You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | // Unless required by applicable law or agreed to in writing, software
14 | // distributed under the License is distributed on an "AS IS" BASIS,
15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | // See the License for the specific language governing permissions and
17 | // limitations under the License.
18 |
19 | import "CellMessage.proto";
20 |
21 | package org.apache.hadoop.hbase.rest.protobuf.generated;
22 |
23 | message CellSet {
24 | message Row {
25 | required bytes key = 1;
26 | repeated Cell values = 2;
27 | }
28 | repeated Row rows = 1;
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/zk_dump.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class ZkDump < Command
24 | def help
25 | return <<-EOF
26 | Dump status of HBase cluster as seen by ZooKeeper.
27 | EOF
28 | end
29 |
30 | def command
31 | puts admin.zk_dump
32 | end
33 | end
34 | end
35 | end
36 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/TableExistsException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2007 The Apache Software Foundation
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.apache.hadoop.hbase;
17 |
18 | import java.io.IOException;
19 |
20 | /**
21 | * Thrown when a table exists but should not
22 | */
23 | public class TableExistsException extends IOException {
24 | private static final long serialVersionUID = 1L << 7 - 1L;
25 | /** default constructor */
26 | public TableExistsException() {
27 | super();
28 | }
29 |
30 | /**
31 | * Constructor
32 | *
33 | * @param s message
34 | */
35 | public TableExistsException(String s) {
36 | super(s);
37 | }
38 | }
--------------------------------------------------------------------------------
/src/site/xdoc/bulk-loads.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
19 |
20 |
21 | Bulk Loads in Apache HBase (TM)
22 |
23 |
24 |
25 | This page has been retired. The contents have been moved to the
26 | Bulk Loading section
27 | in the Reference Guide.
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/client/Row.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.client;
21 |
22 | import org.apache.hadoop.io.WritableComparable;
23 |
24 | /**
25 | * Has a row.
26 | */
27 | public interface Row extends WritableComparable {
28 | /**
29 | * @return The row.
30 | */
31 | public byte [] getRow();
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/rest/ResourceConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase.rest;
22 |
23 | import com.sun.jersey.api.core.PackagesResourceConfig;
24 |
25 | public class ResourceConfig extends PackagesResourceConfig {
26 | public ResourceConfig() {
27 | super("org.apache.hadoop.hbase.rest");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/rest/ResourceBase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase.rest;
22 |
23 | import java.io.IOException;
24 |
25 | public class ResourceBase implements Constants {
26 |
27 | RESTServlet servlet;
28 |
29 | public ResourceBase() throws IOException {
30 | servlet = RESTServlet.getInstance();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/resources/org/apache/hadoop/hbase/rest/protobuf/VersionMessage.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Apache Software Foundation
2 | //
3 | // Licensed to the Apache Software Foundation (ASF) under one
4 | // or more contributor license agreements. See the NOTICE file
5 | // distributed with this work for additional information
6 | // regarding copyright ownership. The ASF licenses this file
7 | // to you under the Apache License, Version 2.0 (the
8 | // "License"); you may not use this file except in compliance
9 | // with the License. You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | // Unless required by applicable law or agreed to in writing, software
14 | // distributed under the License is distributed on an "AS IS" BASIS,
15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | // See the License for the specific language governing permissions and
17 | // limitations under the License.
18 |
19 | package org.apache.hadoop.hbase.rest.protobuf.generated;
20 |
21 | message Version {
22 | optional string restVersion = 1;
23 | optional string jvmVersion = 2;
24 | optional string osVersion = 3;
25 | optional string serverVersion = 4;
26 | optional string jerseyVersion = 5;
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/whoami.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | module Shell
20 | module Commands
21 | class Whoami < Command
22 | def help
23 | return <<-EOF
24 | Show the current hbase user.
25 | Syntax : whoami
26 | For example:
27 |
28 | hbase> whoami
29 | EOF
30 | end
31 |
32 | def command()
33 | puts "#{org.apache.hadoop.hbase.security.User.getCurrent().toString()}"
34 | end
35 | end
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/hadoop/hbase/constraint/AllPassConstraint.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.constraint;
19 |
20 | import org.apache.hadoop.hbase.client.Put;
21 |
22 | /**
23 | * Simple test constraint that always allows the put to pass
24 | */
25 | public class AllPassConstraint extends BaseConstraint {
26 |
27 | @Override
28 | public void check(Put p) {
29 | // Do nothing - it passes
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/constraint/BaseConstraint.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.constraint;
19 |
20 | import org.apache.hadoop.conf.Configured;
21 |
22 | /**
23 | * Base class to use when actually implementing a {@link Constraint}. It takes
24 | * care of getting and setting of configuration for the constraint.
25 | */
26 | public abstract class BaseConstraint extends Configured implements Constraint {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/enable.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Enable < Command
24 | def help
25 | return <<-EOF
26 | Start enable of named table: e.g. "hbase> enable 't1'"
27 | EOF
28 | end
29 |
30 | def command(table)
31 | format_simple_command do
32 | admin.enable(table)
33 | end
34 | end
35 | end
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/disable.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Disable < Command
24 | def help
25 | return <<-EOF
26 | Start disable of named table: e.g. "hbase> disable 't1'"
27 | EOF
28 | end
29 |
30 | def command(table)
31 | format_simple_command do
32 | admin.disable(table)
33 | end
34 | end
35 | end
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/hadoop/hbase/constraint/AllFailConstraint.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.constraint;
19 |
20 | import org.apache.hadoop.hbase.client.Put;
21 |
22 | /**
23 | * Always fail the put.
24 | */
25 | public class AllFailConstraint extends BaseConstraint {
26 |
27 | @Override
28 | public void check(Put p) throws ConstraintException {
29 | throw new ConstraintException("AllFailConstraint fails for all puts");
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/secondaryindex/src/main/java/org/apache/hadoop/hbase/index/coprocessor/regionserver/SeekUnderValueException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.index.coprocessor.regionserver;
21 |
22 | import java.io.IOException;
23 |
24 | // TODO better name?
25 | public class SeekUnderValueException extends IOException {
26 |
27 | private static final long serialVersionUID = -4319585454456479286L;
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/drop.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Drop < Command
24 | def help
25 | return <<-EOF
26 | Drop the named table. Table must first be disabled: e.g. "hbase> drop 't1'"
27 | EOF
28 | end
29 |
30 | def command(table)
31 | format_simple_command do
32 | admin.drop(table)
33 | end
34 | end
35 | end
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/io/encoding/EncoderBufferTooSmallException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with this
4 | * work for additional information regarding copyright ownership. The ASF
5 | * licenses this file to you under the Apache License, Version 2.0 (the
6 | * "License"); you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations
15 | * under the License.
16 | */
17 | package org.apache.hadoop.hbase.io.encoding;
18 |
19 | /**
20 | * Internal error which indicates a bug in a data block encoding algorithm.
21 | */
22 | public class EncoderBufferTooSmallException extends RuntimeException {
23 | private static final long serialVersionUID = 4767495176134878737L;
24 |
25 | public EncoderBufferTooSmallException(String message) {
26 | super(message);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/delete_snapshot.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | module Shell
20 | module Commands
21 | class DeleteSnapshot < Command
22 | def help
23 | return <<-EOF
24 | Delete a specified snapshot. Examples:
25 |
26 | hbase> delete_snapshot 'snapshotName',
27 | EOF
28 | end
29 |
30 | def command(snapshot_name)
31 | format_simple_command do
32 | admin.delete_snapshot(snapshot_name)
33 | end
34 | end
35 | end
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/snapshot.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | module Shell
20 | module Commands
21 | class Snapshot < Command
22 | def help
23 | return <<-EOF
24 | Take a snapshot of specified table. Examples:
25 |
26 | hbase> snapshot 'sourceTable', 'snapshotName'
27 | EOF
28 | end
29 |
30 | def command(table, snapshot_name)
31 | format_simple_command do
32 | admin.snapshot(table, snapshot_name)
33 | end
34 | end
35 | end
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/ipc/RpcCallContext.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.ipc;
19 |
20 | public interface RpcCallContext extends Delayable {
21 |
22 | /**
23 | * Throw an exception if the caller who made this IPC call has disconnected.
24 | * If called from outside the context of IPC, this does nothing.
25 | * @throws CallerDisconnectedException
26 | */
27 | void throwExceptionIfCallerDisconnected() throws CallerDisconnectedException;
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/Stoppable.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase;
21 |
22 | /**
23 | * Implementers are Stoppable.
24 | */
25 | public interface Stoppable {
26 | /**
27 | * Stop this service.
28 | * @param why Why we're stopping.
29 | */
30 | public void stop(String why);
31 |
32 | /**
33 | * @return True if {@link #stop(String)} has been closed.
34 | */
35 | public boolean isStopped();
36 | }
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionServerCoprocessorEnvironment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.hadoop.hbase.coprocessor;
20 |
21 | import org.apache.hadoop.hbase.CoprocessorEnvironment;
22 | import org.apache.hadoop.hbase.regionserver.RegionServerServices;
23 |
24 | public interface RegionServerCoprocessorEnvironment extends CoprocessorEnvironment {
25 |
26 | /** @return reference to the HMaster services */
27 | RegionServerServices getRegionServerServices();
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/coprocessor/WALCoprocessorEnvironment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase.coprocessor;
22 |
23 | import org.apache.hadoop.hbase.CoprocessorEnvironment;
24 | import org.apache.hadoop.hbase.regionserver.wal.HLog;
25 |
26 | public interface WALCoprocessorEnvironment extends CoprocessorEnvironment {
27 | /** @return reference to the region server services */
28 | public HLog getWAL();
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/resources/org/apache/hadoop/hbase/rest/protobuf/ScannerMessage.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Apache Software Foundation
2 | //
3 | // Licensed to the Apache Software Foundation (ASF) under one
4 | // or more contributor license agreements. See the NOTICE file
5 | // distributed with this work for additional information
6 | // regarding copyright ownership. The ASF licenses this file
7 | // to you under the Apache License, Version 2.0 (the
8 | // "License"); you may not use this file except in compliance
9 | // with the License. You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | // Unless required by applicable law or agreed to in writing, software
14 | // distributed under the License is distributed on an "AS IS" BASIS,
15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | // See the License for the specific language governing permissions and
17 | // limitations under the License.
18 |
19 | package org.apache.hadoop.hbase.rest.protobuf.generated;
20 |
21 | message Scanner {
22 | optional bytes startRow = 1;
23 | optional bytes endRow = 2;
24 | repeated bytes columns = 3;
25 | optional int32 batch = 4;
26 | optional int64 startTime = 5;
27 | optional int64 endTime = 6;
28 | optional int32 maxVersions = 7;
29 | optional string filter = 8;
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/resources/org/apache/hadoop/hbase/rest/protobuf/TableInfoMessage.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Apache Software Foundation
2 | //
3 | // Licensed to the Apache Software Foundation (ASF) under one
4 | // or more contributor license agreements. See the NOTICE file
5 | // distributed with this work for additional information
6 | // regarding copyright ownership. The ASF licenses this file
7 | // to you under the Apache License, Version 2.0 (the
8 | // "License"); you may not use this file except in compliance
9 | // with the License. You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | // Unless required by applicable law or agreed to in writing, software
14 | // distributed under the License is distributed on an "AS IS" BASIS,
15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | // See the License for the specific language governing permissions and
17 | // limitations under the License.
18 |
19 | package org.apache.hadoop.hbase.rest.protobuf.generated;
20 |
21 | message TableInfo {
22 | required string name = 1;
23 | message Region {
24 | required string name = 1;
25 | optional bytes startKey = 2;
26 | optional bytes endKey = 3;
27 | optional int64 id = 4;
28 | optional string location = 5;
29 | }
30 | repeated Region regions = 2;
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/ClockOutOfSyncException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase;
21 |
22 | import java.io.IOException;
23 |
24 | /**
25 | * This exception is thrown by the master when a region server clock skew is
26 | * too high.
27 | */
28 | @SuppressWarnings("serial")
29 | public class ClockOutOfSyncException extends IOException {
30 | public ClockOutOfSyncException(String message) {
31 | super(message);
32 | }
33 | }
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterCoprocessorEnvironment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase.coprocessor;
22 |
23 | import org.apache.hadoop.hbase.CoprocessorEnvironment;
24 | import org.apache.hadoop.hbase.master.MasterServices;
25 |
26 | public interface MasterCoprocessorEnvironment extends CoprocessorEnvironment {
27 | /** @return reference to the HMaster services */
28 | MasterServices getMasterServices();
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/EmptyWatcher.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2009 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase;
21 |
22 | import org.apache.zookeeper.Watcher;
23 | import org.apache.zookeeper.WatchedEvent;
24 |
25 | /**
26 | * An empty ZooKeeper watcher
27 | */
28 | public class EmptyWatcher implements Watcher {
29 | public static EmptyWatcher instance = new EmptyWatcher();
30 | private EmptyWatcher() {}
31 |
32 | public void process(WatchedEvent event) {}
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/ChangedReadersObserver.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase.regionserver;
22 |
23 | import java.io.IOException;
24 |
25 |
26 | /**
27 | * If set of MapFile.Readers in Store change, implementors are notified.
28 | */
29 | public interface ChangedReadersObserver {
30 | /**
31 | * Notify observers.
32 | * @throws IOException e
33 | */
34 | void updateReaders() throws IOException;
35 | }
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerStoppedException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.regionserver;
21 |
22 | import java.io.IOException;
23 |
24 | /**
25 | * Thrown by the region server when it is in shutting down state.
26 | */
27 | @SuppressWarnings("serial")
28 | public class RegionServerStoppedException extends IOException {
29 |
30 | public RegionServerStoppedException(String s) {
31 | super(s);
32 | }
33 | }
--------------------------------------------------------------------------------
/src/packages/deb/hbase.control/control:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | Package: hbase
17 | Version: @version@
18 | Section: misc
19 | Priority: optional
20 | Architecture: all
21 | Depends: openjdk-6-jre-headless, hadoop, zookeeper
22 | Maintainer: Apache Software Foundation
23 | Description: HBase is the Hadoop database. Use it when you need random, realtime read/write access to your Big Data. This project's goal is the hosting of very large tables -- billions of rows X millions of columns -- atop clusters of commodity hardware.
24 | Distribution: development
25 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/hadoop/hbase/constraint/RuntimeFailConstraint.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.constraint;
19 |
20 | import org.apache.hadoop.hbase.client.Put;
21 |
22 | /**
23 | * Always non-gracefully fail on attempt
24 | */
25 | public class RuntimeFailConstraint extends BaseConstraint {
26 |
27 | @Override
28 | public void check(Put p) throws ConstraintException {
29 | throw new RuntimeException(
30 | "RuntimeFailConstraint always throws a runtime exception");
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCErrorHandler.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase.ipc;
22 |
23 | /**
24 | * An interface for calling out of RPC for error conditions.
25 | */
26 | public interface HBaseRPCErrorHandler {
27 | /**
28 | * Take actions on the event of an OutOfMemoryError.
29 | * @param e the throwable
30 | * @return if the server should be shut down
31 | */
32 | public boolean checkOOME(final Throwable e) ;
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/DroppedSnapshotException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2007 The Apache Software Foundation
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.apache.hadoop.hbase;
17 | import java.io.IOException;
18 |
19 |
20 | /**
21 | * Thrown during flush if the possibility snapshot content was not properly
22 | * persisted into store files. Response should include replay of hlog content.
23 | */
24 | public class DroppedSnapshotException extends IOException {
25 |
26 | private static final long serialVersionUID = -5463156580831677374L;
27 |
28 | /**
29 | * @param msg
30 | */
31 | public DroppedSnapshotException(String msg) {
32 | super(msg);
33 | }
34 |
35 | /**
36 | * default constructor
37 | */
38 | public DroppedSnapshotException() {
39 | super();
40 | }
41 | }
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/alter_status.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class AlterStatus < Command
24 | def help
25 | return <<-EOF
26 | Get the status of the alter command. Indicates the number of regions of the
27 | table that have received the updated schema
28 | Pass table name.
29 |
30 | hbase> alter_status 't1'
31 | EOF
32 | end
33 | def command(table)
34 | admin.alter_status(table)
35 | end
36 | end
37 | end
38 | end
39 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/is_enabled.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class IsEnabled < Command
24 | def help
25 | return <<-EOF
26 | Is named table enabled?: e.g. "hbase> is_enabled 't1'"
27 | EOF
28 | end
29 |
30 | def command(table)
31 | format_simple_command do
32 | formatter.row([
33 | admin.enabled?(table)? "true" : "false"
34 | ])
35 | end
36 | end
37 | end
38 | end
39 | end
40 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/UnknownRegionException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase;
21 |
22 | import java.io.IOException;
23 |
24 | /**
25 | * Thrown when we are asked to operate on a region we know nothing about.
26 | */
27 | public class UnknownRegionException extends IOException {
28 | private static final long serialVersionUID = 1968858760475205392L;
29 |
30 | public UnknownRegionException(String regionName) {
31 | super(regionName);
32 | }
33 | }
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TDeleteType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.8.0)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | package org.apache.hadoop.hbase.thrift2.generated;
8 |
9 |
10 | import java.util.Map;
11 | import java.util.HashMap;
12 | import org.apache.thrift.TEnum;
13 |
14 | /**
15 | * Specify type of delete:
16 | * - DELETE_COLUMN means exactly one version will be removed,
17 | * - DELETE_COLUMNS means previous versions will also be removed.
18 | */
19 | public enum TDeleteType implements org.apache.thrift.TEnum {
20 | DELETE_COLUMN(0),
21 | DELETE_COLUMNS(1);
22 |
23 | private final int value;
24 |
25 | private TDeleteType(int value) {
26 | this.value = value;
27 | }
28 |
29 | /**
30 | * Get the integer value of this enum value, as defined in the Thrift IDL.
31 | */
32 | public int getValue() {
33 | return value;
34 | }
35 |
36 | /**
37 | * Find a the enum type by its integer value, as defined in the Thrift IDL.
38 | * @return null if the value is not found.
39 | */
40 | public static TDeleteType findByValue(int value) {
41 | switch (value) {
42 | case 0:
43 | return DELETE_COLUMN;
44 | case 1:
45 | return DELETE_COLUMNS;
46 | default:
47 | return null;
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/is_disabled.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class IsDisabled < Command
24 | def help
25 | return <<-EOF
26 | Is named table disabled?: e.g. "hbase> is_disabled 't1'"
27 | EOF
28 | end
29 |
30 | def command(table)
31 | format_simple_command do
32 | formatter.row([
33 | admin.disabled?(table)? "true" : "false"
34 | ])
35 | end
36 | end
37 | end
38 | end
39 | end
40 |
--------------------------------------------------------------------------------
/secondaryindex/src/main/java/org/apache/hadoop/hbase/index/coprocessor/regionserver/ReInitializableRegionScanner.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.index.coprocessor.regionserver;
21 |
22 | import java.io.IOException;
23 |
24 | import org.apache.hadoop.hbase.regionserver.RegionScanner;
25 |
26 | public interface ReInitializableRegionScanner extends SeekAndReadRegionScanner {
27 |
28 | // TODO better name
29 | void reInit(RegionScanner rs) throws IOException;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/ruby/shell/commands_test.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | require 'shell'
22 | require 'shell/formatter'
23 |
24 | class ShellCommandsTest < Test::Unit::TestCase
25 | Shell.commands.each do |name, klass|
26 | define_test "#{name} command class #{klass} should respond to help" do
27 | assert_respond_to(klass.new(nil), :help)
28 | end
29 |
30 | define_test "#{name} command class #{klass} should respond to :command" do
31 | assert_respond_to(klass.new(nil), :command)
32 | end
33 | end
34 | end
35 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/util/EnvironmentEdge.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.util;
21 |
22 | /**
23 | * Has some basic interaction with the environment. Alternate implementations
24 | * can be used where required (eg in tests).
25 | *
26 | * @see EnvironmentEdgeManager
27 | */
28 | public interface EnvironmentEdge {
29 |
30 | /**
31 | * Returns the currentTimeMillis.
32 | *
33 | * @return currentTimeMillis.
34 | */
35 | long currentTimeMillis();
36 | }
37 |
--------------------------------------------------------------------------------
/src/packages/deb/conf-pseudo.control/postinst:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | /etc/init.d/hadoop-namenode start 2>/dev/null >/dev/null
19 | /etc/init.d/hadoop-datanode start 2>/dev/null >/dev/null
20 | su - hdfs -c "hadoop fs -mkdir /hbase" 2>/dev/null >/dev/null
21 | su - hdfs -c "hadoop fs -chown hbase /hbase" 2>/dev/null >/dev/null
22 | /etc/init.d/hbase-master start 2>/dev/null >/dev/null
23 | /etc/init.d/hbase-regionserver start 2>/dev/null >/dev/null
24 | ln -sf ../init.d/hbase-master /etc/rc2.d/S94hbase-master
25 | ln -sf ../init.d/hbase-regionserver /etc/rc6.d/S94hbase-regionserver
26 |
27 |
--------------------------------------------------------------------------------
/secondaryindex/src/main/java/org/apache/hadoop/hbase/index/coprocessor/regionserver/LeafFilterNode.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.index.coprocessor.regionserver;
21 |
22 | import org.apache.hadoop.hbase.index.IndexSpecification;
23 |
24 | interface LeafFilterNode extends FilterNode {
25 | FilterColumnValueDetail getFilterColumnValueDetail();
26 |
27 | void setFilterColumnValueDetail(FilterColumnValueDetail filterColumnValueDetail);
28 |
29 | IndexSpecification getBestIndex();
30 | }
31 |
--------------------------------------------------------------------------------
/src/examples/thrift/Makefile:
--------------------------------------------------------------------------------
1 | # Copyright 2008 The Apache Software Foundation
2 | #
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 |
19 | # Makefile for C++ Hbase Thrift DemoClient
20 | # NOTE: run 'thrift -cpp Hbase.thrift' first
21 |
22 | THRIFT_DIR = /usr/local/include/thrift
23 | LIB_DIR = /usr/local/lib
24 |
25 | GEN_SRC = ./gen-cpp/Hbase.cpp \
26 | ./gen-cpp/Hbase_types.cpp \
27 | ./gen-cpp/Hbase_constants.cpp
28 |
29 | default: DemoClient
30 |
31 | DemoClient: DemoClient.cpp
32 | g++ -o DemoClient -I${THRIFT_DIR} -I./gen-cpp -L${LIB_DIR} -lthrift DemoClient.cpp ${GEN_SRC}
33 |
34 | clean:
35 | rm -rf DemoClient
36 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/remove_peer.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class RemovePeer< Command
24 | def help
25 | return <<-EOF
26 | Stops the specified replication stream and deletes all the meta
27 | information kept about it. Examples:
28 |
29 | hbase> remove_peer '1'
30 | EOF
31 | end
32 |
33 | def command(id)
34 | format_simple_command do
35 | replication_admin.remove_peer(id)
36 | end
37 | end
38 | end
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/hadoop/hbase/SmallTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase;
22 |
23 | /**
24 | * Tag a test as 'small', meaning that the test class has the following
25 | * characteristics:
26 | * - can be run simultaneously with other small tests in the same JVM
27 | * - ideally, last less than 15 seconds
28 | * - does not use a cluster
29 | *
30 | * @see MediumTests
31 | * @see LargeTests
32 | * @see IntegrationTests
33 | */
34 | public interface SmallTests {
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/assign.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Assign < Command
24 | def help
25 | return <<-EOF
26 | Assign a region.Use with caution.If region already assigned,
27 | this command will just go ahead and reassign
28 | the region anyways. For experts only.
29 | EOF
30 | end
31 |
32 | def command(region_name)
33 | format_simple_command do
34 | admin.assign(region_name)
35 | end
36 | end
37 | end
38 | end
39 | end
40 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/exists.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Exists < Command
24 | def help
25 | return <<-EOF
26 | Does the named table exist? e.g. "hbase> exists 't1'"
27 | EOF
28 | end
29 |
30 | def command(table)
31 | format_simple_command do
32 | formatter.row([
33 | "Table #{table} " + (admin.exists?(table.to_s) ? "does exist" : "does not exist")
34 | ])
35 | end
36 | end
37 | end
38 | end
39 | end
40 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/truncate.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Truncate < Command
24 | def help
25 | return <<-EOF
26 | Disables, drops and recreates the specified table.
27 | EOF
28 | end
29 |
30 | def command(table)
31 | format_simple_command do
32 | puts "Truncating '#{table}' table (it may take a while):"
33 | admin.truncate(table) { |log| puts " - #{log}" }
34 | end
35 | end
36 |
37 | end
38 | end
39 | end
40 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/RegionAlreadyInTransitionException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.regionserver;
21 |
22 | import java.io.IOException;
23 |
24 | /**
25 | * This exception is thrown when a region server is asked to open or close
26 | * a region but it's already processing it
27 | */
28 | public class RegionAlreadyInTransitionException extends IOException {
29 |
30 | public RegionAlreadyInTransitionException(String s) {
31 | super(s);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/enable_peer.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class EnablePeer< Command
24 | def help
25 | return <<-EOF
26 | Restarts the replication to the specified peer cluster,
27 | continuing from where it was disabled.
28 |
29 | Examples:
30 |
31 | hbase> enable_peer '1'
32 | EOF
33 | end
34 |
35 | def command(id)
36 | format_simple_command do
37 | replication_admin.enable_peer(id)
38 | end
39 | end
40 | end
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/io/WritableWithSize.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase.io;
22 |
23 | /**
24 | * An optional interface to 'size' writables.
25 | */
26 | public interface WritableWithSize {
27 | /**
28 | * Provide a size hint to the caller. write() should ideally
29 | * not go beyond this if at all possible.
30 | *
31 | * You can return 0 if there is no size hint.
32 | *
33 | * @return the size of the writable
34 | */
35 | public long getWritableSize();
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheableDeserializer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.io.hfile;
19 |
20 | import java.io.IOException;
21 | import java.nio.ByteBuffer;
22 |
23 | /**
24 | * Interface for a deserializer. Throws an IOException if the serialized data is
25 | * incomplete or wrong.
26 | * */
27 | public interface CacheableDeserializer {
28 | /**
29 | * Returns the deserialized object.
30 | *
31 | * @return T the deserialized object.
32 | */
33 | public T deserialize(ByteBuffer b) throws IOException;
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/util/DefaultEnvironmentEdge.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.util;
21 |
22 | /**
23 | * Default implementation of an environment edge.
24 | */
25 | public class DefaultEnvironmentEdge implements EnvironmentEdge {
26 |
27 |
28 | /**
29 | * {@inheritDoc}
30 | *
31 | * This implementation returns {@link System#currentTimeMillis()}
32 | */
33 | @Override
34 | public long currentTimeMillis() {
35 | return System.currentTimeMillis();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/resources/org/apache/hadoop/hbase/rest/protobuf/ColumnSchemaMessage.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Apache Software Foundation
2 | //
3 | // Licensed to the Apache Software Foundation (ASF) under one
4 | // or more contributor license agreements. See the NOTICE file
5 | // distributed with this work for additional information
6 | // regarding copyright ownership. The ASF licenses this file
7 | // to you under the Apache License, Version 2.0 (the
8 | // "License"); you may not use this file except in compliance
9 | // with the License. You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | // Unless required by applicable law or agreed to in writing, software
14 | // distributed under the License is distributed on an "AS IS" BASIS,
15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | // See the License for the specific language governing permissions and
17 | // limitations under the License.
18 |
19 | package org.apache.hadoop.hbase.rest.protobuf.generated;
20 |
21 | message ColumnSchema {
22 | optional string name = 1;
23 | message Attribute {
24 | required string name = 1;
25 | required string value = 2;
26 | }
27 | repeated Attribute attrs = 2;
28 | // optional helpful encodings of commonly used attributes
29 | optional int32 ttl = 3;
30 | optional int32 maxVersions = 4;
31 | optional string compression = 5;
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/status.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Status < Command
24 | def help
25 | return <<-EOF
26 | Show cluster status. Can be 'summary', 'simple', or 'detailed'. The
27 | default is 'summary'. Examples:
28 |
29 | hbase> status
30 | hbase> status 'simple'
31 | hbase> status 'summary'
32 | hbase> status 'detailed'
33 | EOF
34 | end
35 |
36 | def command(format = 'summary')
37 | admin.status(format)
38 | end
39 | end
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/TableNotFoundException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2007 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase;
21 |
22 | /** Thrown when a table can not be located */
23 | public class TableNotFoundException extends RegionException {
24 | private static final long serialVersionUID = 993179627856392526L;
25 |
26 | /** default constructor */
27 | public TableNotFoundException() {
28 | super();
29 | }
30 |
31 | /** @param s message */
32 | public TableNotFoundException(String s) {
33 | super(s);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/truncate_preserve.rb:
--------------------------------------------------------------------------------
1 | #
2 | #
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | module Shell
21 | module Commands
22 | class TruncatePreserve < Command
23 | def help
24 | return <<-EOF
25 | Disables, drops and recreates the specified table while still maintaing the previous region boundaries.
26 | EOF
27 | end
28 |
29 | def command(table)
30 | format_simple_command do
31 | puts "Truncating '#{table}' table (it may take a while):"
32 | admin.truncate_preserve(table) { |log| puts " - #{log}" }
33 | end
34 | end
35 |
36 | end
37 | end
38 | end
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/disable_peer.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class DisablePeer< Command
24 | def help
25 | return <<-EOF
26 | Stops the replication stream to the specified cluster, but still
27 | keeps track of new edits to replicate.
28 |
29 | Examples:
30 |
31 | hbase> disable_peer '1'
32 | EOF
33 | end
34 |
35 | def command(id)
36 | format_simple_command do
37 | replication_admin.disable_peer(id)
38 | end
39 | end
40 | end
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/DisabledRegionSplitPolicy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.hadoop.hbase.regionserver;
20 |
21 | /**
22 | * A {@link RegionSplitPolicy} that disables region splits.
23 | * This should be used with care, since it will disable automatic sharding.
24 | * Most of the time, using {@link ConstantSizeRegionSplitPolicy} with a
25 | * large region size (10GB, etc) is safer.
26 | */
27 | public class DisabledRegionSplitPolicy extends RegionSplitPolicy {
28 | @Override
29 | protected boolean shouldSplit() {
30 | return false;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/version.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Version < Command
24 | def help
25 | return <<-EOF
26 | Output this HBase version
27 | EOF
28 | end
29 |
30 | def command
31 | # Output version.
32 | puts "#{org.apache.hadoop.hbase.util.VersionInfo.getVersion()}, " +
33 | "r#{org.apache.hadoop.hbase.util.VersionInfo.getRevision()}, " +
34 | "#{org.apache.hadoop.hbase.util.VersionInfo.getDate()}"
35 | end
36 | end
37 | end
38 | end
39 |
--------------------------------------------------------------------------------
/src/examples/mapreduce/index-builder-setup.rb:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | # Set up sample data for IndexBuilder example
18 | create "people", "attributes"
19 | create "people-email", "INDEX"
20 | create "people-phone", "INDEX"
21 | create "people-name", "INDEX"
22 |
23 | [["1", "jenny", "jenny@example.com", "867-5309"],
24 | ["2", "alice", "alice@example.com", "555-1234"],
25 | ["3", "kevin", "kevinpet@example.com", "555-1212"]].each do |fields|
26 | (id, name, email, phone) = *fields
27 | put "people", id, "attributes:name", name
28 | put "people", id, "attributes:email", email
29 | put "people", id, "attributes:phone", phone
30 | end
31 |
32 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/flush.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Flush < Command
24 | def help
25 | return <<-EOF
26 | Flush all regions in passed table or pass a region row to
27 | flush an individual region. For example:
28 |
29 | hbase> flush 'TABLENAME'
30 | hbase> flush 'REGIONNAME'
31 | EOF
32 | end
33 |
34 | def command(table_or_region_name)
35 | format_simple_command do
36 | admin.flush(table_or_region_name)
37 | end
38 | end
39 | end
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/YouAreDeadException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase;
21 |
22 | import java.io.IOException;
23 |
24 | /**
25 | * This exception is thrown by the master when a region server reports and is
26 | * already being processed as dead. This can happen when a region server loses
27 | * its session but didn't figure it yet.
28 | */
29 | @SuppressWarnings("serial")
30 | public class YouAreDeadException extends IOException {
31 | public YouAreDeadException(String message) {
32 | super(message);
33 | }
34 | }
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/ipc/CallerDisconnectedException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.ipc;
19 |
20 | import java.io.IOException;
21 |
22 | /**
23 | * Exception indicating that the remote host making this IPC lost its
24 | * IPC connection. This will never be returned back to a client,
25 | * but is only used for logging on the server side, etc.
26 | */
27 | public class CallerDisconnectedException extends IOException {
28 | public CallerDisconnectedException(String msg) {
29 | super(msg);
30 | }
31 |
32 | private static final long serialVersionUID = 1L;
33 |
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/io/hfile/CorruptHFileException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.io.hfile;
19 |
20 | import org.apache.hadoop.hbase.DoNotRetryIOException;
21 |
22 | /**
23 | * This exception is thrown when attempts to read an HFile fail due to corruption or truncation
24 | * issues.
25 | */
26 | public class CorruptHFileException extends DoNotRetryIOException {
27 | private static final long serialVersionUID = 1L;
28 |
29 | CorruptHFileException(String m, Throwable t) {
30 | super(m, t);
31 | }
32 |
33 | CorruptHFileException(String m) {
34 | super(m);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/io/hfile/InvalidHFileException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.io.hfile;
19 |
20 | import java.io.IOException;
21 |
22 | /**
23 | * Thrown when an invalid HFile format is detected
24 | */
25 | public class InvalidHFileException extends IOException {
26 | private static final long serialVersionUID = 4660352028739861249L;
27 |
28 | /** constructor */
29 | public InvalidHFileException() {
30 | super();
31 | }
32 |
33 | /**
34 | * Constructor
35 | * @param s message
36 | */
37 | public InvalidHFileException(String s) {
38 | super(s);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/master/handler/TotesHRegionInfo.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.master.handler;
21 |
22 | import java.beans.EventHandler;
23 |
24 | import org.apache.hadoop.hbase.HRegionInfo;
25 |
26 | /**
27 | * Implementors tote an HRegionInfo instance.
28 | * This is a marker interface that can be put on {@link EventHandler}s that
29 | * have an {@link HRegionInfo}.
30 | */
31 | public interface TotesHRegionInfo {
32 | /**
33 | * @return HRegionInfo instance.
34 | */
35 | public HRegionInfo getHRegionInfo();
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/security/TokenInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.hadoop.hbase.security;
20 |
21 | import java.lang.annotation.ElementType;
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 | import java.lang.annotation.Target;
25 |
26 | /**
27 | * Indicates Token related information to be used in authorizing connections
28 | * over a given RPC protocol interface.
29 | */
30 | @Retention(RetentionPolicy.RUNTIME)
31 | @Target(ElementType.TYPE)
32 | public @interface TokenInfo {
33 | /** The type of Token.getKind() to be handled */
34 | String value();
35 | }
--------------------------------------------------------------------------------
/src/main/resources/org/apache/hadoop/hbase/rest/protobuf/TableSchemaMessage.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Apache Software Foundation
2 | //
3 | // Licensed to the Apache Software Foundation (ASF) under one
4 | // or more contributor license agreements. See the NOTICE file
5 | // distributed with this work for additional information
6 | // regarding copyright ownership. The ASF licenses this file
7 | // to you under the Apache License, Version 2.0 (the
8 | // "License"); you may not use this file except in compliance
9 | // with the License. You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | // Unless required by applicable law or agreed to in writing, software
14 | // distributed under the License is distributed on an "AS IS" BASIS,
15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | // See the License for the specific language governing permissions and
17 | // limitations under the License.
18 |
19 | import "ColumnSchemaMessage.proto";
20 |
21 | package org.apache.hadoop.hbase.rest.protobuf.generated;
22 |
23 | message TableSchema {
24 | optional string name = 1;
25 | message Attribute {
26 | required string name = 1;
27 | required string value = 2;
28 | }
29 | repeated Attribute attrs = 2;
30 | repeated ColumnSchema columns = 3;
31 | // optional helpful encodings of commonly used attributes
32 | optional bool inMemory = 4;
33 | optional bool readOnly = 5;
34 | }
35 |
--------------------------------------------------------------------------------
/src/test/resources/org/apache/hadoop/hbase/PerformanceEvaluation_Counter.properties:
--------------------------------------------------------------------------------
1 | # ResourceBundle properties file for Map-Reduce counters
2 |
3 | #/**
4 | # * Copyright 2007 The Apache Software Foundation
5 | # *
6 | # * Licensed to the Apache Software Foundation (ASF) under one
7 | # * or more contributor license agreements. See the NOTICE file
8 | # * distributed with this work for additional information
9 | # * regarding copyright ownership. The ASF licenses this file
10 | # * to you under the Apache License, Version 2.0 (the
11 | # * "License"); you may not use this file except in compliance
12 | # * with the License. You may obtain a copy of the License at
13 | # *
14 | # * http://www.apache.org/licenses/LICENSE-2.0
15 | # *
16 | # * Unless required by applicable law or agreed to in writing, software
17 | # * distributed under the License is distributed on an "AS IS" BASIS,
18 | # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | # * See the License for the specific language governing permissions and
20 | # * limitations under the License.
21 | # */
22 |
23 | CounterGroupName= HBase Performance Evaluation
24 | ELAPSED_TIME.name= Elapsed time in milliseconds
25 | ROWS.name= Row count
26 | # ResourceBundle properties file for Map-Reduce counters
27 |
28 | CounterGroupName= HBase Performance Evaluation
29 | ELAPSED_TIME.name= Elapsed time in milliseconds
30 | ROWS.name= Row count
31 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/restore_snapshot.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | module Shell
20 | module Commands
21 | class RestoreSnapshot < Command
22 | def help
23 | return <<-EOF
24 | Restore a specified snapshot.
25 | The restore will replace the content of the original table,
26 | bringing back the content to the snapshot state.
27 | The table must be disabled.
28 |
29 | Examples:
30 | hbase> restore_snapshot 'snapshotName'
31 | EOF
32 | end
33 |
34 | def command(snapshot_name)
35 | format_simple_command do
36 | admin.restore_snapshot(snapshot_name)
37 | end
38 | end
39 | end
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/src/site/xdoc/pseudo-distributed.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 |
20 |
23 |
24 |
25 | Running Apache HBase (TM) in pseudo-distributed mode
26 |
27 |
28 |
29 |
30 | This page has been retired. The contents have been moved to the
31 | Distributed Operation: Pseudo- and Fully-distributed modes section
32 | in the Reference Guide.
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/client/RegionOfflineException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.client;
21 |
22 | import org.apache.hadoop.hbase.RegionException;
23 |
24 | /** Thrown when a table can not be located */
25 | public class RegionOfflineException extends RegionException {
26 | private static final long serialVersionUID = 466008402L;
27 | /** default constructor */
28 | public RegionOfflineException() {
29 | super();
30 | }
31 |
32 | /** @param s message */
33 | public RegionOfflineException(String s) {
34 | super(s);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/javadoc/org/apache/hadoop/hbase/thrift/doc-files/style.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /* Auto-generated CSS for generated Thrift docs */
19 | body { font-family: Tahoma, sans-serif; }
20 | pre { background-color: #dddddd; padding: 6px; }
21 | h3,h4 { padding-top: 0px; margin-top: 0px; }
22 | div.definition { border: 1px solid gray; margin: 10px; padding: 10px; }
23 | div.extends { margin: -0.5em 0 1em 5em }
24 | table { border: 1px solid grey; border-collapse: collapse; }
25 | td { border: 1px solid grey; padding: 1px 6px; vertical-align: top; }
26 | th { border: 1px solid black; background-color: #bbbbbb;
27 | text-align: left; padding: 1px 6px; }
28 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/revoke.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | module Shell
20 | module Commands
21 | class Revoke < Command
22 | def help
23 | return <<-EOF
24 | Revoke a user's access rights.
25 | Syntax : revoke [ [ []]
26 | For example:
27 |
28 | hbase> revoke 'bobsmith'
29 | hbase> revoke 'bobsmith', 't1', 'f1', 'col1'
30 | EOF
31 | end
32 |
33 | def command(user, table_name=nil, family=nil, qualifier=nil)
34 | format_simple_command do
35 | security_admin.revoke(user, table_name, family, qualifier)
36 | end
37 | end
38 | end
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/hadoop/hbase/constraint/WorksConstraint.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.constraint;
19 |
20 | import org.apache.hadoop.hbase.client.Put;
21 |
22 | /**
23 | * It just works
24 | */
25 | public class WorksConstraint extends BaseConstraint {
26 | @Override
27 | public void check(Put p) {
28 | // NOOP
29 | }
30 |
31 | /**
32 | * Constraint to check that the naming of constraints doesn't mess up the
33 | * pattern matching.(that constraint $___Constraint$NameConstraint isn't a
34 | * problem)
35 | */
36 | public static class NameConstraint extends WorksConstraint {
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/hadoop/hbase/util/StoppableImplementation.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.hadoop.hbase.util;
20 |
21 | import org.apache.hadoop.classification.InterfaceAudience;
22 | import org.apache.hadoop.hbase.Stoppable;
23 |
24 | /**
25 | * A base implementation for a Stoppable service
26 | */
27 | @InterfaceAudience.Private
28 | public class StoppableImplementation implements Stoppable {
29 | volatile boolean stopped = false;
30 |
31 | @Override
32 | public void stop(String why) {
33 | this.stopped = true;
34 | }
35 |
36 | @Override
37 | public boolean isStopped() {
38 | return stopped;
39 | }
40 | }
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionServerObserver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.hadoop.hbase.coprocessor;
20 |
21 | import java.io.IOException;
22 |
23 | import org.apache.hadoop.hbase.Coprocessor;
24 |
25 | public interface RegionServerObserver extends Coprocessor {
26 |
27 | /**
28 | * Called before stopping region server.
29 | * @param env An instance of RegionServerCoprocessorEnvironment
30 | * @throws IOException Signals that an I/O exception has occurred.
31 | */
32 | void preStopRegionServer(final ObserverContext env)
33 | throws IOException;
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/clone_snapshot.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. The ASF licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | module Shell
20 | module Commands
21 | class CloneSnapshot < Command
22 | def help
23 | return <<-EOF
24 | Create a new table by cloning the snapshot content.
25 | There're no copies of data involved.
26 | And writing on the newly created table will not influence the snapshot data.
27 |
28 | Examples:
29 | hbase> clone_snapshot 'snapshotName', 'tableName'
30 | EOF
31 | end
32 |
33 | def command(snapshot_name, table)
34 | format_simple_command do
35 | admin.clone_snapshot(snapshot_name, table)
36 | end
37 | end
38 | end
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/describe.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Describe < Command
24 | def help
25 | return <<-EOF
26 | Describe the named table. For example:
27 | hbase> describe 't1'
28 | EOF
29 | end
30 |
31 | def command(table)
32 | now = Time.now
33 |
34 | desc = admin.describe(table)
35 |
36 | formatter.header([ "DESCRIPTION", "ENABLED" ], [ 64 ])
37 | formatter.row([ desc, admin.enabled?(table).to_s ], true, [ 64 ])
38 | formatter.footer(now)
39 | end
40 | end
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/secondaryindex/src/main/java/org/apache/hadoop/hbase/index/coprocessor/regionserver/IndexRegionScanner.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.index.coprocessor.regionserver;
21 |
22 | import org.apache.hadoop.hbase.regionserver.RegionScanner;
23 |
24 | public interface IndexRegionScanner extends RegionScanner {
25 |
26 | public void advance();
27 |
28 | public void setRangeFlag(boolean range);
29 |
30 | public boolean isRange();
31 |
32 | public void setScannerIndex(int index);
33 |
34 | public int getScannerIndex();
35 |
36 | public boolean hasChildScanners();
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/filter/InvalidRowFilterException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.filter;
21 |
22 | /**
23 | * Used to indicate an invalid RowFilter.
24 | */
25 | public class InvalidRowFilterException extends RuntimeException {
26 | private static final long serialVersionUID = 2667894046345657865L;
27 |
28 |
29 | /** constructor */
30 | public InvalidRowFilterException() {
31 | super();
32 | }
33 |
34 | /**
35 | * constructor
36 | * @param s message
37 | */
38 | public InvalidRowFilterException(String s) {
39 | super(s);
40 | }
41 | }
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/balance_switch.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class BalanceSwitch < Command
24 | def help
25 | return <<-EOF
26 | Enable/Disable balancer. Returns previous balancer state.
27 | Examples:
28 |
29 | hbase> balance_switch true
30 | hbase> balance_switch false
31 | EOF
32 | end
33 |
34 | def command(enableDisable)
35 | format_simple_command do
36 | formatter.row([
37 | admin.balance_switch(enableDisable)? "true" : "false"
38 | ])
39 | end
40 | end
41 | end
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/util/FileSystemVersionException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase.util;
22 |
23 | import java.io.IOException;
24 |
25 | /** Thrown when the file system needs to be upgraded */
26 | public class FileSystemVersionException extends IOException {
27 | private static final long serialVersionUID = 1004053363L;
28 |
29 | /** default constructor */
30 | public FileSystemVersionException() {
31 | super();
32 | }
33 |
34 | /** @param s message */
35 | public FileSystemVersionException(String s) {
36 | super(s);
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/filter/IncompatibleFilterException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.filter;
21 |
22 | /**
23 | * Used to indicate a filter incompatibility
24 | */
25 | public class IncompatibleFilterException extends RuntimeException {
26 | private static final long serialVersionUID = 3236763276623198231L;
27 |
28 | /** constructor */
29 | public IncompatibleFilterException() {
30 | super();
31 | }
32 |
33 | /**
34 | * constructor
35 | * @param s message
36 | */
37 | public IncompatibleFilterException(String s) {
38 | super(s);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/secondaryindex/src/main/java/org/apache/hadoop/hbase/index/ValuePartition.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.index;
21 |
22 | import java.io.Serializable;
23 |
24 | import org.apache.hadoop.io.WritableComparable;
25 |
26 | /**
27 | * Used to specify the part of a column which needs to be indexed.
28 | */
29 | public interface ValuePartition extends WritableComparable, Serializable {
30 |
31 | public enum PartitionType {
32 | SEPARATOR, SPATIAL, NONE
33 | }
34 |
35 | public PartitionType getPartitionType();
36 |
37 | public byte[] getPartOfValue(byte[] value);
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/PleaseHoldException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase;
21 |
22 | import java.io.IOException;
23 |
24 | /**
25 | * This exception is thrown by the master when a region server was shut down and
26 | * restarted so fast that the master still hasn't processed the server shutdown
27 | * of the first instance, or when master is initializing and client call admin
28 | * operations
29 | */
30 | @SuppressWarnings("serial")
31 | public class PleaseHoldException extends IOException {
32 | public PleaseHoldException(String message) {
33 | super(message);
34 | }
35 | }
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/util/GetJavaProperty.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2012 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.util;
21 |
22 | /**
23 | * A generic way for querying Java properties.
24 | */
25 | public class GetJavaProperty {
26 | public static void main(String args[]) {
27 | if (args.length == 0) {
28 | for (Object prop: System.getProperties().keySet()) {
29 | System.out.println(prop + "=" + System.getProperty((String)prop, ""));
30 | }
31 | } else {
32 | for (String prop: args) {
33 | System.out.println(System.getProperty(prop, ""));
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/client/ScannerTimeoutException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase.client;
22 |
23 | import org.apache.hadoop.hbase.DoNotRetryIOException;
24 |
25 | /**
26 | * Thrown when a scanner has timed out.
27 | */
28 | public class ScannerTimeoutException extends DoNotRetryIOException {
29 |
30 | private static final long serialVersionUID = 8788838690290688313L;
31 |
32 | /** default constructor */
33 | ScannerTimeoutException() {
34 | super();
35 | }
36 |
37 | /** @param s */
38 | ScannerTimeoutException(String s) {
39 | super(s);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/stop_replication.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class StopReplication < Command
24 | def help
25 | return <<-EOF
26 | Stops all the replication features. The state in which each
27 | stream stops in is undetermined.
28 | WARNING:
29 | start/stop replication is only meant to be used in critical load situations.
30 | Examples:
31 |
32 | hbase> stop_replication
33 | EOF
34 | end
35 |
36 | def command
37 | format_simple_command do
38 | replication_admin.stop_replication
39 | end
40 | end
41 | end
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/dev-support/findHangingTest.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ##
3 | # Licensed to the Apache Software Foundation (ASF) under one
4 | # or more contributor license agreements. See the NOTICE file
5 | # distributed with this work for additional information
6 | # regarding copyright ownership. The ASF licenses this file
7 | # to you under the Apache License, Version 2.0 (the
8 | # "License"); you may not use this file except in compliance
9 | # with the License. You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | ##
19 | # script to find hanging test from Jenkins build output
20 | # usage: ./findHangingTest.sh
21 | #
22 | `curl -k -o jenkins.out "$1"`
23 | expecting=Running
24 | cat jenkins.out | while read line; do
25 | if [[ "$line" =~ "Running org.apache.hadoop" ]]; then
26 | if [[ "$expecting" =~ "Running" ]]; then
27 | expecting=Tests
28 | else
29 | echo "Hanging test: $prevLine"
30 | fi
31 | fi
32 | if [[ "$line" =~ "Tests run" ]]; then
33 | expecting=Running
34 | fi
35 | if [[ "$line" =~ "Forking command line" ]]; then
36 | a=$line
37 | else
38 | prevLine=$line
39 | fi
40 | done
41 | rm jenkins.out
42 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/start_replication.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class StartReplication < Command
24 | def help
25 | return <<-EOF
26 | Restarts all the replication features. The state in which each
27 | stream starts in is undetermined.
28 | WARNING:
29 | start/stop replication is only meant to be used in critical load situations.
30 | Examples:
31 |
32 | hbase> start_replication
33 | EOF
34 | end
35 |
36 | def command
37 | format_simple_command do
38 | replication_admin.start_replication
39 | end
40 | end
41 | end
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplitCompressed.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.hadoop.hbase.regionserver.wal;
20 |
21 |
22 | import org.apache.hadoop.hbase.HConstants;
23 | import org.apache.hadoop.hbase.LargeTests;
24 | import org.junit.BeforeClass;
25 | import org.junit.experimental.categories.Category;
26 |
27 | @Category(LargeTests.class)
28 | public class TestHLogSplitCompressed extends TestHLogSplit {
29 |
30 | @BeforeClass
31 | public static void setUpBeforeClass() throws Exception {
32 | TestHLogSplit.setUpBeforeClass();
33 | TEST_UTIL.getConfiguration().setBoolean(HConstants.ENABLE_WAL_COMPRESSION, true);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/LeaseException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2008 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.regionserver;
21 |
22 | import org.apache.hadoop.hbase.DoNotRetryIOException;
23 |
24 | /**
25 | * Reports a problem with a lease
26 | */
27 | public class LeaseException extends DoNotRetryIOException {
28 |
29 | private static final long serialVersionUID = 8179703995292418650L;
30 |
31 | /** default constructor */
32 | public LeaseException() {
33 | super();
34 | }
35 |
36 | /**
37 | * @param message
38 | */
39 | public LeaseException(String message) {
40 | super(message);
41 | }
42 | }
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/LeaseListener.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2007 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.regionserver;
21 |
22 |
23 | /**
24 | * LeaseListener is an interface meant to be implemented by users of the Leases
25 | * class.
26 | *
27 | * It receives events from the Leases class about the status of its accompanying
28 | * lease. Users of the Leases class can use a LeaseListener subclass to, for
29 | * example, clean up resources after a lease has expired.
30 | */
31 | public interface LeaseListener {
32 | /** When a lease expires, this method is called. */
33 | public void leaseExpired();
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/wal/OrphanHLogAfterSplitException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.regionserver.wal;
21 |
22 | import java.io.IOException;
23 |
24 | public class OrphanHLogAfterSplitException extends IOException {
25 |
26 | /**
27 | * Create this exception without a message
28 | */
29 | public OrphanHLogAfterSplitException() {
30 | super();
31 | }
32 |
33 | /**
34 | * Create this exception with a message
35 | * @param message why it failed
36 | */
37 | public OrphanHLogAfterSplitException(String message) {
38 | super(message);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/TableInfoMissingException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase;
19 |
20 | /**
21 | *
22 | * Failed to find .tableinfo file under table dir
23 | *
24 | */
25 | @SuppressWarnings("serial")
26 | public class TableInfoMissingException extends HBaseIOException {
27 |
28 | public TableInfoMissingException() {
29 | super();
30 | }
31 |
32 | public TableInfoMissingException( String message ) {
33 | super(message);
34 | }
35 |
36 | public TableInfoMissingException( String message, Throwable t ) {
37 | super(message, t);
38 | }
39 |
40 | public TableInfoMissingException( Throwable t ) {
41 | super(t);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/util/RetryCounterFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.util;
21 |
22 | import java.util.concurrent.TimeUnit;
23 |
24 | public class RetryCounterFactory {
25 | private final int maxRetries;
26 | private final int retryIntervalMillis;
27 |
28 | public RetryCounterFactory(int maxRetries, int retryIntervalMillis) {
29 | this.maxRetries = maxRetries;
30 | this.retryIntervalMillis = retryIntervalMillis;
31 | }
32 |
33 | public RetryCounter create() {
34 | return new RetryCounter(
35 | maxRetries, retryIntervalMillis, TimeUnit.MILLISECONDS
36 | );
37 | }
38 | }
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/util/IncrementingEnvironmentEdge.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.util;
21 |
22 | /**
23 | * Uses an incrementing algorithm instead of the default.
24 | */
25 | public class IncrementingEnvironmentEdge implements EnvironmentEdge {
26 |
27 | private long timeIncrement = 1;
28 |
29 | /**
30 | * {@inheritDoc}
31 | *
32 | * This method increments a known value for the current time each time this
33 | * method is called. The first value is 1.
34 | */
35 | @Override
36 | public synchronized long currentTimeMillis() {
37 | return timeIncrement++;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/MXBean.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.hadoop.hbase.regionserver;
20 |
21 | /**
22 | * This is the JMX management interface for HBase Region Server information
23 | */
24 | public interface MXBean {
25 |
26 | /**
27 | * Return RegionServer's ServerName
28 | * @return ServerName
29 | */
30 | public String getServerName();
31 |
32 | /**
33 | * Get loaded co-processors
34 | * @return Loaded Co-processors
35 | */
36 | public String[] getCoprocessors();
37 |
38 | /**
39 | * Get Zookeeper Quorum
40 | * @return Comma-separated list of Zookeeper Quorum servers
41 | */
42 | public String getZookeeperQuorum();
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/WrongRegionException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.regionserver;
21 |
22 | import java.io.IOException;
23 |
24 | /**
25 | * Thrown when a request contains a key which is not part of this region
26 | */
27 | public class WrongRegionException extends IOException {
28 | private static final long serialVersionUID = 993179627856392526L;
29 |
30 | /** constructor */
31 | public WrongRegionException() {
32 | super();
33 | }
34 |
35 | /**
36 | * Constructor
37 | * @param s message
38 | */
39 | public WrongRegionException(String s) {
40 | super(s);
41 | }
42 | }
--------------------------------------------------------------------------------
/src/test/java/org/apache/hadoop/hbase/util/EnvironmentEdgeManagerTestHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.util;
21 |
22 | /**
23 | * Used by tests to inject an edge into the manager. The intent is to minimise
24 | * the use of the injectEdge method giving it default permissions, but in
25 | * testing we may need to use this functionality elsewhere.
26 | */
27 | public class EnvironmentEdgeManagerTestHelper {
28 |
29 | public static void reset() {
30 | EnvironmentEdgeManager.reset();
31 | }
32 |
33 | public static void injectEdge(EnvironmentEdge edge) {
34 | EnvironmentEdgeManager.injectEdge(edge);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/RegionException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2008 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase;
21 |
22 | import java.io.IOException;
23 | /**
24 | * Thrown when something happens related to region handling.
25 | * Subclasses have to be more specific.
26 | */
27 | public class RegionException extends IOException {
28 | private static final long serialVersionUID = 1473510258071111371L;
29 |
30 | /** default constructor */
31 | public RegionException() {
32 | super();
33 | }
34 |
35 | /**
36 | * Constructor
37 | * @param s message
38 | */
39 | public RegionException(String s) {
40 | super(s);
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/balancer.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Balancer < Command
24 | def help
25 | return <<-EOF
26 | Trigger the cluster balancer. Returns true if balancer ran and was able to
27 | tell the region servers to unassign all the regions to balance (the re-assignment itself is async).
28 | Otherwise false (Will not run if regions in transition).
29 | EOF
30 | end
31 |
32 | def command()
33 | format_simple_command do
34 | formatter.row([
35 | admin.balancer()? "true": "false"
36 | ])
37 | end
38 | end
39 | end
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/put.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Put < Command
24 | def help
25 | return <<-EOF
26 | Put a cell 'value' at specified table/row/column and optionally
27 | timestamp coordinates. To put a cell value into table 't1' at
28 | row 'r1' under column 'c1' marked with the time 'ts1', do:
29 |
30 | hbase> put 't1', 'r1', 'c1', 'value', ts1
31 | EOF
32 | end
33 |
34 | def command(table, row, column, value, timestamp = nil)
35 | format_simple_command do
36 | table(table).put(row, column, value, timestamp)
37 | end
38 | end
39 | end
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/security/src/main/java/org/apache/hadoop/hbase/security/AccessDeniedException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package org.apache.hadoop.hbase.security;
19 |
20 | import org.apache.hadoop.hbase.DoNotRetryIOException;
21 |
22 | /**
23 | * Exception thrown by access-related methods.
24 | */
25 | public class AccessDeniedException extends DoNotRetryIOException {
26 | private static final long serialVersionUID = 1913879564363001780L;
27 |
28 | public AccessDeniedException() {
29 | super();
30 | }
31 |
32 | public AccessDeniedException(Class> clazz, String s) {
33 | super( "AccessDenied [" + clazz.getName() + "]: " + s);
34 | }
35 |
36 | public AccessDeniedException(String s) {
37 | super(s);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/security/KerberosInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.hadoop.hbase.security;
20 |
21 | import java.lang.annotation.ElementType;
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 | import java.lang.annotation.Target;
25 |
26 | /**
27 | * Indicates Kerberos related information to be used for authorizing connections
28 | * over a given RPC protocol interface.
29 | */
30 | @Retention(RetentionPolicy.RUNTIME)
31 | @Target(ElementType.TYPE)
32 | public @interface KerberosInfo {
33 | /** Key for getting server's Kerberos principal name from Configuration */
34 | String serverPrincipal();
35 | String clientPrincipal() default "";
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.client;
21 |
22 | import org.apache.hadoop.hbase.RegionException;
23 |
24 | /**
25 | * Thrown when no region server can be found for a region
26 | */
27 | public class NoServerForRegionException extends RegionException {
28 | private static final long serialVersionUID = 1L << 11 - 1L;
29 |
30 | /** default constructor */
31 | public NoServerForRegionException() {
32 | super();
33 | }
34 |
35 | /**
36 | * Constructor
37 | * @param s message
38 | */
39 | public NoServerForRegionException(String s) {
40 | super(s);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/incr.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Incr < Command
24 | def help
25 | return <<-EOF
26 | Increments a cell 'value' at specified table/row/column coordinates.
27 | To increment a cell value in table 't1' at row 'r1' under column
28 | 'c1' by 1 (can be omitted) or 10 do:
29 |
30 | hbase> incr 't1', 'r1', 'c1'
31 | hbase> incr 't1', 'r1', 'c1', 1
32 | hbase> incr 't1', 'r1', 'c1', 10
33 | EOF
34 | end
35 |
36 | def command(table, row, column, value = nil)
37 | cnt = table(table).incr(row, column, value)
38 | puts "COUNTER VALUE = #{cnt}"
39 | end
40 | end
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/UnknownRowLockException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2007 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase;
21 |
22 |
23 | /**
24 | * Thrown if a region server is passed an unknown row lock id
25 | * @deprecated row locks are deprecated (and thus so our associated exceptions).
26 | */
27 | public class UnknownRowLockException extends DoNotRetryIOException {
28 | private static final long serialVersionUID = 993179627856392526L;
29 |
30 | /** constructor */
31 | public UnknownRowLockException() {
32 | super();
33 | }
34 |
35 | /**
36 | * Constructor
37 | * @param s message
38 | */
39 | public UnknownRowLockException(String s) {
40 | super(s);
41 | }
42 | }
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/filter/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | /**
22 | * Provides row-level filters applied to HRegion scan results during calls to
23 | * {@link org.apache.hadoop.hbase.client.ResultScanner#next()}.
24 |
25 |
26 | Filters run the extent of a table unless you wrap your filter in a
27 | {@link org.apache.hadoop.hbase.filter.WhileMatchFilter}.
28 | The latter returns as soon as the filter stops matching.
29 |
30 | Do not rely on filters carrying state across rows; its not reliable in current
31 | hbase as we have no handlers in place for when regions split, close or server
32 | crashes.
33 |
34 | */
35 | package org.apache.hadoop.hbase.filter;
36 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/list_peers.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class ListPeers< Command
24 | def help
25 | return <<-EOF
26 | List all replication peer clusters.
27 |
28 | hbase> list_peers
29 | EOF
30 | end
31 |
32 | def command()
33 | now = Time.now
34 | peers = replication_admin.list_peers
35 |
36 | formatter.header(["PEER_ID", "CLUSTER_KEY", "STATE"])
37 |
38 | peers.entrySet().each do |e|
39 | state = replication_admin.get_peer_state(e.key)
40 | formatter.row([ e.key, e.value, state ])
41 | end
42 |
43 | formatter.footer(now)
44 | end
45 | end
46 | end
47 | end
48 |
--------------------------------------------------------------------------------
/src/main/ruby/shell/commands/deleteall.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2010 The Apache Software Foundation
3 | #
4 | # Licensed to the Apache Software Foundation (ASF) under one
5 | # or more contributor license agreements. See the NOTICE file
6 | # distributed with this work for additional information
7 | # regarding copyright ownership. The ASF licenses this file
8 | # to you under the Apache License, Version 2.0 (the
9 | # "License"); you may not use this file except in compliance
10 | # with the License. You may obtain a copy of the License at
11 | #
12 | # http://www.apache.org/licenses/LICENSE-2.0
13 | #
14 | # Unless required by applicable law or agreed to in writing, software
15 | # distributed under the License is distributed on an "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # See the License for the specific language governing permissions and
18 | # limitations under the License.
19 | #
20 |
21 | module Shell
22 | module Commands
23 | class Deleteall < Command
24 | def help
25 | return <<-EOF
26 | Delete all cells in a given row; pass a table name, row, and optionally
27 | a column and timestamp. Examples:
28 |
29 | hbase> deleteall 't1', 'r1'
30 | hbase> deleteall 't1', 'r1', 'c1'
31 | hbase> deleteall 't1', 'r1', 'c1', ts1
32 | EOF
33 | end
34 |
35 | def command(table, row, column = nil, timestamp = org.apache.hadoop.hbase.HConstants::LATEST_TIMESTAMP)
36 | format_simple_command do
37 | table(table).deleteall(row, column, timestamp)
38 | end
39 | end
40 | end
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/hadoop/hbase/MediumTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | package org.apache.hadoop.hbase;
22 |
23 | /**
24 | * Tag a test as 'Medium', meaning that the test class has the following
25 | * characteristics:
26 | * - executed in an isolated JVM. Tests can however be executed in different
27 | * JVM on the same machine simultaneously.
28 | * - will have to be executed by the developer before submitting a bug
29 | * - ideally, last less than 1 minutes to help parallelization
30 | *
31 | * Use it for tests that cannot be tagged as 'Small'.
32 | *
33 | * @see SmallTests
34 | * @see LargeTests
35 | * @see IntegrationTests
36 | */
37 | public interface MediumTests {
38 | }
39 |
--------------------------------------------------------------------------------
/secondaryindex/src/main/java/org/apache/hadoop/hbase/index/client/NoIndexExpression.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.index.client;
21 |
22 | import org.apache.hadoop.hbase.client.Scan;
23 | import org.apache.hadoop.hbase.index.Constants;
24 |
25 | /**
26 | * Pass this as the index expression via Scan attribute when a scan query should not use any index
27 | * which is possible to be used
28 | * @see Scan#setAttribute(String, byte[])
29 | * @see Constants#INDEX_EXPRESSION
30 | * @see IndexUtils#toBytes(IndexExpression)
31 | */
32 | public class NoIndexExpression implements IndexExpression {
33 |
34 | private static final long serialVersionUID = 5445463806972787598L;
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/secondaryindex/src/main/java/org/apache/hadoop/hbase/index/coprocessor/regionserver/TTLExpiryChecker.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2011 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.index.coprocessor.regionserver;
21 |
22 | import org.apache.hadoop.hbase.HConstants;
23 |
24 | public class TTLExpiryChecker {
25 |
26 | public boolean checkIfTTLExpired(long ttl, long timestamp) {
27 | if (ttl == HConstants.FOREVER) {
28 | return false;
29 | } else if (ttl == -1) {
30 | return false;
31 | } else {
32 | // second -> ms adjust for user data
33 | ttl *= 1000;
34 | }
35 | if ((System.currentTimeMillis() - timestamp) > ttl) {
36 | return true;
37 | }
38 | return false;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/mapred/TableReduce.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.mapred;
21 |
22 | import org.apache.hadoop.hbase.client.Put;
23 | import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
24 | import org.apache.hadoop.io.Writable;
25 | import org.apache.hadoop.io.WritableComparable;
26 | import org.apache.hadoop.mapred.Reducer;
27 |
28 | /**
29 | * Write a table, sorting by the input key
30 | *
31 | * @param key class
32 | * @param value class
33 | */
34 | @Deprecated
35 | @SuppressWarnings("unchecked")
36 | public interface TableReduce
37 | extends Reducer {
38 |
39 | }
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2007 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.mapreduce;
21 |
22 | import org.apache.hadoop.hbase.client.Result;
23 | import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
24 | import org.apache.hadoop.mapreduce.Mapper;
25 |
26 | /**
27 | * Extends the base Mapper class to add the required input key
28 | * and value classes.
29 | *
30 | * @param The type of the key.
31 | * @param The type of the value.
32 | * @see org.apache.hadoop.mapreduce.Mapper
33 | */
34 | public abstract class TableMapper
35 | extends Mapper {
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FailedLogCloseException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2008 The Apache Software Foundation
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.hadoop.hbase.regionserver.wal;
21 |
22 | import java.io.IOException;
23 |
24 | /**
25 | * Thrown when we fail close of the write-ahead-log file.
26 | * Package private. Only used inside this package.
27 | */
28 | public class FailedLogCloseException extends IOException {
29 | private static final long serialVersionUID = 1759152841462990925L;
30 |
31 | /**
32 | *
33 | */
34 | public FailedLogCloseException() {
35 | super();
36 | }
37 |
38 | /**
39 | * @param arg0
40 | */
41 | public FailedLogCloseException(String arg0) {
42 | super(arg0);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------