├── giraffa-core ├── src │ ├── test │ │ ├── resources │ │ │ ├── data15bytes │ │ │ ├── data30bytes │ │ │ ├── webapps │ │ │ │ ├── datanode │ │ │ │ │ ├── robots.txt │ │ │ │ │ └── WEB-INF │ │ │ │ │ │ └── web.xml │ │ │ │ ├── readme.txt │ │ │ │ ├── secondary │ │ │ │ │ ├── WEB-INF │ │ │ │ │ │ └── web.xml │ │ │ │ │ └── index.html │ │ │ │ └── hdfs │ │ │ │ │ ├── index.html │ │ │ │ │ └── WEB-INF │ │ │ │ │ └── web.xml │ │ │ ├── data60bytes │ │ │ ├── data120bytes │ │ │ └── data1k │ │ └── java │ │ │ └── org │ │ │ └── apache │ │ │ └── giraffa │ │ │ ├── RenameRecoveryState.java │ │ │ ├── TestDirectoryTable.java │ │ │ ├── TestGiraffaFSContract.java │ │ │ ├── TestRestartGiraffa.java │ │ │ ├── TestGiraffaPermission.java │ │ │ ├── TestExceptionHandling.java │ │ │ ├── web │ │ │ └── GiraffaWebDemoRunner.java │ │ │ ├── id │ │ │ └── TestSegmentedIdGenerator.java │ │ │ └── TestBlockManagement.java │ ├── main │ │ ├── resources │ │ │ ├── webapps │ │ │ │ └── giraffa │ │ │ │ │ ├── images │ │ │ │ │ ├── dir.png │ │ │ │ │ ├── txt.png │ │ │ │ │ ├── row_bg.png │ │ │ │ │ └── delete_icon.png │ │ │ │ │ ├── stats.jsp │ │ │ │ │ ├── namenode.jsp │ │ │ │ │ ├── hbase.jsp │ │ │ │ │ └── WEB-INF │ │ │ │ │ ├── web.xml │ │ │ │ │ └── tags │ │ │ │ │ └── genericpage.tag │ │ │ ├── findbugs-exclude.xml │ │ │ ├── container-executor.cfg │ │ │ ├── org │ │ │ │ └── apache │ │ │ │ │ └── giraffa │ │ │ │ │ └── web │ │ │ │ │ └── Messages_en.properties │ │ │ ├── giraffa-env.sh │ │ │ ├── mapred-site.xml │ │ │ ├── core-site.xml │ │ │ ├── yarn-site.xml │ │ │ ├── mapred-env.sh │ │ │ ├── configuration.xsl │ │ │ ├── hbase-site.xml │ │ │ ├── giraffa-default.xml │ │ │ ├── capacity-scheduler.xml │ │ │ └── yarn-env.sh │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ ├── giraffa │ │ │ │ ├── RenameState.java │ │ │ │ ├── GiraffaConstants.java │ │ │ │ ├── FullPathRowKeyFactory.java │ │ │ │ ├── id │ │ │ │ │ ├── IdGeneratorService.java │ │ │ │ │ └── SegmentedIdGenerator.java │ │ │ │ ├── GiraffaFs.java │ │ │ │ ├── NamespaceService.java │ │ │ │ ├── web │ │ │ │ │ ├── GiraffaWebServer.java │ │ │ │ │ ├── GiraffaWebUtils.java │ │ │ │ │ └── GiraffaWebObserver.java │ │ │ │ ├── RowKeyFactoryProvider.java │ │ │ │ ├── FileLease.java │ │ │ │ ├── XAttrPermissionFilter.java │ │ │ │ ├── UnlocatedBlock.java │ │ │ │ ├── RowKey.java │ │ │ │ ├── DirectoryTable.java │ │ │ │ ├── GiraffaConfiguration.java │ │ │ │ ├── hbase │ │ │ │ │ └── ZKSequentialNumber.java │ │ │ │ ├── FileField.java │ │ │ │ ├── INodeDirectory.java │ │ │ │ ├── FullPathRowKey.java │ │ │ │ ├── INode.java │ │ │ │ ├── RowKeyBytes.java │ │ │ │ ├── FSPermissionChecker.java │ │ │ │ └── RowKeyFactory.java │ │ │ │ └── hadoop │ │ │ │ ├── hdfs │ │ │ │ ├── HDFSAdapter.java │ │ │ │ ├── GiraffaClient.java │ │ │ │ └── server │ │ │ │ │ └── namenode │ │ │ │ │ └── HLMAdapter.java │ │ │ │ └── hbase │ │ │ │ ├── ipc │ │ │ │ └── HBaseRpcUtil.java │ │ │ │ └── client │ │ │ │ └── GiraffaRpcRetryingCallerFactory.java │ │ ├── proto │ │ │ ├── grfa.proto │ │ │ └── Security.proto │ │ └── assembly │ │ │ └── conf.xml │ ├── site │ │ ├── rules-pmd.xml │ │ ├── site.xml │ │ └── check_style.xml │ └── header.txt └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle ├── giraffa-standalone ├── src │ └── main │ │ ├── resources │ │ └── bin │ │ │ ├── yarn-giraffa │ │ │ ├── yarn-giraffa-daemon.sh │ │ │ ├── stop-giraffa.sh │ │ │ ├── start-giraffa.sh │ │ │ ├── giraffa │ │ │ └── giraffa-config.sh │ │ └── assembly │ │ └── standalone.xml └── build.gradle ├── README.md ├── libraries └── libraries.gradle ├── gradlew.bat └── gradlew /giraffa-core/src/test/resources/data15bytes: -------------------------------------------------------------------------------- 1 | 12345678901234 2 | -------------------------------------------------------------------------------- /giraffa-core/src/test/resources/data30bytes: -------------------------------------------------------------------------------- 1 | 12345678901234 2 | 12345678901234 3 | -------------------------------------------------------------------------------- /giraffa-core/src/test/resources/webapps/datanode/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / 3 | -------------------------------------------------------------------------------- /giraffa-core/src/test/resources/data60bytes: -------------------------------------------------------------------------------- 1 | 12345678901234 2 | 12345678901234 3 | 12345678901234 4 | 12345678901234 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiraffaFS/giraffa/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/webapps/giraffa/images/dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiraffaFS/giraffa/HEAD/giraffa-core/src/main/resources/webapps/giraffa/images/dir.png -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/webapps/giraffa/images/txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiraffaFS/giraffa/HEAD/giraffa-core/src/main/resources/webapps/giraffa/images/txt.png -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/webapps/giraffa/images/row_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiraffaFS/giraffa/HEAD/giraffa-core/src/main/resources/webapps/giraffa/images/row_bg.png -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/webapps/giraffa/images/delete_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiraffaFS/giraffa/HEAD/giraffa-core/src/main/resources/webapps/giraffa/images/delete_icon.png -------------------------------------------------------------------------------- /giraffa-core/src/test/resources/data120bytes: -------------------------------------------------------------------------------- 1 | 12345678901234 2 | 12345678901234 3 | 12345678901234 4 | 12345678901234 5 | 12345678901234 6 | 12345678901234 7 | 12345678901234 8 | 12345678901234 9 | -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/findbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Mar 02 14:41:07 PST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-bin.zip 7 | -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/container-executor.cfg: -------------------------------------------------------------------------------- 1 | yarn.nodemanager.linux-container-executor.group=#configured value of yarn.nodemanager.linux-container-executor.group 2 | banned.users=#comma separated list of users who can not run applications 3 | min.user.id=1000#Prevent other super-users 4 | allowed.system.users=##comma separated list of system users who CAN run applications 5 | -------------------------------------------------------------------------------- /giraffa-core/src/test/resources/webapps/readme.txt: -------------------------------------------------------------------------------- 1 | The only reason why webapps present in this folder is to make hadoop web UI correctly work 2 | under MiniCluster in test environment. 3 | 4 | Due to a bug in extraction process, files are placed under wrong folder: 5 | 6 | /tmp/Jetty_localhost_44828_hdfs____.43pt20/webapp/webapps/hdfs 7 | 8 | instead of 9 | 10 | /tmp/Jetty_localhost_44828_hdfs____.43pt20/webapp 11 | 12 | this results in a wrong initialization of WebAppContext and as a consequence HDFS UI never comes up. -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/org/apache/giraffa/web/Messages_en.properties: -------------------------------------------------------------------------------- 1 | webapp.title=Giraffa File System 2 | webapp.title.short=Giraffa 3 | 4 | menu.giraffa.name=Giraffa 5 | menu.hbase.name=HBase 6 | menu.namenode.name=Namenode 7 | menu.giraffa.stats.name=Statistics 8 | 9 | giraffa.htable.descriptor=HTable Descriptor 10 | giraffa.htable.browser=HTable Browser 11 | giraffa.htable.properties=HTable Properties 12 | 13 | giraffa.hdfs.browser=File Browser 14 | giraffa.hdfs.browser.mkdir=Create Folder 15 | 16 | giraffa.error.missing.table={0} table is missing, please format Giraffa FS. 17 | -------------------------------------------------------------------------------- /giraffa-core/src/main/java/org/apache/giraffa/RenameState.java: -------------------------------------------------------------------------------- 1 | package org.apache.giraffa; 2 | 3 | public class RenameState { 4 | private final boolean flag; 5 | private final byte[] src; 6 | 7 | private RenameState(boolean flag, byte[] src) { 8 | this.flag = flag; 9 | this.src = src; 10 | } 11 | 12 | public boolean getFlag() { 13 | return this.flag; 14 | } 15 | 16 | public byte[] getSrc() { 17 | return this.src; 18 | } 19 | 20 | public static RenameState TRUE(byte[] src) { 21 | return new RenameState(true, src); 22 | } 23 | 24 | public static RenameState FALSE() { 25 | return new RenameState(false, null); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/webapps/giraffa/stats.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" isELIgnored="false"%> 2 | <%@ taglib prefix="t" tagdir="/WEB-INF/tags" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | <%@ page contentType="text/html;charset=UTF-8"%> 5 | 6 | 7 | 8 | true 9 | 10 | 11 |
12 |

13 |
14 |
15 |
16 | -------------------------------------------------------------------------------- /giraffa-core/src/main/proto/grfa.proto: -------------------------------------------------------------------------------- 1 | option java_package = "org.apache.giraffa"; 2 | option java_outer_classname = "GiraffaProtos"; 3 | option java_generate_equals_and_hash = true; 4 | package giraffa; 5 | 6 | import "hdfs.proto"; 7 | import "Security.proto"; 8 | 9 | message UnlocatedBlockProto { 10 | required hadoop.hdfs.ExtendedBlockProto b = 1; 11 | required uint64 offset = 2; 12 | required bool corrupt = 3; 13 | required hadoop.common.TokenProto blockToken = 4; 14 | } 15 | 16 | message RenameStateProto { 17 | required bool flag = 1; 18 | optional bytes src = 2; 19 | } 20 | 21 | message FileLeaseProto { 22 | required string holder = 1; 23 | required string path = 2; 24 | required uint64 lastUpdate = 3; 25 | } 26 | -------------------------------------------------------------------------------- /giraffa-core/src/site/rules-pmd.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /giraffa-core/src/test/resources/webapps/secondary/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 10 | 11 | 12 | 13 | org.apache.hadoop.hdfs.server.namenode.status_jsp 14 | org.apache.hadoop.hdfs.server.namenode.status_jsp 15 | 16 | 17 | 18 | org.apache.hadoop.hdfs.server.namenode.status_jsp 19 | /status.jsp 20 | 21 | 22 | -------------------------------------------------------------------------------- /giraffa-core/src/header.txt: -------------------------------------------------------------------------------- 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. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 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 | .classpath 17 | .project 18 | .settings 19 | .externalToolBuilders/ 20 | *.iml 21 | .idea/clover/* 22 | .idea 23 | build/ 24 | .gradle 25 | .DS_STORE 26 | -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/giraffa-env.sh: -------------------------------------------------------------------------------- 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 | #export HADOOP_HOME=~/hadoop/hadoop-2.5.1 17 | #export HBASE_HOME=~/hbase/hbase-1.0.1 18 | export GIRAFFA_ROOT_LOGGER=INFO,RFA 19 | -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/mapred-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 18 | 19 | mapreduce.framework.name 20 | yarn 21 | 22 | 23 | mapreduce.terasort.simplepartitioner 24 | true 25 | 26 | 27 | -------------------------------------------------------------------------------- /giraffa-core/src/test/java/org/apache/giraffa/RenameRecoveryState.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.giraffa; 19 | 20 | public enum RenameRecoveryState { 21 | PUT_SETFLAG, DELETE, PUT_NOFLAG 22 | } 23 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 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 | rootProject.name = 'giraffa' 19 | 20 | include 'giraffa-core', 'giraffa-standalone' 21 | 22 | project(":giraffa-core").name = 'giraffa-core' 23 | project(":giraffa-standalone").name = 'giraffa-standalone' 24 | -------------------------------------------------------------------------------- /giraffa-standalone/src/main/resources/bin/yarn-giraffa: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # 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 | bin=`dirname "$0"` 18 | bin=`cd "$bin"; pwd` 19 | 20 | . "$bin"/giraffa-config.sh 21 | 22 | export HADOOP_CLASSPATH=$GIRAFFA_CLASSPATH 23 | $HADOOP_HOME/bin/yarn --config $GIRAFFA_CONF_DIR $* 24 | -------------------------------------------------------------------------------- /giraffa-standalone/src/main/resources/bin/yarn-giraffa-daemon.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # 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 | bin=`dirname "$0"` 18 | bin=`cd "$bin"; pwd` 19 | 20 | . "$bin"/giraffa-config.sh 21 | 22 | export HADOOP_CLASSPATH=$GIRAFFA_CLASSPATH 23 | $HADOOP_HOME/sbin/yarn-daemon.sh --config $GIRAFFA_CONF_DIR $* 24 | -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/core-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | fs.defaultFS 9 | grfa:/// 10 | The name of the default file system. A URI whose 11 | scheme and authority determine the FileSystem implementation. The 12 | uri's scheme determines the config property (fs.SCHEME.impl) naming 13 | the FileSystem implementation class. The uri's authority is used to 14 | determine the host, port, etc. for a filesystem. 15 | 16 | 17 | 18 | fs.grfa.impl 19 | org.apache.giraffa.GiraffaFileSystem 20 | The FileSystem for grfa. 21 | 22 | 23 | fs.AbstractFileSystem.grfa.impl 24 | org.apache.giraffa.GiraffaFs 25 | The AbstractFileSystem for grfa. 26 | 27 | 28 | -------------------------------------------------------------------------------- /giraffa-core/src/test/resources/webapps/secondary/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | Hadoop Administration 20 | 21 | 22 |

Hadoop Administration

23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | Giraffa is 3 | - Distributed highly available file system; 4 | - Apache Extras project and is not an official project of the Apache Software Foundation; 5 | - Project which is related to [Apache Hadoop] and [Apache HBase] projects; 6 | - Licensed under Apache License 2.0; 7 | 8 | ### Requirements 9 | 10 | * JDK 1.7+ 11 | * Gradle 2.0+ 12 | * ProtocolBuffer 2.5.0 13 | * Apache HBase 1.0.0+ 14 | * Apache Hadoop 2.5.0+ 15 | 16 | ### Build it 17 | Build Giraffa jar: 18 | 19 | ./gradlew clean assemble 20 | 21 | Build Giraffa + Tests: 22 | 23 | ./gradlew clean build 24 | 25 | Build Giraffa + Javadoc: 26 | 27 | ./gradlew clean assemble javadoc 28 | 29 | Build Giraffa + Code Coverage: 30 | 31 | ./gradlew clean build jacocoTestReport 32 | 33 | Build Giraffa + Standalone Distribution: 34 | 35 | ./gradlew clean build tar 36 | 37 | Run Giraffa Web UI in demo mode: 38 | 39 | ./gradlew -PmainClass=org.apache.giraffa.web.GiraffaWebDemoRunner execute 40 | 41 | Type `stop` in the console and hit `Enter` to end the Giraffa Web UI demo. 42 | 43 | [Apache Hadoop]:https://hadoop.apache.org 44 | [Apache HBase]:http://hbase.apache.org -------------------------------------------------------------------------------- /giraffa-core/src/main/java/org/apache/giraffa/GiraffaConstants.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.giraffa; 19 | 20 | public interface GiraffaConstants { 21 | enum FileState { 22 | CLOSED, UNDER_CONSTRUCTION, DELETED, RECOVERING 23 | } 24 | 25 | enum BlockAction { 26 | CLOSE, ALLOCATE, DELETE, RECOVER 27 | } 28 | 29 | String UTF8 = "UTF-8"; 30 | } 31 | -------------------------------------------------------------------------------- /giraffa-core/src/test/resources/webapps/hdfs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | Hadoop Administration 21 | 22 | 23 | 24 | 25 |

Hadoop Administration

26 | 27 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /giraffa-core/src/main/resources/webapps/giraffa/namenode.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="org.apache.hadoop.conf.Configuration" isELIgnored="false" %> 2 | <%@ page import="org.apache.hadoop.hdfs.DFSConfigKeys" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | <%@ page contentType="text/html;charset=UTF-8"%> 5 | <%@ taglib prefix="t" tagdir="/WEB-INF/tags" %> 6 | 7 | <% 8 | Configuration conf = (Configuration)getServletContext().getAttribute("conf"); 9 | 10 | String namenodeAddress = "http://" + conf.get(DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY); 11 | 12 | request.setAttribute("namenodeAddress", namenodeAddress); 13 | %> 14 | 15 | 16 | 17 | true 18 | 19 | 20 |
21 |
22 | Namenode: ${namenodeAddress} 23 |
24 | 25 |
26 |