Package com.taobao.tdhs.client.exception

Examples of com.taobao.tdhs.client.exception.TDHSException



    public void write(BasePacket packet) throws TDHSException {
        Channel channel = connectionPool.get();
        if (channel == null) {
            throw new TDHSException("no available connection! maybe server has something error!");
        }
        channel.write(packet);
    }
View Full Code Here


        if (400 <= status.getStatus() && 600 > status.getStatus()) {
            parseFailed(this.data);
        } else if (TDHSResponseEnum.ClientStatus.OK.equals(status)) {
            parseData(this.data);
        } else {
            throw new TDHSException("unknown response code!");
        }
        this.data = null;
        isParsed = true;
    }
View Full Code Here

                    } else {
                        fieldData.add(null);
                    }
                }
            } catch (UnsupportedEncodingException e) {
                throw new TDHSException(e);
            }
        }
    }
View Full Code Here

    public
    @Nullable
    ResultSet getResultSet(List<String> alias) throws TDHSException {
        if (TDHSResponseEnum.ClientStatus.OK.equals(status)) {
            if (alias == null || alias.size() != getFieldNames().size()) {
                throw new TDHSException("alias is wrong! alias:[" + alias + "] fieldNames:[" + getFieldNames() + "]");
            }
            return new TDHSResultSet(alias, metaData, getFieldTypes(), getFieldOriData(), charsetName);
        }
        return null;
    }
View Full Code Here

                                charsetName);
                    } else if (ret.getClientStatus() != null && ret.getClientStatus().getStatus() >= 400 &&
                            ret.getClientStatus().getStatus() < 600) {
                        return new TDHSResponse(ret.getClientStatus(), metaData, ret.getData(), charsetName);
                    } else {
                        throw new TDHSException("unknown response code! [" + (ret.getClientStatus() != null ?
                                String.valueOf(ret.getClientStatus().getStatus()) : "") + "]");
                    }
                }
            }
        } catch (InterruptedException e) {
            throw new TDHSException(e);
        } catch (IOException e) {
            throw new TDHSException(e);
        }
    }
View Full Code Here

      Assert.assertEquals("1", r.getFieldData().get(0).get(0));
      Assert.assertEquals(ClientStatus.OK, r.getStatus());
      id = "5";
    } catch (TDHSException e) {
      throw new TDHSException("Update exception:" + e.getMessage());
    }
  }
View Full Code Here

      Assert.assertEquals("1", r.getFieldData().get(0).get(0));
      Assert.assertEquals(ClientStatus.OK, r.getStatus());
      id = Integer.parseInt(id) + 5 + "";
    } catch (Exception e) {
      throw new TDHSException("Update exception:" + e.getMessage());
    }
  }
View Full Code Here

      Assert.assertEquals("1", r.getFieldData().get(0).get(0));
      Assert.assertEquals(ClientStatus.OK, r.getStatus());
      id = Integer.parseInt(id) - 5 + "";
    } catch (Exception e) {
      throw new TDHSException("Update exception:" + e.getMessage());
    }
  }
View Full Code Here

        c++;
      }
      Assert.assertEquals(ClientStatus.OK, r.getStatus());
      Assert.assertEquals(c, r.getFieldData().size());
    } catch (TDHSException e) {
      throw new TDHSException("Get exception:" + e.getMessage());
    }
  }
View Full Code Here

          FindFlag.TDHS_EQ, 0, 100, new Filter[] { f });

      Assert.assertEquals(ClientStatus.OK, r.getStatus());
      Assert.assertEquals(1, r.getFieldData().size());
    } catch (TDHSException e) {
      throw new TDHSException("Get1 exception", e);
    }

    try {
      Filter f = new Filter(fields[2], FilterFlag.TDHS_GE, level);
      TDHSResponse r = client.get(db, table, index, new String[] {
          fields[0], fields[2] }, new String[][] { { name } },
          FindFlag.TDHS_EQ, 0, 100, new Filter[] { f });
      Assert.assertEquals(ClientStatus.OK, r.getStatus());
      Assert.assertEquals(1, r.getFieldData().size());
    } catch (TDHSException e) {
      throw new TDHSException("Get1 exception", e);
    }
  }
View Full Code Here

TOP

Related Classes of com.taobao.tdhs.client.exception.TDHSException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.