We construct the effective Hamiltonian which governs the renormalization group flow of the gluon distribution with increasing energy and in the leading logarithmic approximation. This Hamiltonian defines a two-dimensional field theory which involves two types of Wilson lines: longitudinal Wilson lines which describe gluon recombination (or merging) and temporal Wilson lines which account for gluon bremsstrahlung (or splitting). The Hamiltonian is self-dual, i.e., it is invariant under the exchange of the two types of Wilson lines. In the high density regime where one can neglect gluon number fluctuations, the general Hamiltonian reduces to that for the JIMWLK evolution. In the dilute regime where gluon recombination becomes unimportant, it reduces to the dual partner of the JIMWLK Hamiltonian, which describes bremsstrahlung.