Well, if you have 2 diamonds to spare, get some diamond pipes, and put them directly on the top of the barrel:
where i is the input, = is the diamond pipes, and o the output.
Just tell them to make the required item go down, and nothing else specified on any other color.
If the barrel is full, your cobble or whatever will continue along the line, to the next diamond pipe telling it to go somewhere specific, or to the output.
Just add a final diamond pipe near the output to route all the excess you don't want to keep into a void pipe.
I usually use this setup, as it seems easier to setup that RP for me, but that is up to the person's preference.
Plus, if you want to do something special if a barrel is full, you have the gates, with "Inventory full", "Inventory empty" or "Has space in inventory", connecting to either redstone or to pipe wires.
Hope it helps