-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-22846 Internal Error 500 when Using HBASE REST API to Create Na… #524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ | |
| import javax.xml.bind.annotation.XmlRootElement; | ||
| import javax.xml.bind.annotation.XmlTransient; | ||
|
|
||
| import com.google.gson.Gson; | ||
| import org.apache.hadoop.hbase.NamespaceDescriptor; | ||
| import org.apache.yetus.audience.InterfaceAudience; | ||
| import org.apache.hadoop.hbase.client.Admin; | ||
|
|
@@ -166,4 +167,17 @@ public ProtobufMessageHandler getObjectFromMessage(byte[] message) throws IOExce | |
| } | ||
| return this; | ||
| } | ||
|
|
||
| public static void main(String[] args) { | ||
|
||
| NamespacesInstanceModel model = new NamespacesInstanceModel(); | ||
| model.addProperty("test", "test value"); | ||
| model.addProperty("test1", "test value 1"); | ||
| model.namespaceName = "name"; | ||
|
|
||
| Gson gson = new Gson(); | ||
| String json = gson.toJson(model); | ||
| System.out.println(json); | ||
|
|
||
|
|
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how this works. When you remove this, the put gets called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, on branch-2 based versions, these putNoBody and postNoBody methods only get properly called if client sets content-type request header to "application/octet-stream". We don't explicit define any requirement for "binary" request content-type, on the REST API doc in the ref guide, so it seems clients had been working well without setting content-type, in hbase 1. I suspect the behaviour change might be due jersey version changes between branch-1 and branch-2.
This fix simply removed the additional method, so request is guaranteed to always go to same place and then payload validations are applied there.