public NamedList<Object> processResponse(InputStream body, String encoding) { try { return (NamedList<Object>) new JavaBinCodec().unmarshal(body); } catch (IOException e) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "parsing error", e); } }
@Override public NamedList<Object> processResponse(InputStream body, String encoding) { try { return (NamedList<Object>) new JavaBinCodec(null,stringCache).unmarshal(body); } catch (IOException e) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "parsing error", e); } }
return (NamedList<Object>) codec.unmarshal(body);
@Override public NamedList<Object> processResponse(InputStream body, String encoding) { try { return (NamedList<Object>) new JavaBinCodec(null,stringCache).unmarshal(body); } catch (IOException e) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "parsing error", e); } }
return (NamedList<Object>) codec.unmarshal(body);
@Override public T decode(InputStream inStream) throws IOException { DataInputStream in = new DataInputStream(inStream); int len = VarInt.decodeInt(in); if (len < 0) { throw new CoderException("Invalid encoded SolrDocument length: " + len); } JavaBinCodec codec = new JavaBinCodec(); return (T) codec.unmarshal(new BoundedInputStream(in, len)); }
private NamedList getNamedListResponse(PostMethod method) throws IOException { try { int status = myHttpClient.executeMethod(method); if (status != HttpStatus.SC_OK) { throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, "Request failed for the url " + method); } return (NamedList) new JavaBinCodec().unmarshal(method.getResponseBodyAsStream()); } finally { try { method.releaseConnection(); } catch (Exception e) { } } }
/** * TODO -- there may be a way to do this without marshal at all... * * @param req * @param rsp * * @return a response object equivalent to what you get from the XML/JSON/javabin parser. Documents become * SolrDocuments, DocList becomes SolrDocumentList etc. * * @since solr 1.4 */ @SuppressWarnings("unchecked") public static NamedList<Object> getParsedResponse(SolrQueryRequest req, SolrQueryResponse rsp) { try { Resolver resolver = new Resolver(req, rsp.getReturnFields()); ByteArrayOutputStream out = new ByteArrayOutputStream(); new JavaBinCodec(resolver).marshal(rsp.getValues(), out); InputStream in = new ByteArrayInputStream(out.toByteArray()); return (NamedList<Object>) new JavaBinCodec(resolver).unmarshal(in); } catch (Exception ex) { throw new RuntimeException(ex); } }
codec.unmarshal(is); delById = (List<String>) namedList[0].get("delById"); delByQ = (List<String>) namedList[0].get("delByQ");
codec.unmarshal(is);
codec.unmarshal(is);