<commit_before>//  Copyright (c) 2014 Couchbase, Inc.
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the
//  License. You may obtain a copy of the License at
//    http://www.apache.org/licenses/LICENSE-2.0
//  Unless required by applicable law or agreed to in writing,
//  software distributed under the License is distributed on an "AS
//  IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
//  express or implied. See the License for the specific language
//  governing permissions and limitations under the License.

package main

import (
	"fmt"

	log "github.com/couchbaselabs/clog"
)

const PLANNER_VERSION = "0.0.0" // Follow semver rules.

type Plan struct {
}

type LogicalIndex struct {
}

type LogicalIndexes []*LogicalIndex

type Indexer struct {
}

type Indexers []*Indexer

// A planner assigns partitions to cbft's and to PIndexes on each cbft.
func (mgr *Manager) PlannerLoop() {
	for _ = range mgr.plannerCh {
		currAllowedPlannerVersion := "0.0"
		plan, err := mgr.CalcPlan(nil, nil, currAllowedPlannerVersion)
		if err != nil {
			log.Printf("error: CalcPlan, err: %v", err)
		}
		if plan != nil {
			// TODO: save the plan.
		}
	}
}

func (mgr *Manager) CalcPlan(logicalIndexes LogicalIndexes,
	indexers Indexers,
	allowPlannerVersion string) (*Plan, error) {
	// TODO: implement the grand plans for the planner.
	// First gen planner should keep it simple, such as...
	// - a single Feed for every datasource node.
	// - a Feed might "fan out" to multiple Streams/PIndexes.
	// - have a single PIndex for all datasource partitions
	//   (vbuckets) to start.
	return nil, fmt.Errorf("TODO")
}
<commit_msg>TODO comment on allowed version<commit_after>//  Copyright (c) 2014 Couchbase, Inc.
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the
//  License. You may obtain a copy of the License at
//    http://www.apache.org/licenses/LICENSE-2.0
//  Unless required by applicable law or agreed to in writing,
//  software distributed under the License is distributed on an "AS
//  IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
//  express or implied. See the License for the specific language
//  governing permissions and limitations under the License.

package main

import (
	"fmt"

	log "github.com/couchbaselabs/clog"
)

const PLANNER_VERSION = "0.0.0" // Follow semver rules.

type Plan struct {
}

type LogicalIndex struct {
}

type LogicalIndexes []*LogicalIndex

type Indexer struct {
}

type Indexers []*Indexer

// A planner assigns partitions to cbft's and to PIndexes on each cbft.
func (mgr *Manager) PlannerLoop() {
	for _ = range mgr.plannerCh {
		// TODO: get allowed version from Cfg.
		currAllowedPlannerVersion := "0.0"
		plan, err := mgr.CalcPlan(nil, nil, currAllowedPlannerVersion)
		if err != nil {
			log.Printf("error: CalcPlan, err: %v", err)
		}
		if plan != nil {
			// TODO: save the plan.
		}
	}
}

func (mgr *Manager) CalcPlan(logicalIndexes LogicalIndexes,
	indexers Indexers,
	allowPlannerVersion string) (*Plan, error) {
	// TODO: implement the grand plans for the planner.
	// First gen planner should keep it simple, such as...
	// - a single Feed for every datasource node.
	// - a Feed might "fan out" to multiple Streams/PIndexes.
	// - have a single PIndex for all datasource partitions
	//   (vbuckets) to start.
	return nil, fmt.Errorf("TODO")
}

{'fraction_non_alphanumeric': 0.1031223145230593, 'fraction_numerical': 0.007447722715554283, 'mean_word_length': 3.425855513307985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6842823', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1109, 'n_words': 428}