<commit_before>// Copyright 2016 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package mesos

import (
	"io"

	"github.com/pkg/errors"
	"github.com/tsuru/tsuru/event"
	"github.com/tsuru/tsuru/provision"
)

const (
	provisionerName = "mesos"
)

var errNotImplemented = errors.New("not implemented")

type mesosProvisioner struct{}

func init() {
	provision.Register(provisionerName, func() (provision.Provisioner, error) {
		return &mesosProvisioner{}, nil
	})
}

func (p *mesosProvisioner) GetName() string {
	return provisionerName
}

func (p *mesosProvisioner) Provision(provision.App) error {
	return errNotImplemented
}

func (p *mesosProvisioner) Destroy(provision.App) error {
	return errNotImplemented
}

func (p *mesosProvisioner) AddUnits(provision.App, uint, string, io.Writer) error {
	return errNotImplemented
}

func (p *mesosProvisioner) RemoveUnits(provision.App, uint, string, io.Writer) error {
	return errNotImplemented
}

func (p *mesosProvisioner) SetUnitStatus(provision.Unit, provision.Status) error {
	return errNotImplemented
}

func (p *mesosProvisioner) Restart(provision.App, string, io.Writer) error {
	return errNotImplemented
}

func (p *mesosProvisioner) Start(provision.App, string) error {
	return errNotImplemented
}

func (p *mesosProvisioner) Stop(provision.App, string) error {
	return errNotImplemented
}

func (p *mesosProvisioner) Units(app provision.App) ([]provision.Unit, error) {
	return nil, errNotImplemented
}

func (p *mesosProvisioner) RoutableUnits(app provision.App) ([]provision.Unit, error) {
	return nil, errNotImplemented
}

func (p *mesosProvisioner) RegisterUnit(unit provision.Unit, customData map[string]interface{}) error {
	return errNotImplemented
}

func (p *mesosProvisioner) ListNodes(addressFilter []string) ([]provision.Node, error) {
	return nil, errNotImplemented
}

func (p *mesosProvisioner) GetNode(address string) (provision.Node, error) {
	return nil, errNotImplemented
}

func (p *mesosProvisioner) AddNode(opts provision.AddNodeOptions) error {
	return errNotImplemented
}

func (p *mesosProvisioner) RemoveNode(opts provision.RemoveNodeOptions) error {
	return errNotImplemented<commit_msg>mesos: implement add node<commit_after>// Copyright 2016 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package mesos

import (
	"io"

	"github.com/pkg/errors"
	"github.com/tsuru/tsuru/event"
	"github.com/tsuru/tsuru/provision"
	"gopkg.in/mgo.v2/bson"
)

const (
	provisionerName = "mesos"
)

var errNotImplemented = errors.New("not implemented")

type mesosProvisioner struct{}

func init() {
	provision.Register(provisionerName, func() (provision.Provisioner, error) {
		return &mesosProvisioner{}, nil
	})
}

func (p *mesosProvisioner) GetName() string {
	return provisionerName
}

func (p *mesosProvisioner) Provision(provision.App) error {
	return errNotImplemented
}

func (p *mesosProvisioner) Destroy(provision.App) error {
	return errNotImplemented
}

func (p *mesosProvisioner) AddUnits(provision.App, uint, string, io.Writer) error {
	return errNotImplemented
}

func (p *mesosProvisioner) RemoveUnits(provision.App, uint, string, io.Writer) error {
	return errNotImplemented
}

func (p *mesosProvisioner) SetUnitStatus(provision.Unit, provision.Status) error {
	return errNotImplemented
}

func (p *mesosProvisioner) Restart(provision.App, string, io.Writer) error {
	return errNotImplemented
}

func (p *mesosProvisioner) Start(provision.App, string) error {
	return errNotImplemented
}

func (p *mesosProvisioner) Stop(provision.App, string) error {
	return errNotImplemented
}

func (p *mesosProvisioner) Units(app provision.App) ([]provision.Unit, error) {
	return nil, errNotImplemented
}

func (p *mesosProvisioner) RoutableUnits(app provision.App) ([]provision.Unit, error) {
	return nil, errNotImplemented
}

func (p *mesosProvisioner) RegisterUnit(unit provision.Unit, customData map[string]interface{}) error {
	return errNotImplemented
}

func (p *mesosProvisioner) ListNodes(addressFilter []string) ([]provision.Node, error) {
	return nil, errNotImplemented
}

func (p *mesosProvisioner) GetNode(address string) (provision.Node, error) {
	return nil, errNotImplemented
}

func (p *mesosProvisioner) AddNode(opts provision.AddNodeOptions) error {
	coll, err := nodeAddrCollection()
	if err != nil {
		return err
	}
	defer coll.Close()
	addrs := []string{opts.Address}
	_, err = coll.UpsertId(uniqueDocumentID, bson.M{"$set": bson.M{"addresses": addrs}})
	if err != nil {
		return errors.WithStack(err)
	}
	return nil
}

func (p *mesosProvisioner) RemoveNode(opts provision.RemoveNodeOptions) error {
	return errNotImplemented
{'fraction_non_alphanumeric': 0.1103247293921732, 'fraction_numerical': 0.0018734388009991674, 'mean_word_length': 5.710893854748603, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4015497', 'n_tokens_mistral': 1654, 'n_tokens_neox': 1642, 'n_words': 411}