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