Examples of ServerThread


Examples of org.jboss.remoting.transport.socket.ServerThread

      Field field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(serverInvoker);
      Set threads = clientpool.getContents();
      assertEquals(1, threads.size());
      ServerThread serverThread = (ServerThread) threads.iterator().next();
      field = ServerThread.class.getDeclaredField("socketWrapper");
      field.setAccessible(true);
      assertTrue(field.get(serverThread) instanceof ServerSocketWrapper);
      ServerSocketWrapper serverWrapper = (ServerSocketWrapper) field.get(serverThread);
      assertEquals(3000, serverWrapper.getTimeout());
View Full Code Here

Examples of org.jboss.remoting.transport.socket.ServerThread

               LRUPool clientpool = (LRUPool) field.get(ssi);
               Set threads = clientpool.getContents();
               Iterator it = threads.iterator();
               while (it.hasNext())
               {
                  ServerThread t = (ServerThread) it.next();
                  t.shutdown();
               }

               ssi.setMaxPoolSize(0);
               log.info("server is disabled");
            }
View Full Code Here

Examples of org.jboss.remoting.transport.socket.ServerThread

      field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(ssi);
      assertEquals(1, clientpool.size());
      Set threads = clientpool.getContents();
      ServerThread serverThread = (ServerThread) threads.iterator().next();
      field = ServerThread.class.getDeclaredField("socketWrapper");
      field.setAccessible(true);
      ServerSocketWrapper ssw = (ServerSocketWrapper) field.get(serverThread);
      field = ClientSocketWrapper.class.getDeclaredField("in");
      field.setAccessible(true);
View Full Code Here

Examples of org.jboss.remoting.transport.socket.ServerThread

      field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(ssi);
      assertEquals(1, clientpool.size());
      Set threads = clientpool.getContents();
      ServerThread serverThread = (ServerThread) threads.iterator().next();
      field = ServerThread.class.getDeclaredField("socketWrapper");
      field.setAccessible(true);
      ServerSocketWrapper ssw = (ServerSocketWrapper) field.get(serverThread);
      field = ClientSocketWrapper.class.getDeclaredField("in");
      field.setAccessible(true);
View Full Code Here

Examples of org.jboss.remoting.transport.socket.ServerThread

               if(clientpool.size() < maxPoolSize)
               {
                  Thread thread = null;
                  try
                  {
                     thread = new ServerThread(socket, BisocketServerInvoker.this,
                                               clientpool, threadpool,
                                               getTimeout(), serverSocketClass);
                     thread.start();

                     if (log.isDebugEnabled())
View Full Code Here

Examples of org.jboss.remoting.transport.socket.ServerThread

      assertEquals(1, callbackHandler.received);
      Set serverThreads = clientpool.getContents();  
      Iterator it = serverThreads.iterator();
      while (it.hasNext())
      {
         ServerThread st = (ServerThread) it.next();
         st.shutdown();
      }
      client.invoke(SEND_CALLBACK);
      assertEquals(2, callbackHandler.received);
      serverThreads = clientpool.getContents();  
      it = serverThreads.iterator();
      while (it.hasNext())
      {
         ServerThread st = (ServerThread) it.next();
         st.shutdown();
      }
      client.invoke(SEND_CALLBACK);
      assertEquals(3, callbackHandler.received);
     
      client.removeListener(callbackHandler);
View Full Code Here

Examples of org.ryant.tubesock.core.manager.thread.ServerThread

        streamReferences = new ConcurrentHashMap<String, InputStream>();
        handlerService = new ThreadPoolExecutor(maxConcurrent, maxConcurrent,
                                                1, TimeUnit.MINUTES,
                                                new LinkedBlockingQueue<Runnable>(),
                                                new SocketHandlerThreadFactory());
        serverThread = new ServerThread(handlerService, streamReferences, port, connectionTimeoutMillis, maxConcurrent);
        evictionTimer = new Timer("EvictionTimer-" + port, true);
    }
View Full Code Here

Examples of org.voltdb.ServerThread

        pb.addDefaultSchema();
        pb.addDefaultPartitioning();
        pb.addProcedures(InsertOrderLineBatched.class, ResetWarehouse.class);
        pb.compile(catalog);

        ServerThread server = new ServerThread(catalog,  BackendTarget.NATIVE_EE_JNI);
        server.start();
        server.waitForInitialization();
        Client client = ClientFactory.createClient();
        client.createConnection(null, "localhost", HStoreConstants.DEFAULT_PORT, "program", "none");

        Date generationDateTime = new Date();
        long tm = System.currentTimeMillis();

        System.out.println("making order line table...");
        tm = System.currentTimeMillis();
        // int BATCH_SIZE = parameters.districtsPerWarehouse * (parameters.customersPerDistrict / 30);
        int BATCH_SIZE = 1000;
        long[] b_ol_o_id = new long[BATCH_SIZE];
        long[] b_ol_d_id = new long[BATCH_SIZE];
        long[] b_ol_number = new long[BATCH_SIZE];
        long[] b_ol_i_id = new long[BATCH_SIZE];
        long[] b_ol_supply_w_id = new long[BATCH_SIZE];
        Date[] b_ol_delivery_d = new Date[BATCH_SIZE];
        long[] b_ol_quantity = new long[BATCH_SIZE];
        double[] b_ol_amount = new double[BATCH_SIZE];
        String[] b_ol_dist_info = new String[BATCH_SIZE];
        int total = 0;
        int batch_cnt = 0;
        int w_id = 1;
        int customersPerDistrictAfterInsertion = (int) (parameters.customersPerDistrict * 3.0);
        for (int d_id = 1; d_id <= parameters.districtsPerWarehouse; ++d_id) {
            for (int o_id = 1; o_id <= customersPerDistrictAfterInsertion; ++o_id) { //10% more
                // Generate each OrderLine for the order
                long o_ol_cnt = generator.number(TPCCConstants.MIN_OL_CNT, TPCCConstants.MAX_OL_CNT);
                boolean newOrder =
                    parameters.customersPerDistrict - parameters.newOrdersPerDistrict < o_id;
                for (int ol_number = 1; ol_number <= o_ol_cnt; ++ol_number) {
                    //generateOrderLine(w_id, d_id, o_id, ol_number, newOrder);
                    //(long ol_w_id, long ol_d_id, long ol_o_id, long ol_number, boolean newOrder)
                    b_ol_o_id[batch_cnt] = o_id;
                    b_ol_d_id[batch_cnt] = d_id;
                    b_ol_number[batch_cnt] = ol_number;
                    b_ol_i_id[batch_cnt] = generator.number(1, parameters.num_items);
                    b_ol_supply_w_id[batch_cnt] = w_id;
                    b_ol_delivery_d[batch_cnt] = generationDateTime;
                    b_ol_quantity[batch_cnt] = TPCCConstants.INITIAL_QUANTITY;

                    if (!newOrder) {
                        b_ol_amount[batch_cnt] = 0.00;
                    } else {
                        b_ol_amount[batch_cnt] = generator.fixedPoint(TPCCConstants.MONEY_DECIMALS, TPCCConstants.MIN_AMOUNT,
                                TPCCConstants.MAX_PRICE * TPCCConstants.MAX_OL_QUANTITY);
                        b_ol_delivery_d[batch_cnt] = null;
                    }
                    b_ol_dist_info[batch_cnt] = generator.astring(TPCCConstants.DIST, TPCCConstants.DIST);
                    ++batch_cnt;
                    if (batch_cnt == BATCH_SIZE) {
                        total += BATCH_SIZE;
                        System.out.println ("loading: " + total + "/" + (parameters.districtsPerWarehouse * customersPerDistrictAfterInsertion * (TPCCConstants.MAX_OL_CNT - TPCCConstants.MIN_OL_CNT)));
                        client.callProcedure(InsertOrderLineBatched.class.getSimpleName(),
                            b_ol_o_id, b_ol_d_id, w_id, b_ol_number, b_ol_i_id,
                            b_ol_supply_w_id, b_ol_delivery_d, b_ol_quantity, b_ol_amount, b_ol_dist_info);
                        batch_cnt = 0;
                    }
                }
            }
        }

        System.out.println("created " + (System.currentTimeMillis() - tm) + "ms");
        tm = System.currentTimeMillis();

        //delete the 10% orderline
        client.callProcedure(ResetWarehouse.class.getSimpleName(),
                1L,
                (long) parameters.districtsPerWarehouse,
                (long) parameters.customersPerDistrict,
                (long) parameters.newOrdersPerDistrict);
        System.out.println("deleted " + (System.currentTimeMillis() - tm) + "ms");
        tm = System.currentTimeMillis();
        server.shutdown();
    }
View Full Code Here

Examples of org.voltdb.ServerThread

//        config.m_profilingLevel = ProcedureProfiler.Level.DISABLED;

        this.catalogContext = CatalogUtil.loadCatalogContextFromJar(m_jarFileName);
        HStoreConf hstore_conf = HStoreConf.singleton(HStoreConf.isInitialized() == false);
        hstore_conf.loadFromArgs(this.confParams);
        m_server = new ServerThread(this.catalogContext, hstore_conf, 0);
        m_server.start();
        m_server.waitForInitialization();
    }
View Full Code Here

Examples of org.voltdb.ServerThread

        for (Site catalog_site : catalogContext.sites) {
            final int site_id = catalog_site.getId();
           
            // If this is the first site, then start the HStoreSite in this JVM
            if (site_id == 0) {
                m_localServer = new ServerThread(this.catalogContext, hstore_conf, site_id);
                m_localServer.start();
                if (logtime) {
                    System.out.println("********** Started in-process HStoreSite [siteId=" + site_id + "]");
                    System.out.flush();
                }
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.