Package org.apache.solr.client.solrj.impl

Examples of org.apache.solr.client.solrj.impl.CloudSolrServer.shutdown()


          if (adminOp.compareTo(CollectionAction.CREATE) == 0) {
            // Wait for collection creation to complete.
            waitForRecoveriesToFinish(collectionName, solrServer, false);
          }
        } finally {
          solrServer.shutdown();
        }

        fail("The specified user: " + solrUserName + " shouldn't get admin access for " + adminOp);
      } catch (Exception exception) {
        assertTrue("Expected " + SENTRY_ERROR_MSG + " in " + exception.toString(),
View Full Code Here


        SolrQuery query = new SolrQuery(solrQueryStr);
        QueryResponse response = cloudSolrServer.query(query);
        solrDocs = response.getResults();
        return solrDocs;
      } finally {
        cloudSolrServer.shutdown();
      }
    } finally {
      setAuthenticationUser(originalUser);
    }
  }
View Full Code Here

        setAuthenticationUser("docLevel");
        rsp = server.query(query);
        assertEquals(NUM_DOCS, rsp.getResults().getNumFound());
      }
    } finally {
      server.shutdown();
    }
  }

  /**
   * Test that queries from different users only return the documents they have access to.
View Full Code Here

        fq = URLEncoder.encode(" OR {!raw f=" + AUTH_FIELD + " v=docLevel_role}");
        path = "/" + collectionName + "/select?q=*:*&fq="+fq;
        retValue = makeHttpRequest(server, "GET", path, null, null);
        assertTrue(retValue.contains(syntaxErrorMsg));
      } finally {
        server.shutdown();
      }
    } finally {
      deleteCollection(collectionName);
    }
  }
View Full Code Here

          boolean addedJunit = (Long.valueOf(id) % junitFactor) == 0;
          boolean onlyAllRoles = !addedJunit && (Long.valueOf(id) % allRolesFactor) == 0;
          assertEquals(true, addedJunit || onlyAllRoles);
        }
      } finally {
        server.shutdown();
      }
    } finally {
      deleteCollection(collectionName);
    }
  }
View Full Code Here

      setAuthenticationUser(queryUser);
      rsp =  server.query(query);
      long docLevelResults = rsp.getResults().getNumFound();
      assertEquals(expectedQueryDocs, docLevelResults);
    } finally {
      server.shutdown();
    }
  }

  private void deleteByIdTest(String collectionName) throws Exception {
    createDocsAndQuerySimple(collectionName, true);
View Full Code Here

      setAuthenticationUser("docLevel");
      rsp =  server.query(query);
      long docLevelResults = rsp.getResults().getNumFound();
      assertEquals(0, docLevelResults);
    } finally {
      server.shutdown();
    }
  }

  private void updateDocsTest(String collectionName) throws Exception {
    createDocsAndQuerySimple(collectionName, true);
View Full Code Here

      // verify we can now view the document
      rsp = server.query(query);
      assertEquals(1, rsp.getResults().getNumFound());
    } finally {
      server.shutdown();
    }
  }

  @Test
  public void testUpdateDeleteOperations() throws Exception {
View Full Code Here

      String body = "<add><doc><field name=\"id\">testInvariantDoc</field></doc></add>";
      String ret = makeHttpRequest(server, "POST", path, body.getBytes("UTF-8"), "text/xml");
      assertTrue("Expected sentry exception", ret.contains("SentrySolrAuthorizationException: User junit"
        + " does not have privileges for testInvariantCollection"));
    } finally {
      server.shutdown();
    }
  }
}
View Full Code Here

        LOG.info("Committing live merge...");
        if (options.zkHost != null) {
          CloudSolrServer server = new CloudSolrServer(options.zkHost);
          server.setDefaultCollection(options.collection);
          server.commit();
          server.shutdown();
        } else {
          for (List<String> urls : options.shardUrls) {
            for (String url : urls) {
              // TODO: we should do these concurrently
              HttpSolrServer server = new HttpSolrServer(url);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.