Package com.taobao.tdhs.client.exception

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


          fields[0], fields[2] }, new String[][] { { name } },
          FindFlag.TDHS_LE, 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


          fields[0], fields[2] }, new String[][] { { name } },
          FindFlag.TDHS_LE, 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

          fields[0], fields[2] }, new String[][] { { name } },
          FindFlag.TDHS_LE, 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

          fields[0], fields[2] }, new String[][] { { name } },
          FindFlag.TDHS_LE, 0, 100, new Filter[] { f });
      Assert.assertEquals(ClientStatus.OK, r.getStatus());
      Assert.assertEquals(0, r.getFieldData().size());
    } catch (TDHSException e) {
      throw new TDHSException("Get1 exception", e);
    }
  }
View Full Code Here

          fields[0], fields[2] }, new String[][] { { name } },
          FindFlag.TDHS_IN, 0, 100, new Filter[] { f });
      Assert.assertEquals(ClientStatus.OK, r.getStatus());
      Assert.assertEquals(0, r.getFieldData().size());
    } catch (TDHSException e) {
      throw new TDHSException("Get1 exception", e);
    }
  }
View Full Code Here

                for (internal_struct is : batchRequest) {
                    retData.write(is.getPacket().toByteArray());
                    responses.put(is.getPacket().getSeqId(), new ArrayBlockingQueue<BasePacket>(1));
                }
            } catch (IOException e) {
                throw new TDHSException(e);
            }
            BasePacket headerPacket =
                    new BasePacket(TDHSCommon.RequestType.BATCH, headerId, batchRequest.size(),
                            retData.toByteArray());
            ArrayBlockingQueue<BasePacket> queue = new ArrayBlockingQueue<BasePacket>(1);
View Full Code Here

          fields[0], fields[2] }, new String[][] { { name } },
          FindFlag.TDHS_LT, 0, 100, new Filter[] { f });
      Assert.assertEquals(ClientStatus.OK, r.getStatus());
      Assert.assertEquals(0, r.getFieldData().size());
    } catch (TDHSException e) {
      throw new TDHSException("Get1 exception", e);
    }
  }
View Full Code Here

                if (ret.getClientStatus() != null && ret.getClientStatus().getStatus() >= 400 &&
                        ret.getClientStatus().getStatus() < 600) {
                    throw new TDHSBatchException(
                            new TDHSResponse(ret.getClientStatus(), null, ret.getData(), charsetName));
                } else {
                    throw new TDHSException("unknown response code! [" + (ret.getClientStatus() != null ?
                            String.valueOf(ret.getClientStatus().getStatus()) : "") + "]");
                }
            }
            if (ret.getBatchNumber() != batchRequest.size()) {
                throw new TDHSException(
                        "unmatch batch size! request is[" + String.valueOf(batchRequest.size()) + "], response is [" +
                                String.valueOf(ret.getBatchNumber()) + "]");
            }

            TDHSResponse result[] = new TDHSResponse[batchRequest.size()];
            int i = 0;
            for (internal_struct is : batchRequest) {
                result[i++] =
                        do_response(responses.get(is.getPacket().getSeqId()), is.getMetaData(), is.getCharsetName());
            }
            return result;
        } catch (InterruptedException e) {
            throw new TDHSException(e);
        }
    }
View Full Code Here

          fields[0], fields[2] }, new String[][] { { name } },
          FindFlag.TDHS_GT, 0, 100, new Filter[] { f });
      Assert.assertEquals(ClientStatus.OK, r.getStatus());
      Assert.assertEquals(0, r.getFieldData().size());
    } catch (TDHSException e) {
      throw new TDHSException("Get1 exception", e);
    }
  }
View Full Code Here

          fields[0], fields[2] }, new String[][] { { name } },
          FindFlag.TDHS_GT, 0, 100, new Filter[] { f });
      Assert.assertEquals(ClientStatus.OK, r.getStatus());
      Assert.assertEquals(0, 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.