Skip to content

Local Instance Setup

Jean-François Im edited this page Oct 7, 2015 · 2 revisions

Open source release

Prerequisites

  • Maven (http://maven.apache.org/) set up and on your path
  • You need git
  • You need an instance of Zookeeper that you have access to

Checking out and compiling the code

Pinot 2.0 is built using Maven.

  1. Check out the project from Github
git clone https://github.com/linkedin/pinot.git
  1. Compile the project using Maven
mvn -DskipTests install
  1. Optionally run the unit tests (approximately 20 minutes)
mvn test

IDE Configuration

Eclipse

If you have M2Eclipse set up, you can import the project according to the M2Eclipse instructions. Otherwise, you can create the Eclipse project manually using mvn eclipse:eclipse, then configure the M2_REPO classpath variable (see http://www.mkyong.com/maven/how-to-configure-m2_repo-variable-in-eclipse-ide/ for example), after which it will compile. Some of the integration tests are broken due to Eclipse classpath ordering, but they run correctly when maven is launched manually through the command line.

IntelliJ IDEA

Open the project directory, IDEA will load it as a normal Maven project. No further configuration is necessary.

Running a local instance of Pinot 2.0 in your IDE

For debugging purposes, the easiest way to run everything is to run a cluster is to run an entire cluster in a single JVM. One way to do it is to create a class in the integration tests that launches a Zookeeper instance, creates a controller, a broker and a server and launches all three within the same JVM. This way, breakpoints will work as expected

package com.linkedin.pinot.integration.tests;
 
import com.linkedin.pinot.broker.broker.BrokerTestUtils;
import com.linkedin.pinot.common.ZkTestUtils;
import com.linkedin.pinot.common.utils.CommonConstants;
import com.linkedin.pinot.controller.helix.ControllerTestUtils;
import com.linkedin.pinot.server.util.ServerTestUtils;
import org.apache.commons.configuration.Configuration;
 
 
public class PinotCluster extends ClusterTest {
  public PinotCluster() throws Exception {
    ZkTestUtils.startLocalZkServer();
    ControllerTestUtils.startController(HELIX_CLUSTER_NAME, ZkTestUtils.DEFAULT_ZK_STR, ControllerTestUtils.getDefaultControllerConfiguration());
    Configuration defaultServerConfiguration = ServerTestUtils.getDefaultServerConfiguration();
    defaultServerConfiguration.setProperty(CommonConstants.Server.CONFIG_OF_INSTANCE_READ_MODE, "mmap");
    ServerTestUtils.startServer(HELIX_CLUSTER_NAME, ZkTestUtils.DEFAULT_ZK_STR, defaultServerConfiguration);
    BrokerTestUtils.startBroker(HELIX_CLUSTER_NAME, ZkTestUtils.DEFAULT_ZK_STR, BrokerTestUtils.getDefaultBrokerConfiguration());
 
    // Create a data resource
    createOfflineResource("MyResource", "DaysSinceEpoch", "daysSinceEpoch", 300, "DAYS");
 
    // Add table to resource
    addTableToOfflineResource("MyResource", "MyTable", "DaysSinceEpoch", "daysSinceEpoch");
  }
 
  public static final String HELIX_CLUSTER_NAME = "ide-test";
 
  public static void main(String[] args) throws Exception {
    new PinotCluster();
  }
 
  @Override
  protected String getHelixClusterName() {
    return HELIX_CLUSTER_NAME;
  }
}

Home

Pinot Documentation

Pinot Administration

Contributor

Design Docs

  • Multitenancy
  • Architecture
  • Query Execution
  • [Pinot Core Concepts and Terminology] (Pinot-Core-Concepts-and-Terminology)
  • [Low level kafka Consumers] (Low-level-kafka-consumers)
  • [Expressions & UDF Support] (Expressions-&-UDF-support)

Clone this wiki locally