public static <K, V extends Comparable<? super V>> Map<K, V> reverseSortByValue(Map<K, V> map)

package edu.usc.cssl.tacit.topicmodel.onlinelda.services;

import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Matrix;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.LinearArray;
import edu.usc.cssl.tacit.common.ui.views.ConsoleView;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Documents;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;

/*
 * An encapsulating class to hold the results of updateLambda method in the OnlineLda class
 */
public class OnlineLDAOutput {

    private final Matrix lambda;

    private final Matrix gamma;

    private final double perplexity;

    private final Documents documents;

    private final int totalWordCount;

    private final int D;

    final static NumberFormat NF = new DecimalFormat("##.####");

    public OnlineLDAOutput(Matrix lambda, Matrix gamma, double bound, Documents docs, int D) {
        this.D = D;
        this.lambda = lambda;
        this.gamma = gamma;
        this.documents = docs;
        this.totalWordCount = docs.getWordCount();
        double perWordBound = (bound * docs.size()) / (D * totalWordCount);
        this.perplexity = Math.exp(-perWordBound);
        System.out.println("Perplexity: " + perplexity);
        ConsoleView.printlInConsoleln("Perplexity: " + perplexity);
    }

    public void printTopics(PrintWriter p1, PrintWriter p2, ArrayList<Documents> dList, Vocabulary v, int wordsPerTopic, IProgressMonitor monitor) {
        int[][] topicWords = new int[lambda.numOfRows()][wordsPerTopic];
        for (int k = 0; k < lambda.numOfRows(); k++) {
            monitor.subTask("Writing Topic " + k);
            p2.println("Topic " + k);
            ConsoleView.printlInConsoleln("Topic " + k);
            int num = 0;
            LinearArray lambdak = lambda.getRow(k);
            lambdak = lambdak.div(lambdak.sum());
            for (int i = 0; i < lambdak.size(); i++) {
                p1.print(lambdak.values[i] + " ");
            }
            p1.print("\n");
            HashMap<Integer, Double> topicWordsWts = new HashMap<Integer, Double>();
            for (int i = 0; i < lambdak.size(); i++) {
                double value = lambdak.values[i];
                topicWordsWts.put(i, value);
            }
            Map<Integer, Double> results = reverseSortByValue(topicWordsWts);
            Iterator i = results.entrySet().iterator();
            while (i.hasNext() && num < wordsPerTopic) {
                Map.Entry me = (Map.Entry) i.next();
                int y = (int) me.getKey();
                p2.print(v.getToken(y) + "=" + me.getValue());
                p2.print("\n");
                ConsoleView.printlInConsoleln(v.getToken(y) + "=" + me.getValue());
                num++;
            }
            ConsoleView.printlInConsoleln();
            monitor.worked(50);
            if (monitor.isCanceled()) {
                throw new OperationCanceledException();
            }
        }
        p1.close();
        p2.close();
    }

{
        List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<K, V>>() {

            @Override
            public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
                return -(e1.getValue()).compareTo(e2.getValue());
            }
        });
        Map<K, V> result = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : list) {
            result.put(entry.getKey(), entry.getValue());
        }
        return result;
    }
}


{
                return -(e1.getValue()).compareTo(e2.getValue());
            }

package edu.usc.cssl.tacit.topicmodel.onlinelda.services;

import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Matrix;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.LinearArray;
import edu.usc.cssl.tacit.common.ui.views.ConsoleView;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Documents;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;

/*
 * An encapsulating class to hold the results of updateLambda method in the OnlineLda class
 */
public class OnlineLDAOutput {

    private final Matrix lambda;

    private final Matrix gamma;

    private final double perplexity;

    private final Documents documents;

    private final int totalWordCount;

    private final int D;

    final static NumberFormat NF = new DecimalFormat("##.####");

    public OnlineLDAOutput(Matrix lambda, Matrix gamma, double bound, Documents docs, int D) {
        this.D = D;
        this.lambda = lambda;
        this.gamma = gamma;
        this.documents = docs;
        this.totalWordCount = docs.getWordCount();
        double perWordBound = (bound * docs.size()) / (D * totalWordCount);
        this.perplexity = Math.exp(-perWordBound);
        System.out.println("Perplexity: " + perplexity);
        ConsoleView.printlInConsoleln("Perplexity: " + perplexity);
    }

    public void printTopics(PrintWriter p1, PrintWriter p2, ArrayList<Documents> dList, Vocabulary v, int wordsPerTopic, IProgressMonitor monitor) {
        int[][] topicWords = new int[lambda.numOfRows()][wordsPerTopic];
        for (int k = 0; k < lambda.numOfRows(); k++) {
            monitor.subTask("Writing Topic " + k);
            p2.println("Topic " + k);
            ConsoleView.printlInConsoleln("Topic " + k);
            int num = 0;
            LinearArray lambdak = lambda.getRow(k);
            lambdak = lambdak.div(lambdak.sum());
            for (int i = 0; i < lambdak.size(); i++) {
                p1.print(lambdak.values[i] + " ");
            }
            p1.print("\n");
            HashMap<Integer, Double> topicWordsWts = new HashMap<Integer, Double>();
            for (int i = 0; i < lambdak.size(); i++) {
                double value = lambdak.values[i];
                topicWordsWts.put(i, value);
            }
            Map<Integer, Double> results = reverseSortByValue(topicWordsWts);
            Iterator i = results.entrySet().iterator();
            while (i.hasNext() && num < wordsPerTopic) {
                Map.Entry me = (Map.Entry) i.next();
                int y = (int) me.getKey();
                p2.print(v.getToken(y) + "=" + me.getValue());
                p2.print("\n");
                ConsoleView.printlInConsoleln(v.getToken(y) + "=" + me.getValue());
                num++;
            }
            ConsoleView.printlInConsoleln();
            monitor.worked(50);
            if (monitor.isCanceled()) {
                throw new OperationCanceledException();
            }
        }
        p1.close();
        p2.close();
    }

    public static <K, V extends Comparable<? super V>> Map<K, V> reverseSortByValue(Map<K, V> map) {
        List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<K, V>>() {

            @Override
            public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2)

        });
        Map<K, V> result = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : list) {
            result.put(entry.getKey(), entry.getValue());
        }
        return result;
    }
}


        List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<K, V>>() {

            @Override
            public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
                return -(e1.getValue()).compareTo(e2.getValue());
            }
        });

package edu.usc.cssl.tacit.topicmodel.onlinelda.services;

import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Matrix;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.LinearArray;
import edu.usc.cssl.tacit.common.ui.views.ConsoleView;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Documents;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;

/*
 * An encapsulating class to hold the results of updateLambda method in the OnlineLda class
 */
public class OnlineLDAOutput {

    private final Matrix lambda;

    private final Matrix gamma;

    private final double perplexity;

    private final Documents documents;

    private final int totalWordCount;

    private final int D;

    final static NumberFormat NF = new DecimalFormat("##.####");

    public OnlineLDAOutput(Matrix lambda, Matrix gamma, double bound, Documents docs, int D) {
        this.D = D;
        this.lambda = lambda;
        this.gamma = gamma;
        this.documents = docs;
        this.totalWordCount = docs.getWordCount();
        double perWordBound = (bound * docs.size()) / (D * totalWordCount);
        this.perplexity = Math.exp(-perWordBound);
        System.out.println("Perplexity: " + perplexity);
        ConsoleView.printlInConsoleln("Perplexity: " + perplexity);
    }

    public void printTopics(PrintWriter p1, PrintWriter p2, ArrayList<Documents> dList, Vocabulary v, int wordsPerTopic, IProgressMonitor monitor) {
        int[][] topicWords = new int[lambda.numOfRows()][wordsPerTopic];
        for (int k = 0; k < lambda.numOfRows(); k++) {
            monitor.subTask("Writing Topic " + k);
            p2.println("Topic " + k);
            ConsoleView.printlInConsoleln("Topic " + k);
            int num = 0;
            LinearArray lambdak = lambda.getRow(k);
            lambdak = lambdak.div(lambdak.sum());
            for (int i = 0; i < lambdak.size(); i++) {
                p1.print(lambdak.values[i] + " ");
            }
            p1.print("\n");
            HashMap<Integer, Double> topicWordsWts = new HashMap<Integer, Double>();
            for (int i = 0; i < lambdak.size(); i++) {
                double value = lambdak.values[i];
                topicWordsWts.put(i, value);
            }
            Map<Integer, Double> results = reverseSortByValue(topicWordsWts);
            Iterator i = results.entrySet().iterator();
            while (i.hasNext() && num < wordsPerTopic) {
                Map.Entry me = (Map.Entry) i.next();
                int y = (int) me.getKey();
                p2.print(v.getToken(y) + "=" + me.getValue());
                p2.print("\n");
                ConsoleView.printlInConsoleln(v.getToken(y) + "=" + me.getValue());
                num++;
            }
            ConsoleView.printlInConsoleln();
            monitor.worked(50);
            if (monitor.isCanceled()) {
                throw new OperationCanceledException();
            }
        }
        p1.close();
        p2.close();
    }

    public static <K, V extends Comparable<? super V>> Map<K, V> reverseSortByValue(Map<K, V> map) {

        Map<K, V> result = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : list) {
            result.put(entry.getKey(), entry.getValue());
        }
        return result;
    }
}


Map<K, V> result = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : list) {
            result.put(entry.getKey(), entry.getValue());
        }

package edu.usc.cssl.tacit.topicmodel.onlinelda.services;

import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Matrix;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.LinearArray;
import edu.usc.cssl.tacit.common.ui.views.ConsoleView;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Documents;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;

/*
 * An encapsulating class to hold the results of updateLambda method in the OnlineLda class
 */
public class OnlineLDAOutput {

    private final Matrix lambda;

    private final Matrix gamma;

    private final double perplexity;

    private final Documents documents;

    private final int totalWordCount;

    private final int D;

    final static NumberFormat NF = new DecimalFormat("##.####");

    public OnlineLDAOutput(Matrix lambda, Matrix gamma, double bound, Documents docs, int D) {
        this.D = D;
        this.lambda = lambda;
        this.gamma = gamma;
        this.documents = docs;
        this.totalWordCount = docs.getWordCount();
        double perWordBound = (bound * docs.size()) / (D * totalWordCount);
        this.perplexity = Math.exp(-perWordBound);
        System.out.println("Perplexity: " + perplexity);
        ConsoleView.printlInConsoleln("Perplexity: " + perplexity);
    }

    public void printTopics(PrintWriter p1, PrintWriter p2, ArrayList<Documents> dList, Vocabulary v, int wordsPerTopic, IProgressMonitor monitor) {
        int[][] topicWords = new int[lambda.numOfRows()][wordsPerTopic];
        for (int k = 0; k < lambda.numOfRows(); k++) {
            monitor.subTask("Writing Topic " + k);
            p2.println("Topic " + k);
            ConsoleView.printlInConsoleln("Topic " + k);
            int num = 0;
            LinearArray lambdak = lambda.getRow(k);
            lambdak = lambdak.div(lambdak.sum());
            for (int i = 0; i < lambdak.size(); i++) {
                p1.print(lambdak.values[i] + " ");
            }
            p1.print("\n");
            HashMap<Integer, Double> topicWordsWts = new HashMap<Integer, Double>();
            for (int i = 0; i < lambdak.size(); i++) {
                double value = lambdak.values[i];
                topicWordsWts.put(i, value);
            }
            Map<Integer, Double> results = reverseSortByValue(topicWordsWts);
            Iterator i = results.entrySet().iterator();
            while (i.hasNext() && num < wordsPerTopic) {
                Map.Entry me = (Map.Entry) i.next();
                int y = (int) me.getKey();
                p2.print(v.getToken(y) + "=" + me.getValue());
                p2.print("\n");
                ConsoleView.printlInConsoleln(v.getToken(y) + "=" + me.getValue());
                num++;
            }
            ConsoleView.printlInConsoleln();
            monitor.worked(50);
            if (monitor.isCanceled()) {
                throw new OperationCanceledException();
            }
        }
        p1.close();
        p2.close();
    }

    public static <K, V extends Comparable<? super V>> Map<K, V> reverseSortByValue(Map<K, V> map) {
        List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<K, V>>() {

            @Override
            public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
                return -(e1.getValue()).compareTo(e2.getValue());
            }
        });


package edu.usc.cssl.tacit.topicmodel.onlinelda.services;

import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Matrix;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.LinearArray;
import edu.usc.cssl.tacit.common.ui.views.ConsoleView;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Documents;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;

/*
 * An encapsulating class to hold the results of updateLambda method in the OnlineLda class
 */
public class OnlineLDAOutput {

    private final Matrix lambda;

    private final Matrix gamma;

    private final double perplexity;

    private final Documents documents;

    private final int totalWordCount;

    private final int D;

    final static NumberFormat NF = new DecimalFormat("##.####");

    public OnlineLDAOutput(Matrix lambda, Matrix gamma, double bound, Documents docs, int D) {
        this.D = D;
        this.lambda = lambda;
        this.gamma = gamma;
        this.documents = docs;
        this.totalWordCount = docs.getWordCount();
        double perWordBound = (bound * docs.size()) / (D * totalWordCount);
        this.perplexity = Math.exp(-perWordBound);
        System.out.println("Perplexity: " + perplexity);
        ConsoleView.printlInConsoleln("Perplexity: " + perplexity);
    }

    public void printTopics(PrintWriter p1, PrintWriter p2, ArrayList<Documents> dList, Vocabulary v, int wordsPerTopic, IProgressMonitor monitor) {
        int[][] topicWords = new int[lambda.numOfRows()][wordsPerTopic];
        for (int k = 0; k < lambda.numOfRows(); k++) {
            monitor.subTask("Writing Topic " + k);
            p2.println("Topic " + k);
            ConsoleView.printlInConsoleln("Topic " + k);
            int num = 0;
            LinearArray lambdak = lambda.getRow(k);
            lambdak = lambdak.div(lambdak.sum());
            for (int i = 0; i < lambdak.size(); i++) {
                p1.print(lambdak.values[i] + " ");
            }
            p1.print("\n");
            HashMap<Integer, Double> topicWordsWts = new HashMap<Integer, Double>();
            for (int i = 0; i < lambdak.size(); i++) {
                double value = lambdak.values[i];
                topicWordsWts.put(i, value);
            }
            Map<Integer, Double> results = reverseSortByValue(topicWordsWts);
            Iterator i = results.entrySet().iterator();
            while (i.hasNext() && num < wordsPerTopic) {
                Map.Entry me = (Map.Entry) i.next();
                int y = (int) me.getKey();
                p2.print(v.getToken(y) + "=" + me.getValue());
                p2.print("\n");
                ConsoleView.printlInConsoleln(v.getToken(y) + "=" + me.getValue());
                num++;
            }
            ConsoleView.printlInConsoleln();
            monitor.worked(50);
            if (monitor.isCanceled()) {
                throw new OperationCanceledException();
            }
        }
        p1.close();
        p2.close();
    }

    public static <K, V extends Comparable<? super V>> Map<K, V> reverseSortByValue(Map<K, V> map) {
        List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<K, V>>() {

            @Override
            public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
                return -(e1.getValue()).compareTo(e2.getValue());
            }
        });
        Map<K, V> result = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : list) {
            result.put(entry.getKey(), entry.getValue());
        }


[] topicWords = new int[lambda.numOfRows()][wordsPerTopic];

package edu.usc.cssl.tacit.topicmodel.onlinelda.services;

import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Matrix;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.LinearArray;
import edu.usc.cssl.tacit.common.ui.views.ConsoleView;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Documents;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;

/*
 * An encapsulating class to hold the results of updateLambda method in the OnlineLda class
 */
public class OnlineLDAOutput {

    private final Matrix lambda;

    private final Matrix gamma;

    private final double perplexity;

    private final Documents documents;

    private final int totalWordCount;

    private final int D;

    final static NumberFormat NF = new DecimalFormat("##.####");

    public OnlineLDAOutput(Matrix lambda, Matrix gamma, double bound, Documents docs, int D) {
        this.D = D;
        this.lambda = lambda;
        this.gamma = gamma;
        this.documents = docs;
        this.totalWordCount = docs.getWordCount();
        double perWordBound = (bound * docs.size()) / (D * totalWordCount);
        this.perplexity = Math.exp(-perWordBound);
        System.out.println("Perplexity: " + perplexity);
        ConsoleView.printlInConsoleln("Perplexity: " + perplexity);
    }

    public void printTopics(PrintWriter p1, PrintWriter p2, ArrayList<Documents> dList, Vocabulary v, int wordsPerTopic, IProgressMonitor monitor) {
        int[]

        for (int k = 0; k < lambda.numOfRows(); k++) {
            monitor.subTask("Writing Topic " + k);
            p2.println("Topic " + k);
            ConsoleView.printlInConsoleln("Topic " + k);
            int num = 0;
            LinearArray lambdak = lambda.getRow(k);
            lambdak = lambdak.div(lambdak.sum());
            for (int i = 0; i < lambdak.size(); i++) {
                p1.print(lambdak.values[i] + " ");
            }
            p1.print("\n");
            HashMap<Integer, Double> topicWordsWts = new HashMap<Integer, Double>();
            for (int i = 0; i < lambdak.size(); i++) {
                double value = lambdak.values[i];
                topicWordsWts.put(i, value);
            }
            Map<Integer, Double> results = reverseSortByValue(topicWordsWts);
            Iterator i = results.entrySet().iterator();
            while (i.hasNext() && num < wordsPerTopic) {
                Map.Entry me = (Map.Entry) i.next();
                int y = (int) me.getKey();
                p2.print(v.getToken(y) + "=" + me.getValue());
                p2.print("\n");
                ConsoleView.printlInConsoleln(v.getToken(y) + "=" + me.getValue());
                num++;
            }
            ConsoleView.printlInConsoleln();
            monitor.worked(50);
            if (monitor.isCanceled()) {
                throw new OperationCanceledException();
            }
        }
        p1.close();
        p2.close();
    }

    public static <K, V extends Comparable<? super V>> Map<K, V> reverseSortByValue(Map<K, V> map) {
        List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<K, V>>() {

            @Override
            public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
                return -(e1.getValue()).compareTo(e2.getValue());
            }
        });
        Map<K, V> result = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : list) {
            result.put(entry.getKey(), entry.getValue());
        }
        return result;
    }
}


if (monitor.isCanceled()) {
                throw new OperationCanceledException();
            }

package edu.usc.cssl.tacit.topicmodel.onlinelda.services;

import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Matrix;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.LinearArray;
import edu.usc.cssl.tacit.common.ui.views.ConsoleView;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Documents;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;

/*
 * An encapsulating class to hold the results of updateLambda method in the OnlineLda class
 */
public class OnlineLDAOutput {

    private final Matrix lambda;

    private final Matrix gamma;

    private final double perplexity;

    private final Documents documents;

    private final int totalWordCount;

    private final int D;

    final static NumberFormat NF = new DecimalFormat("##.####");

    public OnlineLDAOutput(Matrix lambda, Matrix gamma, double bound, Documents docs, int D) {
        this.D = D;
        this.lambda = lambda;
        this.gamma = gamma;
        this.documents = docs;
        this.totalWordCount = docs.getWordCount();
        double perWordBound = (bound * docs.size()) / (D * totalWordCount);
        this.perplexity = Math.exp(-perWordBound);
        System.out.println("Perplexity: " + perplexity);
        ConsoleView.printlInConsoleln("Perplexity: " + perplexity);
    }

    public void printTopics(PrintWriter p1, PrintWriter p2, ArrayList<Documents> dList, Vocabulary v, int wordsPerTopic, IProgressMonitor monitor) {
        int[][] topicWords = new int[lambda.numOfRows()][wordsPerTopic];
        for (int k = 0; k < lambda.numOfRows(); k++) {
            monitor.subTask("Writing Topic " + k);
            p2.println("Topic " + k);
            ConsoleView.printlInConsoleln("Topic " + k);
            int num = 0;
            LinearArray lambdak = lambda.getRow(k);
            lambdak = lambdak.div(lambdak.sum());
            for (int i = 0; i < lambdak.size(); i++) {
                p1.print(lambdak.values[i] + " ");
            }
            p1.print("\n");
            HashMap<Integer, Double> topicWordsWts = new HashMap<Integer, Double>();
            for (int i = 0; i < lambdak.size(); i++) {
                double value = lambdak.values[i];
                topicWordsWts.put(i, value);
            }
            Map<Integer, Double> results = reverseSortByValue(topicWordsWts);
            Iterator i = results.entrySet().iterator();
            while (i.hasNext() && num < wordsPerTopic) {
                Map.Entry me = (Map.Entry) i.next();
                int y = (int) me.getKey();
                p2.print(v.getToken(y) + "=" + me.getValue());
                p2.print("\n");
                ConsoleView.printlInConsoleln(v.getToken(y) + "=" + me.getValue());
                num++;
            }
            ConsoleView.printlInConsoleln();
            monitor.worked(50);

        }
        p1.close();
        p2.close();
    }

    public static <K, V extends Comparable<? super V>> Map<K, V> reverseSortByValue(Map<K, V> map) {
        List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<K, V>>() {

            @Override
            public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
                return -(e1.getValue()).compareTo(e2.getValue());
            }
        });
        Map<K, V> result = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : list) {
            result.put(entry.getKey(), entry.getValue());
        }
        return result;
    }
}


for (int i = 0; i < lambdak.size(); i++) {
                double value = lambdak.values[i];
                topicWordsWts.put(i, value);
            }

package edu.usc.cssl.tacit.topicmodel.onlinelda.services;

import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Matrix;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.LinearArray;
import edu.usc.cssl.tacit.common.ui.views.ConsoleView;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Documents;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;

/*
 * An encapsulating class to hold the results of updateLambda method in the OnlineLda class
 */
public class OnlineLDAOutput {

    private final Matrix lambda;

    private final Matrix gamma;

    private final double perplexity;

    private final Documents documents;

    private final int totalWordCount;

    private final int D;

    final static NumberFormat NF = new DecimalFormat("##.####");

    public OnlineLDAOutput(Matrix lambda, Matrix gamma, double bound, Documents docs, int D) {
        this.D = D;
        this.lambda = lambda;
        this.gamma = gamma;
        this.documents = docs;
        this.totalWordCount = docs.getWordCount();
        double perWordBound = (bound * docs.size()) / (D * totalWordCount);
        this.perplexity = Math.exp(-perWordBound);
        System.out.println("Perplexity: " + perplexity);
        ConsoleView.printlInConsoleln("Perplexity: " + perplexity);
    }

    public void printTopics(PrintWriter p1, PrintWriter p2, ArrayList<Documents> dList, Vocabulary v, int wordsPerTopic, IProgressMonitor monitor) {
        int[][] topicWords = new int[lambda.numOfRows()][wordsPerTopic];
        for (int k = 0; k < lambda.numOfRows(); k++) {
            monitor.subTask("Writing Topic " + k);
            p2.println("Topic " + k);
            ConsoleView.printlInConsoleln("Topic " + k);
            int num = 0;
            LinearArray lambdak = lambda.getRow(k);
            lambdak = lambdak.div(lambdak.sum());
            for (int i = 0; i < lambdak.size(); i++) {
                p1.print(lambdak.values[i] + " ");
            }
            p1.print("\n");
            HashMap<Integer, Double> topicWordsWts = new HashMap<Integer, Double>();

            Map<Integer, Double> results = reverseSortByValue(topicWordsWts);
            Iterator i = results.entrySet().iterator();
            while (i.hasNext() && num < wordsPerTopic) {
                Map.Entry me = (Map.Entry) i.next();
                int y = (int) me.getKey();
                p2.print(v.getToken(y) + "=" + me.getValue());
                p2.print("\n");
                ConsoleView.printlInConsoleln(v.getToken(y) + "=" + me.getValue());
                num++;
            }
            ConsoleView.printlInConsoleln();
            monitor.worked(50);
            if (monitor.isCanceled()) {
                throw new OperationCanceledException();
            }
        }
        p1.close();
        p2.close();
    }

    public static <K, V extends Comparable<? super V>> Map<K, V> reverseSortByValue(Map<K, V> map) {
        List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<K, V>>() {

            @Override
            public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
                return -(e1.getValue()).compareTo(e2.getValue());
            }
        });
        Map<K, V> result = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : list) {
            result.put(entry.getKey(), entry.getValue());
        }
        return result;
    }
}


while (i.hasNext() && num < wordsPerTopic) {
                Map.Entry me = (Map.Entry) i.next();
                int y = (int) me.getKey();
                p2.print(v.getToken(y) + "=" + me.getValue());
                p2.print("\n");
                ConsoleView.printlInConsoleln(v.getToken(y) + "=" + me.getValue());
                num++;
            }

package edu.usc.cssl.tacit.topicmodel.onlinelda.services;

import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Matrix;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.LinearArray;
import edu.usc.cssl.tacit.common.ui.views.ConsoleView;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Documents;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;

/*
 * An encapsulating class to hold the results of updateLambda method in the OnlineLda class
 */
public class OnlineLDAOutput {

    private final Matrix lambda;

    private final Matrix gamma;

    private final double perplexity;

    private final Documents documents;

    private final int totalWordCount;

    private final int D;

    final static NumberFormat NF = new DecimalFormat("##.####");

    public OnlineLDAOutput(Matrix lambda, Matrix gamma, double bound, Documents docs, int D) {
        this.D = D;
        this.lambda = lambda;
        this.gamma = gamma;
        this.documents = docs;
        this.totalWordCount = docs.getWordCount();
        double perWordBound = (bound * docs.size()) / (D * totalWordCount);
        this.perplexity = Math.exp(-perWordBound);
        System.out.println("Perplexity: " + perplexity);
        ConsoleView.printlInConsoleln("Perplexity: " + perplexity);
    }

    public void printTopics(PrintWriter p1, PrintWriter p2, ArrayList<Documents> dList, Vocabulary v, int wordsPerTopic, IProgressMonitor monitor) {
        int[][] topicWords = new int[lambda.numOfRows()][wordsPerTopic];
        for (int k = 0; k < lambda.numOfRows(); k++) {
            monitor.subTask("Writing Topic " + k);
            p2.println("Topic " + k);
            ConsoleView.printlInConsoleln("Topic " + k);
            int num = 0;
            LinearArray lambdak = lambda.getRow(k);
            lambdak = lambdak.div(lambdak.sum());
            for (int i = 0; i < lambdak.size(); i++) {
                p1.print(lambdak.values[i] + " ");
            }
            p1.print("\n");
            HashMap<Integer, Double> topicWordsWts = new HashMap<Integer, Double>();
            for (int i = 0; i < lambdak.size(); i++) {
                double value = lambdak.values[i];
                topicWordsWts.put(i, value);
            }
            Map<Integer, Double> results = reverseSortByValue(topicWordsWts);
            Iterator i = results.entrySet().iterator();

            ConsoleView.printlInConsoleln();
            monitor.worked(50);
            if (monitor.isCanceled()) {
                throw new OperationCanceledException();
            }
        }
        p1.close();
        p2.close();
    }

    public static <K, V extends Comparable<? super V>> Map<K, V> reverseSortByValue(Map<K, V> map) {
        List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<K, V>>() {

            @Override
            public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
                return -(e1.getValue()).compareTo(e2.getValue());
            }
        });
        Map<K, V> result = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : list) {
            result.put(entry.getKey(), entry.getValue());
        }
        return result;
    }
}


package edu.usc.cssl.tacit.topicmodel.onlinelda.services;

import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Matrix;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.LinearArray;
import edu.usc.cssl.tacit.common.ui.views.ConsoleView;
import edu.usc.cssl.tacit.topicmodel.onlinelda.services.Documents;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;

/*
 * An encapsulating class to hold the results of updateLambda method in the OnlineLda class
 */
public class OnlineLDAOutput {

    private final Matrix lambda;

    private final Matrix gamma;

    private final double p

erplexity;

    private final Documents documents;

    private final int totalWordCount;

    private final int D;

    final static NumberFormat NF = new DecimalFormat("##.####");

    public OnlineLDAOutput(Matrix lambda, Matrix gamma, double bound, Documents docs, int D) {
        this.D = D;
        this.lambda = lambda;
        this.gamma = gamma;
        this.documents = docs;
        this.totalWordCount = docs.getWordCount();
        double perWordBound = (bound * docs.size()) / (D * totalWordCount);
        this.perplexity = Math.exp(-perWordBound);
        System.out.println("Perplexity: " + perplexity);
        ConsoleView.printlInConsoleln("Perplexity: " + perplexity);
    }

    public void printTopics(PrintWriter p1, PrintWriter p2, ArrayList<Documents> dList, Vocabulary v, int wordsPerTopic, IProgressMonitor monitor) {
        int[][] topicWords = new int[lambda.numOfRows()][wordsPerTopic];
        for (int k = 0; k < lambda.numOfRows(); k++) {
            monitor.subTask("Writing Topic " + k);
            p2.println("Topic " + k);
            ConsoleView.printlInConsoleln("Topic " + k);
            int num = 0;
            LinearArray lambdak = lambda.getRow(k);
            lambdak = lambdak.div(lambdak.sum());
            for (int i = 0; i < lambdak.size(); i++) {
                p1.print(lambdak.values[i] + " ");
            }
            p1.print("\n");
            HashMap<Integer, Double> topicWordsWts = new HashMap<Integer, Double>();
            for (int i = 0; i < lambdak.size(); i++) {
                double value = lambdak.values[i];
                topicWordsWts.put(i, value);
            }
            Map<Integer, Double> results = reverseSortByValue(topicWordsWts);
            Iterator i = results.entrySet().iterator();
            while (i.hasNext() && num < wordsPerTopic) {
                Map.Entry me = (Map.Entry) i.next();
                int y = (int) me.getKey();
                p2.print(v.getToken(y) + "=" + me.getValue());
                p2.print("\n");
                ConsoleView.printlInConsoleln(v.getToken(y) + "=" + me.getValue());
                num++;
            }
            ConsoleView.printlInConsoleln();
            monitor.worked(50);
            if (monitor.isCanceled()) {
                throw new OperationCanceledException();
            }
        }
        p1.close();
        p2.close();
    }

    public static <K, V extends Comparable<? super V>> Map<K, V> reverseSortByValue(Map<K, V> map) {
        List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());
        Collections.sort(list, new Comparator<Map.Entry<K, V>>() {

            @Override
            public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
                return -(e1.getValue()).compareTo(e2.getValue());
            }
        });
        Map<K, V> result = new LinkedHashMap<>();
        for (Map.Entry<K, V> entry : list) {
            result.put(entry.getKey(), entry.getValue());
        }
        return result;
    }
}


@Override
    protected void decode(ChannelHandlerContext channelHandlerContext, FullHttpRequest fullHttpRequest, List<Object> list)

package com.zfoo.net.handler.codec.http;

import com.zfoo.net.packet.common.Message;
import com.zfoo.net.packet.model.DecodedPacketInfo;
import com.zfoo.net.packet.model.EncodedPacketInfo;
import com.zfoo.net.router.attachment.HttpAttachment;
import com.zfoo.protocol.IPacket;
import com.zfoo.protocol.util.JsonUtils;
import com.zfoo.protocol.util.StringUtils;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageCodec;
import io.netty.handler.codec.http.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.function.Function;

/**
 * @author jaysunxiao
 * @version 3.0
 */
public class HttpCodecHandler extends MessageToMessageCodec<FullHttpRequest, EncodedPacketInfo> {

    private static final Logger logger = LoggerFactory.getLogger(HttpCodecHandler.class);

    private final Function<FullHttpRequest, DecodedPacketInfo> uriResolver;

    public HttpCodecHandler(Function<FullHttpRequest, DecodedPacketInfo> uriResolver) {
        super();
        this.uriResolver = uriResolver;
    }

{
        try {
            var decodedPacketInfo = uriResolver.apply(fullHttpRequest);
            list.add(decodedPacketInfo);
        } catch (Exception e) {
            logger.error("exception异常", e);
            throw e;
        } catch (Throwable t) {
            logger.error("throwable错误", t);
            throw t;
        }
    }

    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, EncodedPacketInfo out, List<Object> list) {
        try {
            var packet = (IPacket) out.getPacket();
            var attachment = (HttpAttachment) out.getAttachment();
            var protocolVersion = attachment.getFullHttpRequest().protocolVersion();
            var httpResponseStatus = attachment.getHttpResponseStatus();
            if (packet.protocolId() == Message.PROTOCOL_ID) {
                var message = (Message) packet;
                if (message.fail()) {
                    httpResponseStatus = HttpResponseStatus.BAD_REQUEST;
                }
                if (StringUtils.isEmpty(message.getMessage())) {
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                } else {
                    var byteBuf = channelHandlerContext.alloc().ioBuffer();
                    byteBuf.writeCharSequence(message.getMessage(), StringUtils.DEFAULT_CHARSET);
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                }
            } else {
                var byteBuf = channelHandlerContext.alloc().ioBuffer();
                var jsonStr = JsonUtils.object2String(packet);
                byteBuf.writeBytes(StringUtils.bytes(jsonStr));
                var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                list.add(fullHttpResponse);
            }
        } catch (Exception e) {
            logger.error("[{}]编码exception异常", JsonUtils.object2String(out), e);
            throw e;
        } catch (Throwable t) {
            logger.error("[{}]编码throwable错误", JsonUtils.object2String(out), t);
            throw t;
        }
    }
}


{
        try {
            var decodedPacketInfo = uriResolver.apply(fullHttpRequest);
            list.add(decodedPacketInfo);
        } catch (Exception e) {
            logger.error("exception异常", e);
            throw e;
        } catch (Throwable t) {
            logger.error("throwable错误", t);
            throw t;
        }
    }

package com.zfoo.net.handler.codec.http;

import com.zfoo.net.packet.common.Message;
import com.zfoo.net.packet.model.DecodedPacketInfo;
import com.zfoo.net.packet.model.EncodedPacketInfo;
import com.zfoo.net.router.attachment.HttpAttachment;
import com.zfoo.protocol.IPacket;
import com.zfoo.protocol.util.JsonUtils;
import com.zfoo.protocol.util.StringUtils;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageCodec;
import io.netty.handler.codec.http.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.function.Function;

/**
 * @author jaysunxiao
 * @version 3.0
 */
public class HttpCodecHandler extends MessageToMessageCodec<FullHttpRequest, EncodedPacketInfo> {

    private static final Logger logger = LoggerFactory.getLogger(HttpCodecHandler.class);

    private final Function<FullHttpRequest, DecodedPacketInfo> uriResolver;

    public HttpCodecHandler(Function<FullHttpRequest, DecodedPacketInfo> uriResolver) {
        super();
        this.uriResolver = uriResolver;
    }

    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, FullHttpRequest fullHttpRequest, List<Object> list)

    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, EncodedPacketInfo out, List<Object> list) {
        try {
            var packet = (IPacket) out.getPacket();
            var attachment = (HttpAttachment) out.getAttachment();
            var protocolVersion = attachment.getFullHttpRequest().protocolVersion();
            var httpResponseStatus = attachment.getHttpResponseStatus();
            if (packet.protocolId() == Message.PROTOCOL_ID) {
                var message = (Message) packet;
                if (message.fail()) {
                    httpResponseStatus = HttpResponseStatus.BAD_REQUEST;
                }
                if (StringUtils.isEmpty(message.getMessage())) {
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                } else {
                    var byteBuf = channelHandlerContext.alloc().ioBuffer();
                    byteBuf.writeCharSequence(message.getMessage(), StringUtils.DEFAULT_CHARSET);
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                }
            } else {
                var byteBuf = channelHandlerContext.alloc().ioBuffer();
                var jsonStr = JsonUtils.object2String(packet);
                byteBuf.writeBytes(StringUtils.bytes(jsonStr));
                var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                list.add(fullHttpResponse);
            }
        } catch (Exception e) {
            logger.error("[{}]编码exception异常", JsonUtils.object2String(out), e);
            throw e;
        } catch (Throwable t) {
            logger.error("[{}]编码throwable错误", JsonUtils.object2String(out), t);
            throw t;
        }
    }
}


package com.zfoo.net.handler.codec.http;

import com.zfoo.net.packet.common.Message;
import com.zfoo.net.packet.model.DecodedPacketInfo;
import com.zfoo.net.packet.model.EncodedPacketInfo;
import com.zfoo.net.router.attachment.HttpAttachment;
import com.zfoo.protocol.IPacket;
import com.zfoo.protocol.util.JsonUtils;
import com.zfoo.protocol.util.StringUtils;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageCodec;
import io.netty.handler.codec.http.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.function.Function;

/**
 * @author jaysunxiao
 * @version 3.0
 */
public class HttpCodecHandler extends MessageToMessageCodec<FullHttpRequest, EncodedPacketInfo> {

    private static final Logger logger = LoggerFactory.getLogger(HttpCodecHandler.class);

    private final Function<FullHttpRequest, DecodedPacketInfo> uriResolver;

    public HttpCodecHandler(Function<FullHttpRequest, DecodedPacketInfo> uriResolver) {
        super();
        this.uriResolver = uriResolver;
    }

    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, FullHttpRequest fullHttpRequest, List<Object> list) {
        try {
            var decodedPacketInfo = uriResolver.apply(fullHttpRequest);
            list.add(decodedPacketInfo);
        } catch (Exception e) {
            logger.error("exception异常", e);
            throw e;
        } catch (Throwable t) {
            logger.error("throwable错误", t);
            throw t;
        }
    }

    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, EncodedPacketInfo out, List<Object> list) {

        try {
            var packet = (IPacket) out.getPacket();
            var attachment = (HttpAttachment) out.getAttachment();
            var protocolVersion = attachment.getFullHttpRequest().protocolVersion();
            var httpResponseStatus = attachment.getHttpResponseStatus();
            if (packet.protocolId() == Message.PROTOCOL_ID) {
                var message = (Message) packet;
                if (message.fail()) {
                    httpResponseStatus = HttpResponseStatus.BAD_REQUEST;
                }
                if (StringUtils.isEmpty(message.getMessage())) {
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                } else {
                    var byteBuf = channelHandlerContext.alloc().ioBuffer();
                    byteBuf.writeCharSequence(message.getMessage(), StringUtils.DEFAULT_CHARSET);
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                }
            } else {
                var byteBuf = channelHandlerContext.alloc().ioBuffer();
                var jsonStr = JsonUtils.object2String(packet);
                byteBuf.writeBytes(StringUtils.bytes(jsonStr));
                var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                list.add(fullHttpResponse);
            }
        } catch (Exception e) {
            logger.error("[{}]编码exception异常", JsonUtils.object2String(out), e);
            throw e;
        } catch (Throwable t) {
            logger.error("[{}]编码throwable错误", JsonUtils.object2String(out), t);
            throw t;
        }
    }
}


try {
            var packet = (IPacket) out.getPacket();
            var attachment = (HttpAttachment) out.getAttachment();
            var protocolVersion = attachment.getFullHttpRequest().protocolVersion();
            var httpResponseStatus = attachment.getHttpResponseStatus();
            if (packet.protocolId() == Message.PROTOCOL_ID) {
                var message = (Message) packet;
                if (message.fail()) {
                    httpResponseStatus = HttpResponseStatus.BAD_REQUEST;
                }
                if (StringUtils.isEmpty(message.getMessage())) {
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                } else {
                    var byteBuf = channelHandlerContext.alloc().ioBuffer();
                    byteBuf.writeCharSequence(message.getMessage(), StringUtils.DEFAULT_CHARSET);
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                }
            } else {
                var byteBuf = channelHandlerContext.alloc().ioBuffer();
                var jsonStr = JsonUtils.object2String(packet);
                byteBuf.writeBytes(StringUtils.bytes(jsonStr));
                var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                list.add(fullHttpResponse);
            }
        } catch (Exception e) {
            logger.error("[{}]编码exception异常", JsonUtils.object2String(out), e);
            throw e;
        } catch (Throwable t) {
            logger.error("[{}]编码throwable错误", JsonUtils.object2String(out), t);
            throw t;
        }


package com.zfoo.net.handler.codec.http;

import com.zfoo.net.packet.common.Message;
import com.zfoo.net.packet.model.DecodedPacketInfo;
import com.zfoo.net.packet.model.EncodedPacketInfo;
import com.zfoo.net.router.attachment.HttpAttachment;
import com.zfoo.protocol.IPacket;
import com.zfoo.protocol.util.JsonUtils;
import com.zfoo.protocol.util.StringUtils;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageCodec;
import io.netty.handler.codec.http.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.function.Function;

/**
 * @author jaysunxiao
 * @version 3.0
 */
public class HttpCodecHandler extends MessageToMessageCodec<FullHttpRequest, EncodedPacketInfo> {

    private static final Logger logger = LoggerFactory.getLogger(HttpCodecHandler.class);

    private final Function<FullHttpRequest, DecodedPacketInfo> uriResolver;

    public HttpCodecHandler(Function<FullHttpRequest, DecodedPacketInfo> uriResolver) {
        super();
        this.uriResolver = uriResolver;
    }

    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, FullHttpRequest fullHttpRequest, List<Object> list) {
        try {
            var decodedPacketInfo = uriResolver.apply(fullHttpRequest);
            list.add(decodedPacketInfo);
        } catch (Exception e) {
            logger.error("exception异常", e);
            throw e;
        } catch (Throwable t) {
            logger.error("throwable错误", t);
            throw t;
        }
    }

    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, EncodedPacketInfo out, List<Object> list) {
        try {
            var packet = (IPacket) out.getPacket();
            var attachment = (HttpAttachment) out.getAttachment();
            var protocolVersion = attachment.getFullHttpRequest().protocolVersion();
            var httpResponseStatus = attachment.getHttpResponseStatus();
            if (packet.protocolId() == Message.PROTOCOL_ID) {
                var message = (Message) packet;
                if (message.fail()) {
                    httpResponseStatus = HttpResponseStatus.BAD_REQUEST;
                }
                if (StringUtils.isEmpty(message.getMessage())) {
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                } else {
                    var byteBuf = channelHandlerContext.alloc().ioBuffer();
                    byteBuf.writeCharSequence(message.getMessage(), StringUtils.DEFAULT_CHARSET);
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                }
            } else {
                var byteBuf = channelHandlerContext.alloc().ioBuffer();
                var jsonStr = JsonUtils.object2String(packet);
                byteBuf.writeBytes(StringUtils.bytes(jsonStr));
                var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                list.add(fullHttpResponse);
            }
        } catch (Exception e) {
            logger.error("[{}]编码exception异常", JsonUtils.object2String(out), e);
            throw e;
        } catch (Throwable t) {
            logger.error("[{}]编码throwable错误", JsonUtils.object2String(out), t);
            throw t;
        }


if (message.fail()) {
                    httpResponseStatus = HttpResponseStatus.BAD_REQUEST;
                }

package com.zfoo.net.handler.codec.http;

import com.zfoo.net.packet.common.Message;
import com.zfoo.net.packet.model.DecodedPacketInfo;
import com.zfoo.net.packet.model.EncodedPacketInfo;
import com.zfoo.net.router.attachment.HttpAttachment;
import com.zfoo.protocol.IPacket;
import com.zfoo.protocol.util.JsonUtils;
import com.zfoo.protocol.util.StringUtils;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageCodec;
import io.netty.handler.codec.http.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.function.Function;

/**
 * @author jaysunxiao
 * @version 3.0
 */
public class HttpCodecHandler extends MessageToMessageCodec<FullHttpRequest, EncodedPacketInfo> {

    private static final Logger logger = LoggerFactory.getLogger(HttpCodecHandler.class);

    private final Function<FullHttpRequest, DecodedPacketInfo> uriResolver;

    public HttpCodecHandler(Function<FullHttpRequest, DecodedPacketInfo> uriResolver) {
        super();
        this.uriResolver = uriResolver;
    }

    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, FullHttpRequest fullHttpRequest, List<Object> list) {
        try {
            var decodedPacketInfo = uriResolver.apply(fullHttpRequest);
            list.add(decodedPacketInfo);
        } catch (Exception e) {
            logger.error("exception异常", e);
            throw e;
        } catch (Throwable t) {
            logger.error("throwable错误", t);
            throw t;
        }
    }

    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, EncodedPacketInfo out, List<Object> list) {
        try {
            var packet = (IPacket) out.getPacket();
            var attachment = (HttpAttachment) out.getAttachment();
            var protocolVersion = attachment.getFullHttpRequest().protocolVersion();
            var httpResponseStatus = attachment.getHttpResponseStatus();
            if (packet.protocolId() == Message.PROTOCOL_ID) {
                var message = (Message) packet;

                if (StringUtils.isEmpty(message.getMessage())) {
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                } else {
                    var byteBuf = channelHandlerContext.alloc().ioBuffer();
                    byteBuf.writeCharSequence(message.getMessage(), StringUtils.DEFAULT_CHARSET);
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                }
            } else {
                var byteBuf = channelHandlerContext.alloc().ioBuffer();
                var jsonStr = JsonUtils.object2String(packet);
                byteBuf.writeBytes(StringUtils.bytes(jsonStr));
                var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                list.add(fullHttpResponse);
            }
        } catch (Exception e) {
            logger.error("[{}]编码exception异常", JsonUtils.object2String(out), e);
            throw e;
        } catch (Throwable t) {
            logger.error("[{}]编码throwable错误", JsonUtils.object2String(out), t);
            throw t;
        }
    }
}


try {
            var decodedPacketInfo = uriResolver.apply(fullHttpRequest);
            list.add(decodedPacketInfo);
        } catch (Exception e) {
            logger.error("exception异常", e);
            throw e;
        } catch (Throwable t) {
            logger.error("throwable错误", t);
            throw t;
        }

package com.zfoo.net.handler.codec.http;

import com.zfoo.net.packet.common.Message;
import com.zfoo.net.packet.model.DecodedPacketInfo;
import com.zfoo.net.packet.model.EncodedPacketInfo;
import com.zfoo.net.router.attachment.HttpAttachment;
import com.zfoo.protocol.IPacket;
import com.zfoo.protocol.util.JsonUtils;
import com.zfoo.protocol.util.StringUtils;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageCodec;
import io.netty.handler.codec.http.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.function.Function;

/**
 * @author jaysunxiao
 * @version 3.0
 */
public class HttpCodecHandler extends MessageToMessageCodec<FullHttpRequest, EncodedPacketInfo> {

    private static final Logger logger = LoggerFactory.getLogger(HttpCodecHandler.class);

    private final Function<FullHttpRequest, DecodedPacketInfo> uriResolver;

    public HttpCodecHandler(Function<FullHttpRequest, DecodedPacketInfo> uriResolver) {
        super();
        this.uriResolver = uriResolver;
    }

    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, FullHttpRequest fullHttpRequest, List<Object> list) {

    }

    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, EncodedPacketInfo out, List<Object> list) {
        try {
            var packet = (IPacket) out.getPacket();
            var attachment = (HttpAttachment) out.getAttachment();
            var protocolVersion = attachment.getFullHttpRequest().protocolVersion();
            var httpResponseStatus = attachment.getHttpResponseStatus();
            if (packet.protocolId() == Message.PROTOCOL_ID) {
                var message = (Message) packet;
                if (message.fail()) {
                    httpResponseStatus = HttpResponseStatus.BAD_REQUEST;
                }
                if (StringUtils.isEmpty(message.getMessage())) {
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                } else {
                    var byteBuf = channelHandlerContext.alloc().ioBuffer();
                    byteBuf.writeCharSequence(message.getMessage(), StringUtils.DEFAULT_CHARSET);
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                }
            } else {
                var byteBuf = channelHandlerContext.alloc().ioBuffer();
                var jsonStr = JsonUtils.object2String(packet);
                byteBuf.writeBytes(StringUtils.bytes(jsonStr));
                var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                list.add(fullHttpResponse);
            }
        } catch (Exception e) {
            logger.error("[{}]编码exception异常", JsonUtils.object2String(out), e);
            throw e;
        } catch (Throwable t) {
            logger.error("[{}]编码throwable错误", JsonUtils.object2String(out), t);
            throw t;
        }
    }
}


package com.zfoo.net.handler.codec.http;

import com.zfoo.net.packet.common.Message;
import com.zfoo.net.packet.model.DecodedPacketInfo;
import com.zfoo.net.packet.model.EncodedPacketInfo;
import com.zfoo.net.router.attachment.HttpAttachment;
import com.zfoo.protocol.IPacket;
import com.zfoo.protocol.util.JsonUtils;
import com.zfoo.protocol.util.StringUtils;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageCodec;
import io.netty.handler.codec.http.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.function.Function;

/**
 * @author jaysunxiao
 * @version 3.0
 */
public class HttpCodecHandler extends MessageToMessageCodec<FullHttpRequest, EncodedPacketInfo> {

    private static final Logger logger = LoggerFactory.getLogger(HttpCodecHandler.class);

    private final Function<FullHttpRequest, DecodedPacketInfo> uriResolver;

    public HttpCodecHandler(Function<FullHttpRequest, DecodedPacketInfo> uriResolver) {
        super();
        this.uriResolver = uriResolver;
    }

    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, FullHttpRequest fullHttpRequest, List<Object> list) {
        try {
            var decodedPacketInfo = uriResolver.apply(fullHttpRequest);
            list.add(decodedPacketInfo);
        } catch (Exception e) {
            logger.error("exception异常", e);
            throw e;
        } catch (Throwable t) {
            logger.error("throwable错误", t);
            throw t;
        }
    }

    @Override
    pro

tected void encode(ChannelHandlerContext channelHandlerContext, EncodedPacketInfo out, List<Object> list) {
        try {
            var packet = (IPacket) out.getPacket();
            var attachment = (HttpAttachment) out.getAttachment();
            var protocolVersion = attachment.getFullHttpRequest().protocolVersion();
            var httpResponseStatus = attachment.getHttpResponseStatus();
            if (packet.protocolId() == Message.PROTOCOL_ID) {
                var message = (Message) packet;
                if (message.fail()) {
                    httpResponseStatus = HttpResponseStatus.BAD_REQUEST;
                }
                if (StringUtils.isEmpty(message.getMessage())) {
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                } else {
                    var byteBuf = channelHandlerContext.alloc().ioBuffer();
                    byteBuf.writeCharSequence(message.getMessage(), StringUtils.DEFAULT_CHARSET);
                    var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN);
                    fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                    fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                    list.add(fullHttpResponse);
                }
            } else {
                var byteBuf = channelHandlerContext.alloc().ioBuffer();
                var jsonStr = JsonUtils.object2String(packet);
                byteBuf.writeBytes(StringUtils.bytes(jsonStr));
                var fullHttpResponse = new DefaultFullHttpResponse(protocolVersion, httpResponseStatus, byteBuf);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON);
                fullHttpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, byteBuf.readableBytes());
                fullHttpResponse.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                list.add(fullHttpResponse);
            }
        } catch (Exception e) {
            logger.error("[{}]编码exception异常", JsonUtils.object2String(out), e);
            throw e;
        } catch (Throwable t) {
            logger.error("[{}]编码throwable错误", JsonUtils.object2String(out), t);
            throw t;
        }
    }
}


@Override
    public OuterPositionIterator getOuterPositionIterator()

package com.facebook.presto.operator.index;

import com.facebook.presto.common.type.Type;
import com.facebook.presto.operator.LookupSourceFactory;
import com.facebook.presto.operator.LookupSourceProvider;
import com.facebook.presto.operator.OuterPositionIterator;
import com.facebook.presto.operator.PagesIndex;
import com.facebook.presto.operator.StaticLookupSourceProvider;
import com.facebook.presto.operator.TaskContext;
import com.facebook.presto.spi.relation.VariableReferenceExpression;
import com.facebook.presto.sql.gen.JoinCompiler;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import io.airlift.units.DataSize;
import io.airlift.units.Duration;
import java.util.List;
import java.util.Map;
import java.util.OptionalInt;
import java.util.Set;
import java.util.function.Supplier;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.util.concurrent.Futures.transform;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static java.util.Objects.requireNonNull;

public class IndexLookupSourceFactory implements LookupSourceFactory {

    private final List<Type> outputTypes;

    private final Map<VariableReferenceExpression, Integer> layout;

    private final Supplier<IndexLoader> indexLoaderSupplier;

    private TaskContext taskContext;

    private final SettableFuture<?> whenTaskContextSet = SettableFuture.create();

    public IndexLookupSourceFactory(Set<Integer> lookupSourceInputChannels, List<Integer> keyOutputChannels, OptionalInt keyOutputHashChannel, List<Type> outputTypes, Map<VariableReferenceExpression, Integer> layout, IndexBuildDriverFactoryProvider indexBuildDriverFactoryProvider, DataSize maxIndexMemorySize, IndexJoinLookupStats stats, boolean shareIndexLoading, PagesIndex.Factory pagesIndexFactory, JoinCompiler joinCompiler, Duration indexLoaderTimeout) {
        this.outputTypes = ImmutableList.copyOf(requireNonNull(outputTypes, "outputTypes is null"));
        this.layout = ImmutableMap.copyOf(requireNonNull(layout, "layout is null"));
        if (shareIndexLoading) {
            IndexLoader shared = new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
            this.indexLoaderSupplier = () -> shared;
        } else {
            this.indexLoaderSupplier = () -> new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
        }
    }

    @Override
    public List<Type> getTypes() {
        return outputTypes;
    }

    @Override
    public List<Type> getOutputTypes() {
        return outputTypes;
    }

    @Override
    public Map<VariableReferenceExpression, Integer> getLayout() {
        return layout;
    }

    @Override
    public void setTaskContext(TaskContext taskContext) {
        this.taskContext = taskContext;
        whenTaskContextSet.set(null);
    }

    @Override
    public ListenableFuture<LookupSourceProvider> createLookupSourceProvider() {
        checkState(taskContext != null, "taskContext not set");
        IndexLoader indexLoader = indexLoaderSupplier.get();
        indexLoader.setContext(taskContext);
        return Futures.immediateFuture(new StaticLookupSourceProvider(new IndexLookupSource(indexLoader)));
    }

    @Override
    public ListenableFuture<?> whenBuildFinishes() {
        return Futures.transformAsync(whenTaskContextSet, ignored -> transform(this.createLookupSourceProvider(), lookupSourceProvider -> {
            // Close the lookupSourceProvider we just created.
            // The only reason we created it is to wait until lookup source is ready.
            lookupSourceProvider.close();
            return null;
        }, directExecutor()), directExecutor());
    }

    @Override
    public int partitions() {
        throw new UnsupportedOperationException();
    }

{
        throw new UnsupportedOperationException();
    }

    @Override
    public void destroy() {
        // nothing to do
    }
}


package com.facebook.presto.operator.index;

import com.facebook.presto.common.type.Type;
import com.facebook.presto.operator.LookupSourceFactory;
import com.facebook.presto.operator.LookupSourceProvider;
import com.facebook.presto.operator.OuterPositionIterator;
import com.facebook.presto.operator.PagesIndex;
import com.facebook.presto.operator.StaticLookupSourceProvider;
import com.facebook.presto.operator.TaskContext;
import com.facebook.presto.spi.relation.VariableReferenceExpression;
import com.facebook.presto.sql.gen.JoinCompiler;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import io.airlift.units.DataSize;
import io.airlift.units.Duration;
import java.util.List;
import java.util.Map;
import java.util.OptionalInt;
import java.util.Set;
import java.util.function.Supplier;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.util.concurrent.Futures.transform;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static java.util.Objects.requireNonNull;

public class IndexLookupSourceFactory implements LookupSourceFactory {

    private final List<Type> outputTypes;

    private final Map<VariableReferenceExpression, Integer> layout;

    private final Supplier<IndexLoader> indexLoaderSupplier;

    private TaskContext taskContext;

    private final SettableFuture<?> whenTaskContextSet = SettableFuture.create();

    public IndexLookupSourceFactory(Set<Integer> lookupSourceInputChannels, List<Integer> keyOutputChannels, OptionalInt keyOutputHashChannel, List<Type> outputTypes, Map<VariableReferenceExpression, Integer> layout, IndexBuildDriverFactoryProvider indexBuildDriverFactoryProvider, DataSize maxIndexMemorySize, IndexJoinLookupStats stats, boolean shareIndexLoading, PagesIndex.Factory pagesIndexFactory, JoinCompiler joinCompiler, Duration indexLoaderTimeout) {
        this.outputTypes = ImmutableList.copyOf(requireNonNull(outputTypes, "outputTypes is null"));
        this.layout = ImmutableMap.copyOf(requireNonNull(layout, "layout is null"));
        if (shareIndexLoading) {
            IndexLoader shared = new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
            this.indexLoaderSupplier = () -> shared;
        } else {
            this.indexLoaderSupplier = () -> new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
        }
    }

    @Override
    public List<Type> getTypes() {
        return outputTypes;
    }

    @Override
    public List<Type> getOutputTypes() {
        return outputTypes;
    }

    @Override
    public Map<VariableReferenceExpression, Integer> getLayout() {
        return layout;
    }

    @Override
    public void setTaskContext(TaskContext taskContext) {
        this.taskContext = taskContext;
        whenTaskContextSet.set(null);
    }

    @Override
    public ListenableFuture<LookupSourceProvider> createLookupSourceProvider() {
        checkState(taskContext != null, "taskContext not set");
        IndexLoader indexLoader = indexLoaderSupplier.get();
        indexLoader.setContext(taskContext);
        return Futures.immediateFuture(new StaticLookupSourceProvider(new IndexLookupSource(indexLoader)));
    }

    @Override
    public ListenableFuture<?> whenBuildFinishes() {
        return Futures.transformAsync(whenTaskContextSet, ignored -> transform(this.createLookupSourceProvider(), lookupSourceProvider -> {
            // Close the lookupSourceProvider we just created.
            // The only reason we created it is to wait until lookup source is ready.
            lookupSourceProvider.close();
            return null;
        }, directExecutor()), directExecutor());
    }

    @Override
    public int partitions() {
        throw new UnsupportedOperationException();
    }

    @Override
    public OuterPositionIterator getOuterPositionIterator() {
        throw new UnsupportedOperationException();
    }

    @Override
    public void destroy()


package com.facebook.presto.operator.index;

import com.facebook.presto.common.type.Type;
import com.facebook.presto.operator.LookupSourceFactory;
import com.facebook.presto.operator.LookupSourceProvider;
import com.facebook.presto.operator.OuterPositionIterator;
import com.facebook.presto.operator.PagesIndex;
import com.facebook.presto.operator.StaticLookupSourceProvider;
import com.facebook.presto.operator.TaskContext;
import com.facebook.presto.spi.relation.VariableReferenceExpression;
import com.facebook.presto.sql.gen.JoinCompiler;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import io.airlift.units.DataSize;
import io.airlift.units.Duration;
import java.util.List;
import java.util.Map;
import java.util.OptionalInt;
import java.util.Set;
import java.util.function.Supplier;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.util.concurrent.Futures.transform;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static java.util.Objects.requireNonNull;

public class IndexLookupSourceFactory implements LookupSourceFactory {

    private final List<Type> outputTypes;

    private final Map<VariableReferenceExpression, Integer> layout;

    private final Supplier<IndexLoader> indexLoaderSupplier;

    private TaskContext taskContext;

    private final SettableFuture<?> whenTaskContextSet = SettableFuture.create();

    public IndexLookupSourceFactory(Set<Integer> lookupSourceInputChannels, List<Integer> keyOutputChannels, OptionalInt keyOutputHashChannel, List<Type> outputTypes, Map<VariableReferenceExpression, Integer> layout, IndexBuildDriverFactoryProvider indexBuildDriverFactoryProvider, DataSize maxIndexMemorySize, IndexJoinLookupStats stats, boolean shareIndexLoading, PagesIndex.Factory pagesIndexFactory, JoinCompiler joinCompiler, Duration indexLoaderTimeout) {
        this.outputTypes = ImmutableList.copyOf(requireNonNull(outputTypes, "outputTypes is null"));
        this.layout = ImmutableMap.copyOf(requireNonNull(layout, "layout is null"));
        if (shareIndexLoading) {
            IndexLoader shared = new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
            this.indexLoaderSupplier = () -> shared;
        } else {
            this.indexLoaderSupplier = () -> new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
        }
    }

    @Override
    public List<Type> getTypes() {
        return outputTypes;
    }

    @Override
    public List<Type> getOutputTypes() {
        return outputTypes;
    }

    @Override
    public Map<VariableReferenceExpression, Integer> getLayout() {
        return layout;
    }

    @Override
    public void setTaskContext(TaskContext taskContext) {
        this.taskContext = taskContext;
        whenTaskContextSet.set(null);
    }

    @Override
    public ListenableFuture<LookupSourceProvider> createLookupSourceProvider() {
        checkState(taskContext != null, "taskContext not set");
        IndexLoader indexLoader = indexLoaderSupplier.get();
        indexLoader.setContext(taskContext);
        return Futures.immediateFuture(new StaticLookupSourceProvider(new IndexLookupSource(indexLoader)));
    }

    @Override
    public ListenableFuture<?> whenBuildFinishes() {

        return Futures.transformAsync(whenTaskContextSet, ignored -> transform(this.createLookupSourceProvider(), lookupSourceProvider -> {
            // Close the lookupSourceProvider we just created.
            // The only reason we created it is to wait until lookup source is ready.
            lookupSourceProvider.close();
            return null;
        }, directExecutor()), directExecutor());
    }

    @Override
    public int partitions() {
        throw new UnsupportedOperationException();
    }

    @Override
    public OuterPositionIterator getOuterPositionIterator() {
        throw new UnsupportedOperationException();
    }

    @Override
    public void destroy() {
        // nothing to do
    }
}


return Futures.transformAsync(whenTaskContextSet, ignored -> transform(this.createLookupSourceProvider(), lookupSourceProvider -> {
            // Close the lookupSourceProvider we just created.
            // The only reason we created it is to wait until lookup source is ready.
            lookupSourceProvider.close();
            return null;
        }, directExecutor()), directExecutor());

    }

    @Override
    public int partitions() {
        throw new UnsupportedOperationException();
    }

    @Override
    public OuterPositionIterator getOuterPositionIterator() {
        throw new UnsupportedOperationException();
    }

    @Override
    public void destroy() {
        // nothing to do
    }
}


package com.facebook.presto.operator.index;

import com.facebook.presto.common.type.Type;
import com.facebook.presto.operator.LookupSourceFactory;
import com.facebook.presto.operator.LookupSourceProvider;
import com.facebook.presto.operator.OuterPositionIterator;
import com.facebook.presto.operator.PagesIndex;
import com.facebook.presto.operator.StaticLookupSourceProvider;
import com.facebook.presto.operator.TaskContext;
import com.facebook.presto.spi.relation.VariableReferenceExpression;
import com.facebook.presto.sql.gen.JoinCompiler;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import io.airlift.units.DataSize;
import io.airlift.units.Duration;
import java.util.List;
import java.util.Map;
import java.util.OptionalInt;
import java.util.Set;
import java.util.function.Supplier;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.util.concurrent.Futures.transform;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static java.util.Objects.requireNonNull;

public class IndexLookupSourceFactory implements LookupSourceFactory {

    private final List<Type> outputTypes;

    private final Map<VariableReferenceExpression, Integer> layout;

    private final Supplier<IndexLoader> indexLoaderSupplier;

    private TaskContext taskContext;

    private final SettableFuture<?> whenTaskContextSet = SettableFuture.create();

    public IndexLookupSourceFactory(Set<Integer> lookupSourceInputChannels, List<Integer> keyOutputChannels, OptionalInt keyOutputHashChannel, List<Type> outputTypes, Map<VariableReferenceExpression, Integer> layout, IndexBuildDriverFactoryProvider indexBuildDriverFactoryProvider, DataSize maxIndexMemorySize, IndexJoinLookupStats stats, boolean shareIndexLoading, PagesIndex.Factory pagesIndexFactory, JoinCompiler joinCompiler, Duration indexLoaderTimeout) {
        this.outputTypes = ImmutableList.copyOf(requireNonNull(outputTypes, "outputTypes is null"));
        this.layout = ImmutableMap.copyOf(requireNonNull(layout, "layout is null"));
        if (shareIndexLoading) {
            IndexLoader shared = new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
            this.indexLoaderSupplier = () -> shared;
        } else {
            this.indexLoaderSupplier = () -> new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
        }
    }

    @Override
    public List<Type> getTypes() {
        return outputTypes;
    }

    @Override
    public List<Type> getOutputTypes() {
        return outputTypes;
    }

    @Override
    public Map<VariableReferenceExpression, Integer> getLayout() {
        return layout;
    }

    @Override
    public void setTaskContext(TaskContext taskContext) {
        this.taskContext = taskContext;
        whenTaskContextSet.set(null);
    }

    @Override
    public ListenableFuture<LookupSourceProvider> createLookupSourceProvider() {
        checkState(taskContext != null, "taskContext not set");
        IndexLoader indexLoader = indexLoaderSupplier.get();
        indexLoader.setContext(taskContext);
        return Futures.immediateFuture(new StaticLookupSourceProvider(new IndexLookupSource(indexLoader)));
    }

    @Override
    public ListenableFuture<?> whenBuildFinishes() {
        return Futures.transformAsync(whenTaskContextSet, ignored -> transform(this.createLookupSourceProvider(), lookupSourceProvider -> {
            // Close the lookupSourceProvider we just created.
            // The only reason we created it is to wait until lookup source is ready.
            lookupSourceProvider.close();
            return null;
        }, directExecutor()), directExecutor());

    @Override
    public int partitions() {
        throw new UnsupportedOperationException();
    }

    @Override
    public OuterPositionIterator getOuterPositionIterator() {
        throw new UnsupportedOperationException();
    }

    @Override
    public void destroy() {
        // nothing to do
    }
}


package com.facebook.presto.operator.index;

import com.facebook.presto.common.type.Type;
import com.facebook.presto.operator.LookupSourceFactory;
import com.facebook.presto.operator.LookupSourceProvider;
import com.facebook.presto.operator.OuterPositionIterator;
import com.facebook.presto.operator.PagesIndex;
import com.facebook.presto.operator.StaticLookupSourceProvider;
import com.facebook.presto.operator.TaskContext;
import com.facebook.presto.spi.relation.VariableReferenceExpression;
import com.facebook.presto.sql.gen.JoinCompiler;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import io.airlift.units.DataSize;
import io.airlift.units.Duration;
import java.util.List;
import java.util.Map;
import java.util.OptionalInt;
import java.util.Set;
import java.util.function.Supplier;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.util.concurrent.Futures.transform;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static java.util.Objects.requireNonNull;

public class IndexLookupSourceFactory implements LookupSourceFactory {

    private final List<Type> outputTypes;

    private final Map<VariableReferenceExpression, Integer> layout;

    private final Supplier<IndexLoader> indexLoaderSupplier;

    private TaskContext taskContext;

    private final SettableFuture<?> whenTaskContextSet = SettableFuture.create();

    public IndexLookupSourceFactory(Set<Integer> lookupSourceInputChannels, List<Integer> keyOutputChannels, OptionalInt keyOutputHashChannel, List<Type> outputTypes, Map<VariableReferenceExpression, Integer> layout, IndexBuildDriverFactoryProvider indexBuildDriverFactoryProvider, DataSize maxIndexMemorySize, IndexJoinLookupStats stats, boolean shareIndexLoading, PagesIndex.Factory pagesIndexFactory, JoinCompiler joinCompiler, Duration indexLoaderTimeout) {
        this.outputTypes = ImmutableList.copyOf(requireNonNull(outputTypes, "outputTypes is null"));
        this.layout = ImmutableMap.copyOf(requireNonNull(layout, "layout is null"));
        if (shareIndexLoading) {
            IndexLoader shared = new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
            this.indexLoaderSupplier = () -> shared;
        } else {
            this.indexLoaderSupplier = () -> new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
        }
    }

    @Override
    public List<Type> getTypes() {
        return outputTypes;
    }

    @Override
    public List<Type> getOutputTypes() {
        return outputTypes;
    }

    @Override
    public Map<VariableReferenceExpression, Integer> getLayout() {
        return layout;
    }

    @Override
    public void setTaskContext(TaskContext taskContext) {
        this.taskContext = taskContext;
        whenTaskContextSet.set(null);
    }

    @Override
    public ListenableFuture<LookupSourceProvider> createLookupSourceProvider() {
        checkState(taskContext != null, "taskContext not set");
        IndexLoader indexLoader = indexLoaderSupplier.get();
        indexLoader.setContext(taskContext);
        return Futures.immediateFuture(new StaticLookupSourceProvider(new IndexLookupSource(indexLoader)));
    }

    @Override
    public ListenableFuture<?> whenBuildFinishes() {
        return Futures.transformAsync(whenTaskContextSet, ignored -> transform(this.createLookupSourceProvider(), lookupSourceProvider -> {
            // Close the lookupSourceProvider we just created.
            // The only reason we created it is to wait until lookup source is ready.
            lookupSourceProvider.close();
            return null;
        }, directExecutor()), directExecutor());
    }

    @Override
    public int partitions() {
        throw new UnsupportedOper

    }

    @Override
    public OuterPositionIterator getOuterPositionIterator() {
        throw new UnsupportedOperationException();
    }

    @Override
    public void destroy() {
        // nothing to do
    }
}


package com.facebook.presto.operator.index;

import com.facebook.presto.common.type.Type;
import com.facebook.presto.operator.LookupSourceFactory;
import com.facebook.presto.operator.LookupSourceProvider;
import com.facebook.presto.operator.OuterPositionIterator;
import com.facebook.presto.operator.PagesIndex;
import com.facebook.presto.operator.StaticLookupSourceProvider;
import com.facebook.presto.operator.TaskContext;
import com.facebook.presto.spi.relation.VariableReferenceExpression;
import com.facebook.presto.sql.gen.JoinCompiler;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import io.airlift.units.DataSize;
import io.airlift.units.Duration;
import java.util.List;
import java.util.Map;
import java.util.OptionalInt;
import java.util.Set;
import java.util.function.Supplier;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.util.concurrent.Futures.transform;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static java.util.Objects.requireNonNull;

public class IndexLookupSourceFactory implements LookupSourceFactory {

    private final List<Type> outputTypes;

    private final Map<VariableReferenceExpression, Integer> layout;

    private final Supplier<IndexLoader> indexLoaderSupplier;

    private TaskContext taskContext;

    private final SettableFuture<?> whenTaskContextSet = SettableFuture.create();

    public IndexLookupSourceFactory(Set<Integer> lookupSourceInputChannels, List<Integer> keyOutputChannels, OptionalInt keyOutputHashChannel, List<Type> outputTypes, Map<VariableReferenceExpression, Integer> layout, IndexBuildDriverFactoryProvider indexBuildDriverFactoryProvider, DataSize maxIndexMemorySize, IndexJoinLookupStats stats, boolean shareIndexLoading, PagesIndex.Factory pagesIndexFactory, JoinCompiler joinCompiler, Duration indexLoaderTimeout) {
        this.outputTypes = ImmutableList.copyOf(requireNonNull(outputTypes, "outputTypes is null"));
        this.layout = ImmutableMap.copyOf(requireNonNull(layout, "layout is null"));
        if (shareIndexLoading) {
            IndexLoader shared = new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
            this.indexLoaderSupplier = () -> shared;

    } else {
            this.indexLoaderSupplier = () -> new IndexLoader(lookupSourceInputChannels, keyOutputChannels, keyOutputHashChannel, outputTypes, indexBuildDriverFactoryProvider, 10_000, maxIndexMemorySize, stats, pagesIndexFactory, joinCompiler, indexLoaderTimeout);
        }
    }

    @Override
    public List<Type> getTypes() {
        return outputTypes;
    }

    @Override
    public List<Type> getOutputTypes() {
        return outputTypes;
    }

    @Override
    public Map<VariableReferenceExpression, Integer> getLayout() {
        return layout;
    }

    @Override
    public void setTaskContext(TaskContext taskContext) {
        this.taskContext = taskContext;
        whenTaskContextSet.set(null);
    }

    @Override
    public ListenableFuture<LookupSourceProvider> createLookupSourceProvider() {
        checkState(taskContext != null, "taskContext not set");
        IndexLoader indexLoader = indexLoaderSupplier.get();
        indexLoader.setContext(taskContext);
        return Futures.immediateFuture(new StaticLookupSourceProvider(new IndexLookupSource(indexLoader)));
    }

    @Override
    public ListenableFuture<?> whenBuildFinishes() {
        return Futures.transformAsync(whenTaskContextSet, ignored -> transform(this.createLookupSourceProvider(), lookupSourceProvider -> {
            // Close the lookupSourceProvider we just created.
            // The only reason we created it is to wait until lookup source is ready.
            lookupSourceProvider.close();
            return null;
        }, directExecutor()), directExecutor());
    }

    @Override
    public int partitions() {
        throw new UnsupportedOperationException();
    }

    @Override
    public OuterPositionIterator getOuterPositionIterator() {
        throw new UnsupportedOperationException();
    }

    @Override
    public void destroy() {
        // nothing to do
    }
}


package org.apache.dolphinscheduler.common.enums;

/**
 * data types in user define par

ameter
 */
public enum DataType {

    VARCHAR,
    INTEGER,
    LONG,
    FLOAT,
    DOUBLE,
    DATE,
    TIME,
    TIMESTAMP,
    BOOLEAN,
    LIST
}