SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
chore(weed/mq/kafka/protocol): remove unused functions and variables (#9488)
Lars Lehtonen75c807b586b0
diff --git a/weed/mq/kafka/protocol/consumer_coordination.go b/weed/mq/kafka/protocol/consumer_coordination.goindex 9e3db02aae..ac6a1486b1 100644--- a/weed/mq/kafka/protocol/consumer_coordination.go+++ b/weed/mq/kafka/protocol/consumer_coordination.go@@ -519,23 +519,6 @@ func (h *Handler) parseLeaveGroupRequest(data []byte, apiVersion uint16) (*Leavereturn req, nil}-func (h *Handler) buildHeartbeatResponse(response HeartbeatResponse) []byte {- result := make([]byte, 0, 12)-- // NOTE: Correlation ID is handled by writeResponseWithCorrelationID- // Do NOT include it in the response body-- // Error code (2 bytes)- errorCodeBytes := make([]byte, 2)- binary.BigEndian.PutUint16(errorCodeBytes, uint16(response.ErrorCode))- result = append(result, errorCodeBytes...)-- // Throttle time (4 bytes, 0 = no throttling)- result = append(result, 0, 0, 0, 0)-- return result-}-func (h *Handler) buildHeartbeatResponseV(response HeartbeatResponse, apiVersion uint16) []byte {isFlexible := IsFlexibleVersion(12, apiVersion) // Heartbeat API key = 12result := make([]byte, 0, 16)@@ -717,15 +700,6 @@ func (h *Handler) buildLeaveGroupFullResponse(response LeaveGroupResponse) []bytreturn result}-func (h *Handler) buildHeartbeatErrorResponse(correlationID uint32, errorCode int16) []byte {- response := HeartbeatResponse{- CorrelationID: correlationID,- ErrorCode: errorCode,- }-- return h.buildHeartbeatResponse(response)-}-func (h *Handler) buildHeartbeatErrorResponseV(correlationID uint32, errorCode int16, apiVersion uint16) []byte {response := HeartbeatResponse{CorrelationID: correlationID,diff --git a/weed/mq/kafka/protocol/handler.go b/weed/mq/kafka/protocol/handler.goindex 8525c88acf..0e726fd1d3 100644--- a/weed/mq/kafka/protocol/handler.go+++ b/weed/mq/kafka/protocol/handler.go@@ -286,8 +286,6 @@ type Handler struct {inferredRecordTypes map[string]*schema_pb.RecordTypeinferredRecordTypesMu sync.RWMutex- filerClient filer_pb.SeaweedFilerClient-// SMQ broker addresses discovered from masters for Metadata responsessmqBrokerAddresses []stringdiff --git a/weed/mq/kafka/protocol/offset_fetch_pattern_test.go b/weed/mq/kafka/protocol/offset_fetch_pattern_test.goindex 544e0c9f65..fdd168edf3 100644--- a/weed/mq/kafka/protocol/offset_fetch_pattern_test.go+++ b/weed/mq/kafka/protocol/offset_fetch_pattern_test.go@@ -98,16 +98,6 @@ func TestOffsetFetchAfterCommit(t *testing.T) {t.Skip("Integration test - requires mock broker setup")t.Run("FetchAfterCommit", func(t *testing.T) {- type FetchRequest struct {- partition int32- offset int64- }-- type FetchResponse struct {- records []byte- nextOffset int64- }-// Simulate: Commit offset 163, then fetch offset 164committedOffset := int64(163)nextFetchOffset := committedOffset + 1@@ -213,10 +203,8 @@ func TestLongPollWithOffsetCommit(t *testing.T) {// Critical: long-poll duration should NOT be reported as throttleTimeMs// This was bug 8969b4509- const maxWaitTime = 5 * time.Second-// Simulate long-poll wait (no data available)- time.Sleep(100 * time.Millisecond) // Broker waits up to maxWaitTime+ time.Sleep(100 * time.Millisecond)// throttleTimeMs should be 0 (NOT elapsed duration!)throttleTimeMs := int32(0) // CORRECTdiff --git a/weed/mq/kafka/protocol/response_validation_example_test.go b/weed/mq/kafka/protocol/response_validation_example_test.goindex a69c03f4fe..3d07de7566 100644--- a/weed/mq/kafka/protocol/response_validation_example_test.go+++ b/weed/mq/kafka/protocol/response_validation_example_test.go@@ -100,16 +100,6 @@ func TestCurrentTestingApproach(t *testing.T) {t.Log(" This is why JoinGroup issue wasn't caught by unit tests")}-// parseCompactArray is a helper that would be needed for field-level testing-func parseCompactArray(data []byte) int {- // Compact array encoding: varint length (length+1 for non-null, 0 for null)- length := int(data[0])- if length == 0 {- return -1 // null- }- return length - 1 // actual length-}-// Example of a REAL field-level test we could writefunc TestMetadataResponseHasBrokers(t *testing.T) {t.Skip("Example of what a real field-level test would look like")