1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.hadoop.hbase.rest;
22
23 import java.io.IOException;
24
25 import javax.ws.rs.Encoded;
26 import javax.ws.rs.Path;
27 import javax.ws.rs.PathParam;
28 import javax.ws.rs.QueryParam;
29
30 public class TableResource extends ResourceBase {
31
32 String table;
33
34
35
36
37
38
39 public TableResource(String table) throws IOException {
40 super();
41 this.table = table;
42 }
43
44
45 String getName() {
46 return table;
47 }
48
49
50
51
52
53 boolean exists() throws IOException {
54 return servlet.getAdmin().tableExists(table);
55 }
56
57 @Path("exists")
58 public ExistsResource getExistsResource() throws IOException {
59 return new ExistsResource(this);
60 }
61
62 @Path("regions")
63 public RegionsResource getRegionsResource() throws IOException {
64 return new RegionsResource(this);
65 }
66
67 @Path("scanner")
68 public ScannerResource getScannerResource() throws IOException {
69 return new ScannerResource(this);
70 }
71
72 @Path("schema")
73 public SchemaResource getSchemaResource() throws IOException {
74 return new SchemaResource(this);
75 }
76
77 @Path("multiget")
78 public MultiRowResource getMultipleRowResource(
79 final @QueryParam("v") String versions) throws IOException {
80 return new MultiRowResource(this, versions);
81 }
82
83 @Path("{rowspec: .+}")
84 public RowResource getRowResource(
85
86
87 final @PathParam("rowspec") @Encoded String rowspec,
88 final @QueryParam("v") String versions,
89 final @QueryParam("check") String check) throws IOException {
90 return new RowResource(this, rowspec, versions, check);
91 }
92 }