Ejemplo n.º 1
0
func SendRemoveTopic(clusterId string, nodesToConfigure []string, topicName string) error {
	newConfig := server.GetEmptyConfiguration()

	newConfig.Cluster_ID = clusterId
	newConfig.Scope = server.CNF_Remove_Topic
	newConfig.Topics[topicName] = server.ConfigTopic{Name: topicName}
	return sendConfiguration(nodesToConfigure, newConfig)
}
Ejemplo n.º 2
0
func SendSetPeers(clusterId string, nodesToConfigure []string, peers []string) (err error) {
	newConfig := server.GetEmptyConfiguration()

	newConfig.Peers = peers
	newConfig.Cluster_ID = clusterId
	newConfig.Scope = server.CNF_Set_Peers
	return sendConfiguration(nodesToConfigure, newConfig)
}
Ejemplo n.º 3
0
func SendTopic(clusterId string, nodesToConfigure []string, topicName string, segmentSize int, segmentCleanAgeHours int) error {
	newConfig := server.GetEmptyConfiguration()

	newConfig.Cluster_ID = clusterId
	newConfig.Scope = server.CNF_Set_Topic
	segmentCleanup := time.Duration(segmentCleanAgeHours) * time.Hour
	newConfig.Topics[topicName] = server.ConfigTopic{Name: topicName, SegmentSize: segmentSize, SegmentCleanupAge: segmentCleanup}
	if segmentCleanup >= 0 {
		fmt.Printf("Setting segment clean up age to: %v\n", segmentCleanup)
	}
	if segmentSize > 0 {
		fmt.Printf("Setting target segment size to %vMB\n", segmentSize)
	}
	return sendConfiguration(nodesToConfigure, newConfig)
}